diff options
author | nyamatongwe <devnull@localhost> | 2009-06-24 10:16:12 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2009-06-24 10:16:12 +0000 |
commit | 961f79014a8a2c8e809664e9e6444aa2042595e0 (patch) | |
tree | 4ded4bc6c0cf1dbe2f413c1cc82d72ea4bf3488f | |
parent | 1f43bf9fe1b4df2daf93d1776a88d41929946864 (diff) | |
download | scintilla-mirror-961f79014a8a2c8e809664e9e6444aa2042595e0.tar.gz |
Some extra const constraints added while working on discontiguous selection.
-rw-r--r-- | src/CellBuffer.cxx | 2 | ||||
-rw-r--r-- | src/CellBuffer.h | 4 | ||||
-rw-r--r-- | src/Document.cxx | 6 | ||||
-rw-r--r-- | src/Document.h | 6 | ||||
-rw-r--r-- | src/Editor.cxx | 2 | ||||
-rw-r--r-- | src/Editor.h | 2 | ||||
-rw-r--r-- | src/Partitioning.h | 2 |
7 files changed, 12 insertions, 12 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index 7134d3188..5385cccde 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -62,7 +62,7 @@ void LineVector::RemoveLine(int line) { } } -int LineVector::LineFromPosition(int pos) { +int LineVector::LineFromPosition(int pos) const { return starts.PartitionFromPosition(pos); } diff --git a/src/CellBuffer.h b/src/CellBuffer.h index 336dfb4df..3381c19c2 100644 --- a/src/CellBuffer.h +++ b/src/CellBuffer.h @@ -43,7 +43,7 @@ public: int Lines() const { return starts.Partitions(); } - int LineFromPosition(int pos); + int LineFromPosition(int pos) const; int LineStart(int line) const { return starts.PositionFromPartition(line); } @@ -158,7 +158,7 @@ public: void SetPerLine(PerLine *pl); int Lines() const; int LineStart(int line) const; - int LineFromPosition(int pos) { return lv.LineFromPosition(pos); } + int LineFromPosition(int pos) const { return lv.LineFromPosition(pos); } void InsertLine(int line, int position); void RemoveLine(int line); const char *InsertString(int position, const char *s, int insertLength, bool &startSequence); diff --git a/src/Document.cxx b/src/Document.cxx index c71f840b6..211d19315 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -209,15 +209,15 @@ int Document::LineEnd(int line) const { } } -int Document::LineFromPosition(int pos) { +int Document::LineFromPosition(int pos) const { return cb.LineFromPosition(pos); } -int Document::LineEndPosition(int position) { +int Document::LineEndPosition(int position) const { return LineEnd(LineFromPosition(position)); } -int Document::VCHomePosition(int position) { +int Document::VCHomePosition(int position) const { int line = LineFromPosition(position); int startPosition = LineStart(line); int endLine = LineEnd(line); diff --git a/src/Document.h b/src/Document.h index 19840315c..58615bb19 100644 --- a/src/Document.h +++ b/src/Document.h @@ -179,7 +179,7 @@ public: virtual void InsertLine(int line); virtual void RemoveLine(int line); - int LineFromPosition(int pos); + int LineFromPosition(int pos) const; int ClampPositionIntoDocument(int pos); bool IsCrLf(int pos); int LenChar(int pos); @@ -238,8 +238,8 @@ public: int LineFromHandle(int markerHandle); int LineStart(int line) const; int LineEnd(int line) const; - int LineEndPosition(int position); - int VCHomePosition(int position); + int LineEndPosition(int position) const; + int VCHomePosition(int position) const; int SetLevel(int line, int level); int GetLevel(int line); diff --git a/src/Editor.cxx b/src/Editor.cxx index f7f5cb2bb..4902c15d1 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -788,7 +788,7 @@ bool Editor::SelectionContainsProtected() { /** * Asks document to find a good position and then moves out of any invisible positions. */ -int Editor::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) { +int Editor::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) const { pos = pdoc->MovePositionOutsideChar(pos, moveDir, checkLineEnd); if (vs.ProtectionActive()) { int mask = pdoc->stylingBitsMask; diff --git a/src/Editor.h b/src/Editor.h index e9372be00..a318e6282 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -284,7 +284,7 @@ protected: // ScintillaBase subclass needs access to much of Editor void SetEmptySelection(int currentPos_); bool RangeContainsProtected(int start, int end) const; bool SelectionContainsProtected(); - int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true); + int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true) const; int MovePositionTo(int newPos, selTypes sel=noSel, bool ensureVisible=true); int MovePositionSoVisible(int pos, int moveDir); void SetLastXChosen(); diff --git a/src/Partitioning.h b/src/Partitioning.h index 752e69614..225e350e0 100644 --- a/src/Partitioning.h +++ b/src/Partitioning.h @@ -153,7 +153,7 @@ public: return pos; } - int PartitionFromPosition(int pos) { + int PartitionFromPosition(int pos) const { if (body->Length() <= 1) return 0; if (pos >= (PositionFromPartition(body->Length()-1))) |