From 534d196395a1ee9f6667d032dbd9ae02e8eb0b9d Mon Sep 17 00:00:00 2001 From: Justin Dailey Date: Sun, 9 Jul 2017 10:25:15 +1000 Subject: Backport: Bug [#1955]. The data parameter to ILoader::AddData made const. Backport of changeset 6340:52f12c3eebcd. --- doc/ScintillaDoc.html | 2 +- doc/ScintillaHistory.html | 4 ++++ include/ILexer.h | 2 +- src/Document.cxx | 2 +- src/Document.h | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index e28cffaaf..2679975dc 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -5763,7 +5763,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ public:
        virtual int SCI_METHOD Release() = 0;
        // Returns a status code from SC_STATUS_*
-        virtual int SCI_METHOD AddData(char *data, int length) = 0;
+        virtual int SCI_METHOD AddData(const char *data, Sci_Position length) = 0;
        virtual void * SCI_METHOD ConvertToDocument() = 0;
};
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 76f7149cd..874497f7a 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -539,6 +539,10 @@ An SCN_AUTOCSELECTIONCHANGE notification is sent when items are highlighted in an autocompletion or user list.
  • + The data parameter to ILoader::AddData made const. + Bug #1955. +
  • +
  • The Matlab lexer treats 'end' as a number rather than a keyword when used as a index. This also stops incorrect folding. Bug #1951. diff --git a/include/ILexer.h b/include/ILexer.h index f01029178..882b52976 100644 --- a/include/ILexer.h +++ b/include/ILexer.h @@ -89,7 +89,7 @@ class ILoader { public: virtual int SCI_METHOD Release() = 0; // Returns a status code from SC_STATUS_* - virtual int SCI_METHOD AddData(char *data, Sci_Position length) = 0; + virtual int SCI_METHOD AddData(const char *data, Sci_Position length) = 0; virtual void * SCI_METHOD ConvertToDocument() = 0; }; diff --git a/src/Document.cxx b/src/Document.cxx index ac4322e1b..9a083aa23 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1138,7 +1138,7 @@ void Document::ChangeInsertion(const char *s, Sci::Position length) { insertion.assign(s, length); } -int SCI_METHOD Document::AddData(char *data, Sci_Position length) { +int SCI_METHOD Document::AddData(const char *data, Sci_Position length) { try { Sci::Position position = static_cast(Length()); InsertString(position, data, static_cast(length)); diff --git a/src/Document.h b/src/Document.h index fd72c56c6..6cc134bf2 100644 --- a/src/Document.h +++ b/src/Document.h @@ -316,7 +316,7 @@ public: bool DeleteChars(Sci::Position pos, Sci::Position len); Sci::Position InsertString(Sci::Position position, const char *s, Sci::Position insertLength); void ChangeInsertion(const char *s, Sci::Position length); - int SCI_METHOD AddData(char *data, Sci_Position length); + int SCI_METHOD AddData(const char *data, Sci_Position length); void * SCI_METHOD ConvertToDocument(); Sci::Position Undo(); Sci::Position Redo(); -- cgit v1.2.3