aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Selection.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Selection.cxx')
-rw-r--r--src/Selection.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Selection.cxx b/src/Selection.cxx
index 47d078675..566cb1074 100644
--- a/src/Selection.cxx
+++ b/src/Selection.cxx
@@ -179,6 +179,19 @@ SelectionRange &Selection::Rectangular() {
return rangeRectangular;
}
+SelectionSegment Selection::Limits() const {
+ if (ranges.empty()) {
+ return SelectionSegment();
+ } else {
+ SelectionSegment sr(ranges[0].anchor, ranges[0].caret);
+ for (size_t i=1; i<ranges.size(); i++) {
+ sr.Extend(ranges[i].anchor);
+ sr.Extend(ranges[i].caret);
+ }
+ return sr;
+ }
+}
+
size_t Selection::Count() const {
return ranges.size();
}