diff options
-rw-r--r-- | include/vcl/weld.hxx | 1 | ||||
-rw-r--r-- | sw/source/ui/fldui/inpdlg.cxx | 2 |
2 files changed, 2 insertions, 1 deletions
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() |