summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2021-10-27 21:43:10 -0800
committerJim Raykowski <raykowj@gmail.com>2021-11-11 06:59:56 +0100
commit11d3ff1b64424d4f2c660539872f981ab3ed80c8 (patch)
treeecdf28a4883f55a6714a1a09ac895e2dd2b15b4f /sw
parent40fa74fc468ba18c75e8547faff41710ae6fbbef (diff)
SwNavigator: use stored root-type setting for both Navigator types
Currently the RootType setting stored in Navigator configuration is used only by the floating Navigator to restore the root type setting on program start to the setting at the end of the previous session. This patch makes the sidebar Navigator use this stored setting. Change-Id: I654f4eb4890351196e64796e4a48031424259a5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124456 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw')
-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();