From db6f17dc09b49ecbe89cbb99de71c069c029e052 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Thu, 23 Aug 2018 17:07:17 +0200 Subject: tdf#119303 Preselect text in input field dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The text was no longer preselected since the dialog was welded in commit c8780642a5e8dc0bdcc97940ee7d9cacdc64c928 . Change-Id: I282336cf68ad4b363d5148f0f48f5f426826ed66 Reviewed-on: https://gerrit.libreoffice.org/59521 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/ui/fldui/inpdlg.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx index affd29d224c2..f0bbfbd22bda 100644 --- a/sw/source/ui/fldui/inpdlg.cxx +++ b/sw/source/ui/fldui/inpdlg.cxx @@ -103,6 +103,10 @@ SwFieldInputDlg::SwFieldInputDlg(weld::Window *pParent, SwWrtShell &rS, if( !aStr.isEmpty() ) m_xEditED->set_text(convertLineEnd(aStr, GetSystemLineEnd())); m_xEditED->grab_focus(); + + // preselect all text to allow quickly changing the content + if (bEnable) + m_xEditED->select_region(0, m_xEditED->get_text().getLength()); } SwFieldInputDlg::~SwFieldInputDlg() -- cgit v1.2.3