summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svtools/treelistbox.hxx2
-rw-r--r--svtools/source/contnr/treelistbox.cxx7
-rw-r--r--sw/source/uibase/utlui/content.cxx9
3 files changed, 13 insertions, 5 deletions
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