From 15be99cd0c446d74f71e9cf05ec3aa1c033a2370 Mon Sep 17 00:00:00 2001 From: mitchell Date: Sat, 5 May 2018 12:49:25 -0400 Subject: Backport: Split decorations into interface and implementation. Backport of changeset 6658:693e737f3155. --- src/Document.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/Document.cxx') diff --git a/src/Document.cxx b/src/Document.cxx index edb60a26a..04a83d7ff 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -125,6 +125,8 @@ Document::Document(int options) : perLineData[ldMargin].reset(new LineAnnotation()); perLineData[ldAnnotation].reset(new LineAnnotation()); + decorations = DecorationListCreate(); + cb.SetPerLine(this); } @@ -2243,11 +2245,11 @@ void Document::IncrementStyleClock() { } void SCI_METHOD Document::DecorationSetCurrentIndicator(int indicator) { - decorations.SetCurrentIndicator(indicator); + decorations->SetCurrentIndicator(indicator); } void SCI_METHOD Document::DecorationFillRange(Sci_Position position, int value, Sci_Position fillLength) { - const FillResult fr = decorations.FillRange( + const FillResult fr = decorations->FillRange( static_cast(position), value, static_cast(fillLength)); if (fr.changed) { const DocModification mh(SC_MOD_CHANGEINDICATOR | SC_PERFORMED_USER, @@ -2290,9 +2292,9 @@ void Document::NotifySavePoint(bool atSavePoint) { void Document::NotifyModified(DocModification mh) { if (mh.modificationType & SC_MOD_INSERTTEXT) { - decorations.InsertSpace(mh.position, mh.length); + decorations->InsertSpace(mh.position, mh.length); } else if (mh.modificationType & SC_MOD_DELETETEXT) { - decorations.DeleteRange(mh.position, mh.length); + decorations->DeleteRange(mh.position, mh.length); } for (const WatcherWithUserData &watcher : watchers) { watcher.watcher->NotifyModified(this, mh, watcher.userData); -- cgit v1.2.3