vcl/source/treelist/svimpbox.cxx    |   19 +++++++------------
 vcl/source/treelist/treelistbox.cxx |    1 -
 2 files changed, 7 insertions(+), 13 deletions(-)

New commits:
commit 95fff137946b1f456f7ae764f1814aa8910b42b6
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun May 24 20:26:54 2020 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Mon Nov 30 18:23:15 2020 +0100

    support activate-on-single-click
    
    Change-Id: Iac0231b3bd84d664b1ab59023ef8242f3bd08940
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94773
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106882
    Tested-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index 7ccbb5856f01..305248abbcca 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -598,8 +598,6 @@ void SvImpLBox::RecalcFocusRect()
 
 
 //  Sets cursor. When using SingleSelection, the selection is adjusted.
-
-
 void SvImpLBox::SetCursor( SvTreeListEntry* pEntry, bool bForceNoSelect )
 {
     SvViewDataEntry* pViewDataNewCur = nullptr;
@@ -2023,7 +2021,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt )
     }
 
 
-    if( (rMEvt.GetClicks() % 2) == 0 )
+    if( (rMEvt.GetClicks() % 2) == 0)
     {
         m_nFlags &= ~LBoxFlags::StartEditTimer;
         m_pView->pHdlEntry = pEntry;
@@ -2087,6 +2085,9 @@ void SvImpLBox::MouseButtonUp( const MouseEvent& rMEvt)
         m_aEditClickPos = rMEvt.GetPosPixel();
         m_aEditIdle.Start();
     }
+
+    if (m_pView->mbActivateOnSingleClick)
+        m_pView->DoubleClickHdl();
 }
 
 void SvImpLBox::MouseMove( const MouseEvent& rMEvt)
@@ -2426,15 +2427,9 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
             break;
 
         case KEY_RETURN:
-            if( m_bSubLstOpRet && IsExpandable() )
-            {
-                if( m_pView->IsExpanded( m_pCursor ) )
-                    m_pView->Collapse( m_pCursor );
-                else
-                    m_pView->Expand( m_pCursor );
-            }
-            else
-                bKeyUsed = false;
+            if (m_pView->mbActivateOnSingleClick)
+                m_pView->DoubleClickHdl();
+            bKeyUsed = false;
             break;
 
         case KEY_F2:
diff --git a/vcl/source/treelist/treelistbox.cxx 
b/vcl/source/treelist/treelistbox.cxx
index 6e3c612093d8..6c91289f019d 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -456,7 +456,6 @@ bool SvTreeListBox::DoubleClickHdl()
     return !aDoubleClickHdl.IsSet() || aDoubleClickHdl.Call(this);
 }
 
-
 bool SvTreeListBox::CheckDragAndDropMode( SvTreeListBox const * pSource, 
sal_Int8 nAction )
 {
     if ( pSource == this )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to