diff options
Diffstat (limited to 'src/Editor.h')
-rw-r--r-- | src/Editor.h | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/Editor.h b/src/Editor.h index a6e059714..9d0783f09 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -19,7 +19,7 @@ public: enum {tickSize = 100}; TickerID tickerID; - Timer(); + Timer() noexcept; }; /** @@ -29,7 +29,7 @@ public: bool state; IdlerID idlerID; - Idler(); + Idler() noexcept; }; /** @@ -47,12 +47,12 @@ public: enum workItems items; Sci::Position upTo; - WorkNeeded() : items(workNone), upTo(0) {} - void Reset() { + WorkNeeded() noexcept : items(workNone), upTo(0) {} + void Reset() noexcept { items = workNone; upTo = 0; } - void Need(workItems items_, Sci::Position pos) { + void Need(workItems items_, Sci::Position pos) noexcept { if ((items_ & workStyle) && (upTo < pos)) upTo = pos; items = static_cast<workItems>(items | items_); @@ -69,8 +69,8 @@ public: bool lineCopy; int codePage; int characterSet; - SelectionText() : rectangular(false), lineCopy(false), codePage(0), characterSet(0) {} - void Clear() { + SelectionText() noexcept : rectangular(false), lineCopy(false), codePage(0), characterSet(0) {} + void Clear() noexcept { s.clear(); rectangular = false; lineCopy = false; @@ -88,16 +88,16 @@ public: void Copy(const SelectionText &other) { Copy(other.s, other.codePage, other.characterSet, other.rectangular, other.lineCopy); } - const char *Data() const { + const char *Data() const noexcept { return s.c_str(); } - size_t Length() const { + size_t Length() const noexcept { return s.length(); } - size_t LengthWithTerminator() const { + size_t LengthWithTerminator() const noexcept { return s.length() + 1; } - bool Empty() const { + bool Empty() const noexcept { return s.empty(); } private: @@ -113,22 +113,22 @@ struct WrapPending { enum { lineLarge = 0x7ffffff }; Sci::Line start; // When there are wraps pending, will be in document range Sci::Line end; // May be lineLarge to indicate all of document after start - WrapPending() { + WrapPending() noexcept { start = lineLarge; end = lineLarge; } - void Reset() { + void Reset() noexcept { start = lineLarge; end = lineLarge; } - void Wrapped(Sci::Line line) { + void Wrapped(Sci::Line line) noexcept { if (start == line) start++; } - bool NeedsWrap() const { + bool NeedsWrap() const noexcept { return start < end; } - bool AddRange(Sci::Line lineStart, Sci::Line lineEnd) { + bool AddRange(Sci::Line lineStart, Sci::Line lineEnd) noexcept { const bool neededWrap = NeedsWrap(); bool changed = false; if (start > lineStart) { @@ -302,7 +302,7 @@ protected: // ScintillaBase subclass needs access to much of Editor PRectangle RectangleFromRange(Range r, int overlap); void InvalidateRange(Sci::Position start, Sci::Position end); - bool UserVirtualSpace() const { + bool UserVirtualSpace() const noexcept { return ((virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0); } Sci::Position CurrentPosition() const; @@ -347,8 +347,8 @@ protected: // ScintillaBase subclass needs access to much of Editor struct XYScrollPosition { int xOffset; Sci::Line topLine; - XYScrollPosition(int xOffset_, Sci::Line topLine_) : xOffset(xOffset_), topLine(topLine_) {} - bool operator==(const XYScrollPosition &other) const { + XYScrollPosition(int xOffset_, Sci::Line topLine_) noexcept : xOffset(xOffset_), topLine(topLine_) {} + bool operator==(const XYScrollPosition &other) const noexcept { return (xOffset == other.xOffset) && (topLine == other.topLine); } }; @@ -368,7 +368,7 @@ protected: // ScintillaBase subclass needs access to much of Editor virtual void NotifyCaretMove(); virtual void UpdateSystemCaret(); - bool Wrapping() const; + bool Wrapping() const noexcept; void NeedWrapping(Sci::Line docLineStart=0, Sci::Line docLineEnd=WrapPending::lineLarge); bool WrapOneLine(Surface *surface, Sci::Line lineToWrap); enum class WrapScope {wsAll, wsVisible, wsIdle}; @@ -441,13 +441,13 @@ protected: // ScintillaBase subclass needs access to much of Editor void NotifySavePoint(Document *document, void *userData, bool atSavePoint) override; void CheckModificationForWrap(DocModification mh); void NotifyModified(Document *document, DocModification mh, void *userData) override; - void NotifyDeleted(Document *document, void *userData) override; + void NotifyDeleted(Document *document, void *userData) noexcept override; void NotifyStyleNeeded(Document *doc, void *userData, Sci::Position endStyleNeeded) override; void NotifyLexerChanged(Document *doc, void *userData) override; void NotifyErrorOccurred(Document *doc, void *userData, int status) override; void NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam); - void ContainerNeedsUpdate(int flags); + void ContainerNeedsUpdate(int flags) noexcept; void PageMove(int direction, Selection::selTypes selt=Selection::noSel, bool stuttered = false); enum { cmSame, cmUpper, cmLower }; virtual std::string CaseMapString(const std::string &s, int caseMapping); @@ -495,7 +495,7 @@ protected: // ScintillaBase subclass needs access to much of Editor bool PositionInSelection(Sci::Position pos); bool PointInSelection(Point pt); bool PointInSelMargin(Point pt) const; - Window::Cursor GetMarginCursor(Point pt) const; + Window::Cursor GetMarginCursor(Point pt) const noexcept; void TrimAndSetSelection(Sci::Position currentPos_, Sci::Position anchor_); void LineSelection(Sci::Position lineCurrentPos_, Sci::Position lineAnchorPos_, bool wholeLine); void WordSelection(Sci::Position pos); @@ -552,52 +552,52 @@ protected: // ScintillaBase subclass needs access to much of Editor bool PositionIsHotspot(Sci::Position position) const; bool PointIsHotspot(Point pt); void SetHotSpotRange(const Point *pt); - Range GetHotSpotRange() const override; + Range GetHotSpotRange() const noexcept override; void SetHoverIndicatorPosition(Sci::Position position); void SetHoverIndicatorPoint(Point pt); - int CodePage() const; + int CodePage() const noexcept; virtual bool ValidCodePage(int /* codePage */) const { return true; } Sci::Line WrapCount(Sci::Line line); void AddStyledText(const char *buffer, Sci::Position appendLength); virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0; - bool ValidMargin(uptr_t wParam) const; + bool ValidMargin(uptr_t wParam) const noexcept; void StyleSetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam); sptr_t StyleGetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam); void SetSelectionNMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam); - static const char *StringFromEOLMode(int eolMode); + static const char *StringFromEOLMode(int eolMode) noexcept; // Coercion functions for transforming WndProc parameters into pointers - static void *PtrFromSPtr(sptr_t lParam) { + static void *PtrFromSPtr(sptr_t lParam) noexcept { return reinterpret_cast<void *>(lParam); } - static const char *ConstCharPtrFromSPtr(sptr_t lParam) { + static const char *ConstCharPtrFromSPtr(sptr_t lParam) noexcept { return static_cast<const char *>(PtrFromSPtr(lParam)); } - static const unsigned char *ConstUCharPtrFromSPtr(sptr_t lParam) { + static const unsigned char *ConstUCharPtrFromSPtr(sptr_t lParam) noexcept { return static_cast<const unsigned char *>(PtrFromSPtr(lParam)); } - static char *CharPtrFromSPtr(sptr_t lParam) { + static char *CharPtrFromSPtr(sptr_t lParam) noexcept { return static_cast<char *>(PtrFromSPtr(lParam)); } - static unsigned char *UCharPtrFromSPtr(sptr_t lParam) { + static unsigned char *UCharPtrFromSPtr(sptr_t lParam) noexcept { return static_cast<unsigned char *>(PtrFromSPtr(lParam)); } - static void *PtrFromUPtr(uptr_t wParam) { + static void *PtrFromUPtr(uptr_t wParam) noexcept { return reinterpret_cast<void *>(wParam); } - static const char *ConstCharPtrFromUPtr(uptr_t wParam) { + static const char *ConstCharPtrFromUPtr(uptr_t wParam) noexcept { return static_cast<const char *>(PtrFromUPtr(wParam)); } - static sptr_t StringResult(sptr_t lParam, const char *val); - static sptr_t BytesResult(sptr_t lParam, const unsigned char *val, size_t len); + static sptr_t StringResult(sptr_t lParam, const char *val) noexcept; + static sptr_t BytesResult(sptr_t lParam, const unsigned char *val, size_t len) noexcept; public: // Public so the COM thunks can access it. - bool IsUnicodeMode() const; + bool IsUnicodeMode() const noexcept; // Public so scintilla_send_message can use it. virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); // Public so scintilla_set_id can use it. |