diff options
author | Neil <nyamatongwe@gmail.com> | 2014-06-22 13:44:46 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-06-22 13:44:46 +1000 |
commit | 47ac30dfae520dd56e0c4cd20827d65bae25e073 (patch) | |
tree | b032e0dc0eda28a8e64977298dcc04e884f5ce5e /src/Editor.cxx | |
parent | 93c33490b77157f2e5422f4962ac4b88f4aea7c5 (diff) | |
download | scintilla-mirror-47ac30dfae520dd56e0c4cd20827d65bae25e073.tar.gz |
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.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index e6a72e4cd..041a9c6a5 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2258,7 +2258,7 @@ void Editor::LayoutLine(int line, Surface *surface, const ViewStyle &vstyle, Lin ll->positions[0] = 0; bool lastSegItalics = false; - BreakFinder bfLayout(ll, 0, numCharsInLine, posLineStart, 0, false, pdoc, &reprs); + BreakFinder bfLayout(ll, NULL, 0, numCharsInLine, posLineStart, 0, false, pdoc, &reprs); while (bfLayout.More()) { const TextSegment ts = bfLayout.Next(); @@ -2898,10 +2898,8 @@ void Editor::DrawLine(Surface *surface, const ViewStyle &vsDraw, int line, int l // Does not take margin into account but not significant const int xStartVisible = static_cast<int>(subLineStart) - xStart; - ll->psel = &sel; - if (twoPhaseDraw) { - BreakFinder bfBack(ll, lineStart, lineEnd, posLineStart, xStartVisible, selBackDrawn, pdoc, &reprs); + BreakFinder bfBack(ll, &sel, lineStart, lineEnd, posLineStart, xStartVisible, selBackDrawn, pdoc, &reprs); // Background drawing loop while (bfBack.More()) { @@ -2994,7 +2992,7 @@ void Editor::DrawLine(Surface *surface, const ViewStyle &vsDraw, int line, int l inIndentation = subLine == 0; // Do not handle indentation except on first subline. // Foreground drawing loop - BreakFinder bfFore(ll, lineStart, lineEnd, posLineStart, xStartVisible, + BreakFinder bfFore(ll, &sel, lineStart, lineEnd, posLineStart, xStartVisible, ((!twoPhaseDraw && selBackDrawn) || vsDraw.selColours.fore.isSet), pdoc, &reprs); while (bfFore.More()) { |