From a0ebebe503affd3447a29c1253579f392cc45132 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 22 Jun 2014 13:44:46 +1000 Subject: Stop storing a pointer to the selection on LineLayout objects where it may have a lifetime that is too long. Instead provide it as an argument to BreakFinder where it is only needed during intialisation. --- src/Selection.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Selection.cxx') diff --git a/src/Selection.cxx b/src/Selection.cxx index 4c2ab0508..b46dca890 100644 --- a/src/Selection.cxx +++ b/src/Selection.cxx @@ -226,10 +226,18 @@ SelectionRange &Selection::Range(size_t r) { return ranges[r]; } +const SelectionRange &Selection::Range(size_t r) const { + return ranges[r]; +} + SelectionRange &Selection::RangeMain() { return ranges[mainRange]; } +const SelectionRange &Selection::RangeMain() const { + return ranges[mainRange]; +} + SelectionPosition Selection::Start() const { if (IsRectangular()) { return rangeRectangular.Start(); -- cgit v1.2.3