include/svtools/treelistbox.hxx       |    2 +-
 svtools/source/contnr/treelistbox.cxx |    7 ++++---
 sw/source/uibase/utlui/content.cxx    |    9 ++++++++-
 3 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit b649ce123dea372359ec571135a68eb3de844e5b
Author: Jim Raykowski <rayk...@gmail.com>
Date:   Tue Apr 17 18:07:39 2018 -0800

    tdf#117063 Modify tree list double click behavior in the navigator
    
    Change-Id: I369a7a2075aabd3574bdda39dac74e2b132f6923
    Reviewed-on: https://gerrit.libreoffice.org/53074
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Heiko Tietze <tietze.he...@gmail.com>

diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index 9907e4358397..ac58f6228069 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -647,7 +647,7 @@ public:
 
     void            SetSublistOpenWithReturn();      // open/close sublist 
with return/enter
     void            SetSublistOpenWithLeftRight();   // open/close sublist 
with cursor left/right
-    void            SetSublistDontOpenWithDoubleClick(); // do not open/close 
sublist with mouse double click on entry
+    void            SetSublistDontOpenWithDoubleClick( bool bDontOpen ); // 
set mouse double click open/close sublist behavior
 
     void            EnableInplaceEditing( bool bEnable );
     // Edits the Entry's first StringItem, 0 == Cursor
diff --git a/svtools/source/contnr/treelistbox.cxx 
b/svtools/source/contnr/treelistbox.cxx
index 49ac834eecac..63ddcdbd62e1 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -427,7 +427,8 @@ void SvTreeListBox::DeselectHdl()
 
 bool SvTreeListBox::DoubleClickHdl()
 {
-    return !aDoubleClickHdl.IsSet() || aDoubleClickHdl.Call(this);
+    aDoubleClickHdl.Call( this );
+    return true;
 }
 
 
@@ -1433,9 +1434,9 @@ void SvTreeListBox::SetSublistOpenWithLeftRight()
     pImpl->bSubLstOpLR = true;
 }
 
-void SvTreeListBox::SetSublistDontOpenWithDoubleClick()
+void SvTreeListBox::SetSublistDontOpenWithDoubleClick(bool bDontOpen)
 {
-    pImpl->bSubLstOpDblClick = false;
+    pImpl->bSubLstOpDblClick = !bDontOpen;
 }
 
 void SvTreeListBox::Resize()
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 4fe719131123..06bb5ad1c701 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -858,7 +858,6 @@ SwContentTree::SwContentTree(vcl::Window* pParent, 
SwNavigationPI* pDialog)
     , m_bViewHasChanged(false)
     , m_bIsKeySpace(false)
 {
-    SetSublistDontOpenWithDoubleClick();
     SetHelpId(HID_NAVIGATOR_TREELIST);
 
     SetNodeDefaultImages();
@@ -2705,7 +2704,15 @@ void SwContentTree::MouseButtonDown( const MouseEvent& 
rMEvt )
     if( !pEntry && rMEvt.IsLeft() && rMEvt.IsMod1() && (rMEvt.GetClicks() % 2) 
== 0)
         Control::MouseButtonDown( rMEvt );
     else
+    {
+        if( pEntry && (rMEvt.GetClicks() % 2) == 0)
+        {
+            SwContent* pCnt = static_cast<SwContent*>(pEntry->GetUserData());
+            const ContentTypeId nActType = pCnt->GetParent()->GetType();
+            SetSublistDontOpenWithDoubleClick( nActType == 
ContentTypeId::OUTLINE );
+        }
         SvTreeListBox::MouseButtonDown( rMEvt );
+    }
 }
 
 // Update immediately
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to