diff options
author | Neil <nyamatongwe@gmail.com> | 2017-06-22 16:38:26 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-06-22 16:38:26 +1000 |
commit | cac2920096062453ed19e5697146cd1b42ba088d (patch) | |
tree | 4de045a6b3dc4bc82f40964607f52fd0949a3ab0 /lexlib/LexAccessor.h | |
parent | d1be79eee1940dc99389deefd9d3ae766c3035e3 (diff) | |
download | scintilla-mirror-cac2920096062453ed19e5697146cd1b42ba088d.tar.gz |
Update IDocument for version 4. Drop IDocumentWithLineEnd interface to just have
IDocument but with all the methods from IDocumentWithLineEnd. This removes
version checking (for now). Use dvRelease4 ID.
Drop mask argument to StartStyling.
Diffstat (limited to 'lexlib/LexAccessor.h')
-rw-r--r-- | lexlib/LexAccessor.h | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/lexlib/LexAccessor.h b/lexlib/LexAccessor.h index 064a17581..0cf6e8ce0 100644 --- a/lexlib/LexAccessor.h +++ b/lexlib/LexAccessor.h @@ -79,11 +79,8 @@ public: } return buf[position - startPos]; } - IDocumentWithLineEnd *MultiByteAccess() const { - if (documentVersion >= dvLineEnd) { - return static_cast<IDocumentWithLineEnd *>(pAccess); - } - return 0; + IDocument *MultiByteAccess() const { + return pAccess; } /** Safe version of operator[], returning a defined value for invalid position. */ char SafeGetCharAt(Sci_Position position, char chDefault=' ') { @@ -120,17 +117,7 @@ public: return pAccess->LineStart(line); } Sci_Position LineEnd(Sci_Position line) { - if (documentVersion >= dvLineEnd) { - return (static_cast<IDocumentWithLineEnd *>(pAccess))->LineEnd(line); - } else { - // Old interface means only '\r', '\n' and '\r\n' line ends. - Sci_Position startNext = pAccess->LineStart(line+1); - const char chLineEnd = SafeGetCharAt(startNext-1); - if (chLineEnd == '\n' && (SafeGetCharAt(startNext-2) == '\r')) - return startNext - 2; - else - return startNext - 1; - } + return pAccess->LineEnd(line); } int LevelAt(Sci_Position line) const { return pAccess->GetLevel(line); @@ -153,7 +140,7 @@ public: } // Style setting void StartAt(Sci_PositionU start) { - pAccess->StartStyling(start, '\377'); + pAccess->StartStyling(start); startPosStyling = start; } Sci_PositionU GetStartSegment() const { |