diff options
| author | ZJUGKC <yxxinyuan@zju.edu.cn> | 2023-04-17 22:12:03 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-17 16:12:03 +0200 |
| commit | 385cabf3aac721d6a4c1f499f9fc4955c4c805f9 (patch) | |
| tree | f3a2fd8affc9887ef2d6549eb9add7e8bab4f687 /src/Fl_Text_Buffer.cxx | |
| parent | 54ef53d4ae90760ecf2faf457d35b737e51eb13f (diff) | |
Add const qualifiers to can_undo and can_redo (#720)
Diffstat (limited to 'src/Fl_Text_Buffer.cxx')
| -rw-r--r-- | src/Fl_Text_Buffer.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx index 2cfe6f1e3..1cfcd1b9b 100644 --- a/src/Fl_Text_Buffer.cxx +++ b/src/Fl_Text_Buffer.cxx @@ -120,7 +120,7 @@ public: undocut = undoinsert = 0; } - bool empty() { + bool empty() const { return (!undocut && !undoinsert); } }; @@ -158,7 +158,7 @@ public: clear(); } - int size() { + int size() const { return list_size_; } @@ -635,7 +635,7 @@ int Fl_Text_Buffer::undo(int *cursorPos) { /* Check if undo is anabled and if the last action can be undone. */ -bool Fl_Text_Buffer::can_undo() { +bool Fl_Text_Buffer::can_undo() const { return (mCanUndo && mUndo && !mUndo->empty()); } @@ -663,7 +663,7 @@ int Fl_Text_Buffer::redo(int *cursorPos) { Check if undo is anabled and if the last undo action can be redone. \see canUndo() */ -bool Fl_Text_Buffer::can_redo() { +bool Fl_Text_Buffer::can_redo() const { return (mCanUndo && mRedoList->size()); } |
