From 0801e0084a5cf87f424235d5947f5158474d5da4 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 22 Apr 2017 09:11:03 +1000 Subject: Encapsulate the LexInterface of Document. --- src/Document.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/Document.cxx') diff --git a/src/Document.cxx b/src/Document.cxx index d7e3bf62b..b4ab37244 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -129,8 +129,6 @@ Document::Document() { perLineData[ldAnnotation] = new LineAnnotation(); cb.SetPerLine(this); - - pli = 0; } Document::~Document() { @@ -142,8 +140,6 @@ Document::~Document() { pl = nullptr; } regex.release(); - delete pli; - pli = 0; delete pcf; pcf = 0; } @@ -2124,6 +2120,14 @@ void Document::LexerChanged() { } } +LexInterface *Document::GetLexInterface() const { + return pli.get(); +} + +void Document::SetLexInterface(LexInterface *pLexInterface) { + pli.reset(pLexInterface); +} + int SCI_METHOD Document::SetLineState(Sci_Position line, int state) { const int statePrevious = static_cast(perLineData[ldState])->SetLineState(line, state); if (state != statePrevious) { -- cgit v1.2.3