include/vcl/weld.hxx | 1 + vcl/source/app/salvtables.cxx | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-)
New commits: commit b5809f3272f8e0cc5c9b6540e475d6109e7dc3ec Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Jul 9 12:44:30 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Jul 10 10:35:15 2020 +0200 normalize both ends Change-Id: Id03df7f678d0bb568c0c672b12cad12f943e32a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98442 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 73f27cd9a517..e0f274b50c04 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -2018,6 +2018,7 @@ protected: public: virtual void set_text(const OUString& rText) = 0; virtual OUString get_text() const = 0; + // if nStartPos or nEndPos is -1 the max available text pos will be used virtual void select_region(int nStartPos, int nEndPos) = 0; virtual bool get_selection_bounds(int& rStartPos, int& rEndPos) = 0; virtual void replace_selection(const OUString& rText) = 0; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index e30bbd057c71..e69afccb08cd 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3051,7 +3051,9 @@ void SalInstanceEntry::set_max_length(int nChars) void SalInstanceEntry::select_region(int nStartPos, int nEndPos) { disable_notify_events(); - m_xEntry->SetSelection(Selection(nStartPos, nEndPos < 0 ? SELECTION_MAX : nEndPos)); + long nStart = nStartPos < 0 ? SELECTION_MAX : nStartPos; + long nEnd = nEndPos < 0 ? SELECTION_MAX : nEndPos; + m_xEntry->SetSelection(Selection(nStart, nEnd)); enable_notify_events(); } @@ -5471,7 +5473,9 @@ public: virtual void select_region(int nStartPos, int nEndPos) override { disable_notify_events(); - m_xTextView->SetSelection(Selection(nStartPos, nEndPos < 0 ? SELECTION_MAX : nEndPos)); + long nStart = nStartPos < 0 ? SELECTION_MAX : nStartPos; + long nEnd = nEndPos < 0 ? SELECTION_MAX : nEndPos; + m_xTextView->SetSelection(Selection(nStart, nEnd)); enable_notify_events(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits