diff options
author | Neil <nyamatongwe@gmail.com> | 2021-05-07 23:25:56 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-05-07 23:25:56 +1000 |
commit | 8827755d994e9ebb49097da51a4e460c56385774 (patch) | |
tree | d930b836de6b4fe60be2f061cee2d491db58d00c /src/Editor.cxx | |
parent | 7d47304ca36474000293f267dda39483113c86e3 (diff) | |
download | scintilla-mirror-8827755d994e9ebb49097da51a4e460c56385774.tar.gz |
Use shared_ptr for LineLayoutCache as it simpifies lifetime management.
AutoLineLayout and other code no longer needed so removed.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index bca4bb0b2..f843a08d2 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1490,10 +1490,10 @@ void Editor::NeedWrapping(Sci::Line docLineStart, Sci::Line docLineEnd) { } bool Editor::WrapOneLine(Surface *surface, Sci::Line lineToWrap) { - AutoLineLayout ll(view.llc, view.RetrieveLineLayout(lineToWrap, *this)); + std::shared_ptr<LineLayout> ll = view.RetrieveLineLayout(lineToWrap, *this); int linesWrapped = 1; if (ll) { - view.LayoutLine(*this, surface, vs, ll, wrapWidth); + view.LayoutLine(*this, surface, vs, ll.get(), wrapWidth); linesWrapped = ll->lines; } return pcs->SetHeight(lineToWrap, linesWrapped + @@ -1651,10 +1651,10 @@ void Editor::LinesSplit(int pixelWidth) { UndoGroup ug(pdoc); for (Sci::Line line = lineStart; line <= lineEnd; line++) { AutoSurface surface(this); - AutoLineLayout ll(view.llc, view.RetrieveLineLayout(line, *this)); + std::shared_ptr<LineLayout> ll = view.RetrieveLineLayout(line, *this); if (surface && ll) { const Sci::Position posLineStart = pdoc->LineStart(line); - view.LayoutLine(*this, surface, vs, ll, pixelWidth); + view.LayoutLine(*this, surface, vs, ll.get(), pixelWidth); Sci::Position lengthInsertedTotal = 0; for (int subLine = 1; subLine < ll->lines; subLine++) { const Sci::Position lengthInserted = pdoc->InsertString( @@ -5265,9 +5265,9 @@ void Editor::SetAnnotationHeights(Sci::Line start, Sci::Line end) { int linesWrapped = 1; if (Wrapping()) { AutoSurface surface(this); - AutoLineLayout ll(view.llc, view.RetrieveLineLayout(line, *this)); + std::shared_ptr<LineLayout> ll = view.RetrieveLineLayout(line, *this); if (surface && ll) { - view.LayoutLine(*this, surface, vs, ll, wrapWidth); + view.LayoutLine(*this, surface, vs, ll.get(), wrapWidth); linesWrapped = ll->lines; } } @@ -5666,10 +5666,10 @@ int Editor::CodePage() const noexcept { Sci::Line Editor::WrapCount(Sci::Line line) { AutoSurface surface(this); - AutoLineLayout ll(view.llc, view.RetrieveLineLayout(line, *this)); + std::shared_ptr<LineLayout> ll = view.RetrieveLineLayout(line, *this); if (surface && ll) { - view.LayoutLine(*this, surface, vs, ll, wrapWidth); + view.LayoutLine(*this, surface, vs, ll.get(), wrapWidth); return ll->lines; } else { return 1; |