[Libreoffice-commits] core.git: include/vcl sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Aug 24 14:05:04 UTC 2018
include/vcl/weld.hxx | 1 +
sw/source/ui/fldui/inpdlg.cxx | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
New commits:
commit e71ece6a6f5a817120a3866896828e4158fbde79
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Aug 24 08:17:21 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Aug 24 16:04:37 2018 +0200
document that nEndPos of -1 is all text
Change-Id: I4646e1ef09db3a637248cff53cbbafb214219cf8
Reviewed-on: https://gerrit.libreoffice.org/59542
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index b864231e105a..cee22af8dc31 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -484,6 +484,7 @@ public:
virtual OUString get_text() const = 0;
virtual void set_width_chars(int nChars) = 0;
virtual void set_max_length(int nChars) = 0;
+ // nEndPos can be -1 in order to select all text
virtual void select_region(int nStartPos, int nEndPos) = 0;
virtual bool get_selection_bounds(int& rStartPos, int& rEndPos) = 0;
virtual void set_position(int nCursorPos) = 0;
diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx
index f0bbfbd22bda..a9cad5d770d2 100644
--- a/sw/source/ui/fldui/inpdlg.cxx
+++ b/sw/source/ui/fldui/inpdlg.cxx
@@ -106,7 +106,7 @@ SwFieldInputDlg::SwFieldInputDlg(weld::Window *pParent, SwWrtShell &rS,
// preselect all text to allow quickly changing the content
if (bEnable)
- m_xEditED->select_region(0, m_xEditED->get_text().getLength());
+ m_xEditED->select_region(0, -1);
}
SwFieldInputDlg::~SwFieldInputDlg()
More information about the Libreoffice-commits
mailing list