From 5a13b76c4ba92e4e47cac86d8d7d2617c60aa856 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 19 Jan 2013 11:10:41 +1100 Subject: Implement APIs for Unicode line ends and substyles and expose to message interface. Expose IDocumentWithLineEnd interface on Document. --- src/Document.cxx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/Document.cxx') diff --git a/src/Document.cxx b/src/Document.cxx index 1938149e7..500259d8d 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -67,6 +67,17 @@ void LexInterface::Colourise(int start, int end) { } } +int LexInterface::LineEndTypesSupported() { + if (instance) { + int interfaceVersion = instance->Version(); + if (interfaceVersion >= lvSubStyles) { + ILexerWithSubStyles *ssinstance = static_cast(instance); + return ssinstance->LineEndTypesSupported(); + } + } + return 0; +} + Document::Document() { refCount = 0; pcf = NULL; @@ -135,6 +146,13 @@ void Document::Init() { } } +int Document::LineEndTypesSupported() const { + if ((SC_CP_UTF8 == dbcsCodePage) && pli) + return pli->LineEndTypesSupported(); + else + return 0; +} + bool Document::SetDBCSCodePage(int dbcsCodePage_) { if (dbcsCodePage != dbcsCodePage_) { dbcsCodePage = dbcsCodePage_; @@ -245,7 +263,7 @@ int SCI_METHOD Document::LineStart(int line) const { return cb.LineStart(line); } -int Document::LineEnd(int line) const { +int SCI_METHOD Document::LineEnd(int line) const { if (line == LinesTotal() - 1) { return LineStart(line + 1); } else { -- cgit v1.2.3