[Libreoffice-commits] core.git: include/vcl svtools/source vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Jul 19 11:03:57 UTC 2018
include/vcl/combobox.hxx | 2 +-
include/vcl/edit.hxx | 4 ++++
svtools/source/control/ctrlbox.cxx | 1 +
vcl/source/control/combobox.cxx | 5 ++++-
vcl/source/control/edit.cxx | 12 +++++++++++-
5 files changed, 21 insertions(+), 3 deletions(-)
New commits:
commit 11b60b16739bfd88cc6f9f16834870a296921883
Author: Nickson Thanda <nicksonthanda10 at msn.com>
AuthorDate: Tue Jul 3 13:54:40 2018 +0100
Commit: Muhammet Kara <muhammet.kara at pardus.org.tr>
CommitDate: Thu Jul 19 13:03:33 2018 +0200
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 <muhammet.kara at pardus.org.tr>
diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
index 2f7efd3e006e..4d30398e8c6e 100644
--- a/include/vcl/combobox.hxx
+++ b/include/vcl/combobox.hxx
@@ -90,7 +90,7 @@ public:
virtual void RemoveEntryAt(sal_Int32 nPos);
void Clear();
-
+ void EnableSelectAll();
sal_Int32 GetEntryPos( const OUString& rStr ) const;
sal_Int32 GetEntryPos( const void* pData ) const;
Image GetEntryImage( sal_Int32 nPos ) const;
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index 61649aeef6f1..bee63aae0488 100644
--- a/include/vcl/edit.hxx
+++ b/include/vcl/edit.hxx
@@ -88,6 +88,7 @@ private:
sal_Int32 mnMaxWidthChars;
sal_Unicode mcEchoChar;
bool mbModified:1,
+ mbSelectAllSingleClick:1,
mbInternModified:1,
mbReadOnly:1,
mbInsertMode:1,
@@ -201,6 +202,9 @@ public:
virtual void SetReadOnly( bool bReadOnly = true );
virtual bool IsReadOnly() const { return mbReadOnly; }
+ void SetSelectAllSingleClick( bool bSelectAllSingleClick );
+ bool IsSelectAllSingleClick() const { return mbSelectAllSingleClick; }
+
void SetInsertMode( bool bInsert );
bool IsInsertMode() const;
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 9d7911b0552c..2ae2506cf33f 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -669,6 +669,7 @@ void LineListBox::DataChanged( const DataChangedEvent& rDCEvt )
FontNameBox::FontNameBox( vcl::Window* pParent, WinBits nWinStyle ) :
ComboBox( pParent, nWinStyle )
{
+ EnableSelectAll();
mbWYSIWYG = false;
InitFontMRUEntriesFile();
}
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 )
More information about the Libreoffice-commits
mailing list