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/Selection.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Selection.cxx') diff --git a/src/Selection.cxx b/src/Selection.cxx index 52ed5774e..f4308b130 100644 --- a/src/Selection.cxx +++ b/src/Selection.cxx @@ -343,6 +343,10 @@ void Selection::DropSelection(size_t r) { } } +void Selection::DropAdditionalRanges() { + SetSelection(RangeMain()); +} + void Selection::TentativeSelection(SelectionRange range) { if (!tentativeMain) { rangesSaved = ranges; -- cgit v1.2.3