aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2022-10-19 15:23:02 +1100
committerNeil <nyamatongwe@gmail.com>2022-10-19 15:23:02 +1100
commitb8ba34f03cb1808aa47dce0fe06e81d372a9702c (patch)
tree53da405d165ec56538cb9356d4afca10029b9a3a /src
parente30c35b1efc7be12ea10d02028b11bf4eb6e2cea (diff)
downloadscintilla-mirror-b8ba34f03cb1808aa47dce0fe06e81d372a9702c.tar.gz
Fix noexcept warnings from recent changes.
Diffstat (limited to 'src')
-rw-r--r--src/Document.h1
-rw-r--r--src/Editor.cxx4
-rw-r--r--src/Editor.h2
3 files changed, 4 insertions, 3 deletions
diff --git a/src/Document.h b/src/Document.h
index f08e0a302..114316d37 100644
--- a/src/Document.h
+++ b/src/Document.h
@@ -416,6 +416,7 @@ public:
cb.GetCharRange(buffer, position, lengthRetrieve);
}
char SCI_METHOD StyleAt(Sci_Position position) const override { return cb.StyleAt(position); }
+ char StyleAtNoExcept(Sci_Position position) const noexcept { return cb.StyleAt(position); }
int StyleIndexAt(Sci_Position position) const noexcept { return static_cast<unsigned char>(cb.StyleAt(position)); }
void GetStyleRange(unsigned char *buffer, Sci::Position position, Sci::Position lengthRetrieve) const {
cb.GetStyleRange(buffer, position, lengthRetrieve);
diff --git a/src/Editor.cxx b/src/Editor.cxx
index a227c5c47..2e1467e32 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -5787,14 +5787,14 @@ Sci::Position Editor::GetStyledText(char *buffer, Sci::Position cpMin, Sci::Posi
Sci::Position iPlace = 0;
for (Sci::Position iChar = cpMin; iChar < cpMax; iChar++) {
buffer[iPlace++] = pdoc->CharAt(iChar);
- buffer[iPlace++] = pdoc->StyleAt(iChar);
+ buffer[iPlace++] = pdoc->StyleAtNoExcept(iChar);
}
buffer[iPlace] = '\0';
buffer[iPlace + 1] = '\0';
return iPlace;
}
-Sci::Position Editor::GetTextRange(char *buffer, Sci::Position cpMin, Sci::Position cpMax) const noexcept {
+Sci::Position Editor::GetTextRange(char *buffer, Sci::Position cpMin, Sci::Position cpMax) const {
const Sci::Position cpEnd = (cpMax == -1) ? pdoc->Length() : cpMax;
PLATFORM_ASSERT(cpEnd <= pdoc->Length());
const Sci::Position len = cpEnd - cpMin; // No -1 as cpMin and cpMax are referring to inter character positions
diff --git a/src/Editor.h b/src/Editor.h
index 507c55414..128abf234 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -599,7 +599,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
Sci::Line WrapCount(Sci::Line line);
void AddStyledText(const char *buffer, Sci::Position appendLength);
Sci::Position GetStyledText(char *buffer, Sci::Position cpMin, Sci::Position cpMax) const noexcept;
- Sci::Position GetTextRange(char *buffer, Sci::Position cpMin, Sci::Position cpMax) const noexcept;
+ Sci::Position GetTextRange(char *buffer, Sci::Position cpMin, Sci::Position cpMax) const;
virtual Scintilla::sptr_t DefWndProc(Scintilla::Message iMessage, Scintilla::uptr_t wParam, Scintilla::sptr_t lParam) = 0;
bool ValidMargin(Scintilla::uptr_t wParam) const noexcept;