diff options
author | nyamatongwe <devnull@localhost> | 2010-09-16 10:31:20 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2010-09-16 10:31:20 +1000 |
commit | e534f677b047909df92e63c9cad0174b435a955e (patch) | |
tree | 9d7327244a8466b64c1c4738ca1f2f2462f1add1 /src | |
parent | 445d15200d654c4f961d80f112738ec46a05ffa7 (diff) | |
download | scintilla-mirror-e534f677b047909df92e63c9cad0174b435a955e.tar.gz |
Making methods const when they should be.
Diffstat (limited to 'src')
-rw-r--r-- | src/Document.cxx | 4 | ||||
-rw-r--r-- | src/Document.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 5bf9adbe4..8ebd407d8 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -416,7 +416,7 @@ static int BytesFromLead(int leadByte) { return 0; } -bool Document::InGoodUTF8(int pos, int &start, int &end) { +bool Document::InGoodUTF8(int pos, int &start, int &end) const { int lead = pos; while ((lead>0) && (pos-lead < 4) && IsTrailByte(static_cast<unsigned char>(cb.CharAt(lead-1)))) lead--; @@ -515,7 +515,7 @@ int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) { // NextPosition moves between valid positions - it can not handle a position in the middle of a // multi-byte character. It is used to iterate through text more efficiently than MovePositionOutsideChar. // A \r\n pair is treated as two characters. -int Document::NextPosition(int pos, int moveDir) { +int Document::NextPosition(int pos, int moveDir) const { // If out of range, just return minimum/maximum value. int increment = (moveDir > 0) ? 1 : -1; if (pos + increment <= 0) diff --git a/src/Document.h b/src/Document.h index c7ff8e069..d58c5efe5 100644 --- a/src/Document.h +++ b/src/Document.h @@ -228,9 +228,9 @@ public: int ClampPositionIntoDocument(int pos); bool IsCrLf(int pos); int LenChar(int pos); - bool InGoodUTF8(int pos, int &start, int &end); + bool InGoodUTF8(int pos, int &start, int &end) const; int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true); - int NextPosition(int pos, int moveDir); + int NextPosition(int pos, int moveDir) const; bool NextCharacter(int &pos, int moveDir); // Returns true if pos changed int SCI_METHOD CodePage() const; bool SCI_METHOD IsDBCSLeadByte(char ch) const; |