From 190e7c5a66f6e3bfa633d0a4705f96312d385013 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 29 Feb 2020 09:11:59 +1100 Subject: Backport: Add const and noexcept where they make sense. Backport of changeset 7991:d7d83db0457a. --- src/Editor.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Editor.h') diff --git a/src/Editor.h b/src/Editor.h index c88a181a7..c21043881 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -312,7 +312,7 @@ protected: // ScintillaBase subclass needs access to much of Editor return ((virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0); } Sci::Position CurrentPosition() const; - bool SelectionEmpty() const; + bool SelectionEmpty() const noexcept; SelectionPosition SelectionStart(); SelectionPosition SelectionEnd(); void SetRectangularRange(); @@ -328,8 +328,8 @@ protected: // ScintillaBase subclass needs access to much of Editor void SetEmptySelection(Sci::Position currentPos_); enum AddNumber { addOne, addEach }; void MultipleSelectAdd(AddNumber addNumber); - bool RangeContainsProtected(Sci::Position start, Sci::Position end) const; - bool SelectionContainsProtected(); + bool RangeContainsProtected(Sci::Position start, Sci::Position end) const noexcept; + bool SelectionContainsProtected() const; Sci::Position MovePositionOutsideChar(Sci::Position pos, Sci::Position moveDir, bool checkLineEnd=true) const; SelectionPosition MovePositionOutsideChar(SelectionPosition pos, Sci::Position moveDir, bool checkLineEnd=true) const; void MovedCaret(SelectionPosition newPos, SelectionPosition previousPos, @@ -640,7 +640,7 @@ class AutoSurface { private: std::unique_ptr surf; public: - AutoSurface(Editor *ed, int technology = -1) { + AutoSurface(const Editor *ed, int technology = -1) { if (ed->wMain.GetID()) { surf.reset(Surface::Allocate(technology != -1 ? technology : ed->technology)); surf->Init(ed->wMain.GetID()); -- cgit v1.2.3