From 11b60b16739bfd88cc6f9f16834870a296921883 Mon Sep 17 00:00:00 2001 From: Nickson Thanda Date: Tue, 3 Jul 2018 13:54:40 +0100 Subject: tdf#108012 - Clicking in the font field should select the contents Change-Id: I1276976e031b419ca5cc3cc8e848f2af58ce4cfb Reviewed-on: https://gerrit.libreoffice.org/56865 Tested-by: Jenkins Reviewed-by: Muhammet Kara --- vcl/source/control/combobox.cxx | 5 ++++- vcl/source/control/edit.cxx | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 4508d34022fc..92ae580010f6 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -507,7 +507,10 @@ void ComboBox::EnableAutoSize( bool bAuto ) } } } - +void ComboBox::EnableSelectAll() +{ + m_pImpl->m_pSubEdit->SetSelectAllSingleClick(true); +} void ComboBox::EnableDDAutoWidth( bool b ) { if (m_pImpl->m_pFloatWin) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 1283b28d710b..108ce15a984f 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -272,6 +272,7 @@ void Edit::ImplInitEditData() mbModified = false; mbInternModified = false; mbReadOnly = false; + mbSelectAllSingleClick = false; mbInsertMode = true; mbClickedInSelection = false; mbActivePopup = false; @@ -1318,7 +1319,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt ) if ( rMEvt.GetClicks() < 4 ) { mbClickedInSelection = false; - if ( rMEvt.GetClicks() == 3 ) + if ( rMEvt.GetClicks() == 3 || mbSelectAllSingleClick ) { ImplSetSelection( Selection( 0, EDIT_NOLIMIT) ); ImplCopyToSelectionClipboard(); @@ -2413,6 +2414,15 @@ void Edit::SetReadOnly( bool bReadOnly ) } } +void Edit::SetSelectAllSingleClick( bool bSelectAllSingleClick ) +{ + if ( mbSelectAllSingleClick != bSelectAllSingleClick ) + { + mbSelectAllSingleClick = bSelectAllSingleClick; + if ( mpSubEdit ) + mpSubEdit->SetSelectAllSingleClick( bSelectAllSingleClick ); + } +} void Edit::SetInsertMode( bool bInsert ) { if ( bInsert != mbInsertMode ) -- cgit