From 9b0e098a785165cd9ec28c60505b60e62c3e59dc Mon Sep 17 00:00:00 2001 From: Nickson Date: Wed, 19 Sep 2018 23:13:56 +0100 Subject: tdf#119847 - Can now autoselect font size on first click Change-Id: Id49f4d039f0eb7c4efccecda91bd656c1c31d497 Reviewed-on: https://gerrit.libreoffice.org/60784 Tested-by: Jenkins Reviewed-by: Heiko Tietze --- svtools/source/control/ctrlbox.cxx | 1 + vcl/source/control/edit.cxx | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 4044ad61da84..bad8ecee665d 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1242,6 +1242,7 @@ void SvtFontStyleBox::Fill( const OUString& rName, const FontList* pList ) FontSizeBox::FontSizeBox( vcl::Window* pParent, WinBits nWinSize ) : MetricBox( pParent, nWinSize ) { + EnableSelectAll(); ImplInit(); } diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 3688f9c3374d..895d35cef5e7 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1310,7 +1310,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt ) if ( rMEvt.GetClicks() < 4 ) { mbClickedInSelection = false; - if ( rMEvt.GetClicks() == 3 || mbSelectAllSingleClick ) + if ( rMEvt.GetClicks() == 3 ) { ImplSetSelection( Selection( 0, EDIT_NOLIMIT) ); ImplCopyToSelectionClipboard(); @@ -1835,7 +1835,11 @@ void Edit::GetFocus() else if ( !mbActivePopup ) { maUndoText = maText.toString(); - + if(mbSelectAllSingleClick) + { + maSelection.Min() = 0; + maSelection.Max() = maText.getLength(); + } SelectionOptions nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions(); if ( !( GetStyle() & (WB_NOHIDESELECTION|WB_READONLY) ) && ( GetGetFocusFlags() & (GetFocusFlags::Init|GetFocusFlags::Tab|GetFocusFlags::CURSOR|GetFocusFlags::Mnemonic) ) ) -- cgit