From 03cca7be7b6f7e1a2899c01bf50a7a61f9be1a21 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 14 Jul 2009 03:28:22 +0000 Subject: Added controls for enabling multiple selection and multiple selection typing. Renamed multiline options to reflect use on multiple selections. Using std::vector for selections. --- src/Selection.cxx | 53 ++++++++++++++++++++--------------------------------- 1 file changed, 20 insertions(+), 33 deletions(-) (limited to 'src/Selection.cxx') diff --git a/src/Selection.cxx b/src/Selection.cxx index d9c59cdb1..eada57d5e 100644 --- a/src/Selection.cxx +++ b/src/Selection.cxx @@ -7,6 +7,8 @@ #include +#include + #include "Platform.h" #include "Scintilla.h" @@ -128,13 +130,9 @@ SelectionSegment SelectionRange::Intersect(SelectionSegment check) const { } } -bool SelectionRange::Trim(SelectionPosition startPos, SelectionPosition endPos) { - SelectionPosition startRange = startPos; - SelectionPosition endRange = endPos; - if (startPos > endPos) { - startRange = endPos; - endRange = startPos; - } +bool SelectionRange::Trim(SelectionRange range) { + SelectionPosition startRange = range.Start(); + SelectionPosition endRange = range.End(); SelectionPosition start = Start(); SelectionPosition end = End(); PLATFORM_ASSERT(start <= end); @@ -178,24 +176,11 @@ void SelectionRange::MinimizeVirtualSpace() { } } -void Selection::Allocate() { - if (nRanges >= allocated) { - size_t allocateNew = (allocated + 1) * 2; - SelectionRange *rangesNew = new SelectionRange[allocateNew]; - for (size_t r=0; r