diff options
| -rw-r--r-- | FL/Fl_Text_Buffer.H | 6 | ||||
| -rw-r--r-- | FL/Fl_Text_Display.H | 4 | ||||
| -rw-r--r-- | src/Fl_Text_Display.cxx | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/FL/Fl_Text_Buffer.H b/FL/Fl_Text_Buffer.H index e519609d5..13fc0cfe4 100644 --- a/FL/Fl_Text_Buffer.H +++ b/FL/Fl_Text_Buffer.H @@ -242,11 +242,13 @@ class FL_EXPORT Fl_Text_Buffer { /** Returns the current nul substitution character. */ char null_substitution_character() const { return mNullSubsChar; } /** Returns the primary selection. */ + const Fl_Text_Selection* primary_selection() const { return &mPrimary; } + /** Returns the primary selection. */ Fl_Text_Selection* primary_selection() { return &mPrimary; } /** Returns the secondary selection. */ - Fl_Text_Selection* secondary_selection() { return &mSecondary; } + const Fl_Text_Selection* secondary_selection() const { return &mSecondary; } /** Returns the current highlight selection. */ - Fl_Text_Selection* highlight_selection() { return &mHighlight; } + const Fl_Text_Selection* highlight_selection() const { return &mHighlight; } protected: void call_modify_callbacks(int pos, int nDeleted, int nInserted, diff --git a/FL/Fl_Text_Display.H b/FL/Fl_Text_Display.H index ed361537f..cfa2530ca 100644 --- a/FL/Fl_Text_Display.H +++ b/FL/Fl_Text_Display.H @@ -253,8 +253,8 @@ class FL_EXPORT Fl_Text_Display: public Fl_Group { int *nextLineStart); int measure_proportional_character(char c, int colNum, int pos); int wrap_uses_character(int lineEndPos); - int range_touches_selection(Fl_Text_Selection *sel, int rangeStart, - int rangeEnd); + int range_touches_selection(const Fl_Text_Selection *sel, int rangeStart, + int rangeEnd) const; #ifndef FL_DOXYGEN int damage_range1_start, damage_range1_end; int damage_range2_start, damage_range2_end; diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index cb63b8f66..aa754bd74 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -3011,8 +3011,8 @@ int Fl_Text_Display::wrap_uses_character(int lineEndPos) { Return true if the selection "sel" is rectangular, and touches a buffer position withing "rangeStart" to "rangeEnd" */ -int Fl_Text_Display::range_touches_selection(Fl_Text_Selection *sel, - int rangeStart, int rangeEnd) { +int Fl_Text_Display::range_touches_selection(const Fl_Text_Selection *sel, + int rangeStart, int rangeEnd) const { return sel->selected() && sel->rectangular() && sel->end() >= rangeStart && sel->start() <= rangeEnd; } |
