From dcb4511f2297c3e66c210cc92d56ce03d94c4e8d Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 16 Jun 2015 13:11:03 +1000 Subject: Clean up some selection operations. Commonly when changing selection modes, all of the selection needs to be redrawn so that is implmeneted in Editor::InvalidateWholeSelection. Any extra selections should be discarded with only the main remaining so that is Selection::DropAdditionalRanges. Some default parameters led to less clarity so they no longer have default values. Both Editor::MovePositionTo methods always returned 0 which was ignored so they are now void. Some variables were made const. --- src/Editor.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Editor.h') diff --git a/src/Editor.h b/src/Editor.h index b08fc7159..3301c4b05 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -313,6 +313,7 @@ protected: // ScintillaBase subclass needs access to much of Editor void SetRectangularRange(); void ThinRectangularRange(); void InvalidateSelection(SelectionRange newMain, bool invalidateWholeSelection=false); + void InvalidateWholeSelection(); void SetSelection(SelectionPosition currentPos_, SelectionPosition anchor_); void SetSelection(int currentPos_, int anchor_); void SetSelection(SelectionPosition currentPos_); @@ -325,8 +326,8 @@ protected: // ScintillaBase subclass needs access to much of Editor bool SelectionContainsProtected(); int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true) const; SelectionPosition MovePositionOutsideChar(SelectionPosition pos, int moveDir, bool checkLineEnd=true) const; - int MovePositionTo(SelectionPosition newPos, Selection::selTypes selt=Selection::noSel, bool ensureVisible=true); - int MovePositionTo(int newPos, Selection::selTypes selt=Selection::noSel, bool ensureVisible=true); + void MovePositionTo(SelectionPosition newPos, Selection::selTypes selt=Selection::noSel, bool ensureVisible=true); + void MovePositionTo(int newPos, Selection::selTypes selt=Selection::noSel, bool ensureVisible=true); SelectionPosition MovePositionSoVisible(SelectionPosition pos, int moveDir); SelectionPosition MovePositionSoVisible(int pos, int moveDir); Point PointMainCaret(); @@ -457,8 +458,8 @@ protected: // ScintillaBase subclass needs access to much of Editor void Duplicate(bool forLine); virtual void CancelModes(); void NewLine(); - void CursorUpOrDown(int direction, Selection::selTypes selt=Selection::noSel); - void ParaUpOrDown(int direction, Selection::selTypes selt=Selection::noSel); + void CursorUpOrDown(int direction, Selection::selTypes selt); + void ParaUpOrDown(int direction, Selection::selTypes selt); int StartEndDisplayLine(int pos, bool start); virtual int KeyCommand(unsigned int iMessage); virtual int KeyDefault(int /* key */, int /*modifiers*/); -- cgit v1.2.3