summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/uitest/navigator/tdf114724.py5
-rw-r--r--sw/source/uibase/utlui/navipi.cxx25
2 files changed, 18 insertions, 12 deletions
diff --git a/sw/qa/uitest/navigator/tdf114724.py b/sw/qa/uitest/navigator/tdf114724.py
index ebb354bf37b2..ee1f572d38ed 100644
--- a/sw/qa/uitest/navigator/tdf114724.py
+++ b/sw/qa/uitest/navigator/tdf114724.py
@@ -45,6 +45,11 @@ class tdf114724(UITestCase):
self.assertEqual(get_state_as_dict(xContentTree)["SelectEntryText"], "HEADING 1")
self.assertEqual(get_state_as_dict(xContentTree)["SelectionCount"], "1")
+ # tdf#124456 makes the sidebar navigator consistent with the floating navigator's use
+ # of the stored root mode setting. This requires the root mode button to be clicked
+ # here to change the content navigation view back to all categories view for subsequent
+ # tests that expect the navigator tree to not be in root mode.
+ xToolBar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 'root' button
self.xUITest.executeCommand(".uno:Sidebar")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index feee92814c34..f964a86957c8 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -538,6 +538,19 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent,
m_xContentTree->SetFieldTracking(m_pConfig->IsFieldTracking());
m_xContentTree->SetFootnoteTracking(m_pConfig->IsFootnoteTracking());
+ if (const ContentTypeId nRootType = m_pConfig->GetRootType();
+ nRootType != ContentTypeId::UNKNOWN)
+ {
+ m_xContentTree->SetRootType(nRootType);
+ m_xContent5ToolBox->set_item_active("root", true);
+ if (nRootType == ContentTypeId::OUTLINE || nRootType == ContentTypeId::DRAWOBJECT)
+ m_xContentTree->set_selection_mode(SelectionMode::Multiple);
+ else
+ m_xContentTree->set_selection_mode(SelectionMode::Single);
+ }
+ else
+ m_xContentTree->set_selection_mode(SelectionMode::Single);
+
UpdateInitShow();
GetCreateView();
@@ -592,7 +605,6 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent,
SetRegionDropMode(m_pConfig->GetRegionMode());
- m_xContentTree->set_selection_mode(SelectionMode::Single);
m_xContentTree->ShowTree();
m_xContent6ToolBox->set_item_active("listbox", true);
m_xContent6ToolBox->set_item_sensitive("listbox", bFloatingNavigator);
@@ -1137,17 +1149,6 @@ SwNavigatorWin::SwNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr,
SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig();
- const ContentTypeId nRootType = pNaviConfig->GetRootType();
- if( nRootType != ContentTypeId::UNKNOWN )
- {
- m_xNavi->m_xContentTree->SetRootType(nRootType);
- m_xNavi->m_xContent5ToolBox->set_item_active("root", true);
- if (nRootType == ContentTypeId::OUTLINE || nRootType == ContentTypeId::DRAWOBJECT)
- {
- m_xNavi->m_xContentTree->set_selection_mode(SelectionMode::Multiple);
- }
- }
-
SetMinOutputSizePixel(GetOptimalSize());
if (pNaviConfig->IsSmall())
m_xNavi->ZoomIn();