diff options
author | Jim Raykowski <raykowj@gmail.com> | 2021-11-06 23:27:04 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2021-11-09 03:34:35 +0100 |
commit | d4c56284813c1e38a2fb46e9a52c5350d1ba3cef (patch) | |
tree | 32d3efb19c23815532c21ef6037b8d42ea53b93f | |
parent | ccf3d9140a24d767003c08cd0247e6ee6fd12fe0 (diff) |
SwNavigator: Restore content tree settings before showing
Content tracking by the Navigator content tree and outline levels
displayed currently do not use the stored Navigator settings when the
tree is initially shown. This can cause content to be tracked and
outline levels to be shown that are different from the stored settings
when the tree is initially shown.
This patch fixes these possibilities by changing when the stored
content tree settings are applied to before the tree is initially
filled and shown.
Change-Id: I5443788c3fbacb36695cfc56163f217408254fd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124831
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
-rw-r--r-- | sw/source/uibase/utlui/navipi.cxx | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 36c697da9d37..feee92814c34 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -519,6 +519,25 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, { m_xContainer->connect_container_focus_changed(LINK(this, SwNavigationPI, SetFocusChildHdl)); + // Restore content tree settings before calling UpdateInitShow. UpdateInitShow calls Fillbox, + // which calls Display and UpdateTracking. Incorrect outline levels could be displayed and + // unexpected content tracking could occur if these content tree settings are not done before. + m_xContentTree->SetOutlineLevel(static_cast<sal_uInt8>(m_pConfig->GetOutlineLevel())); + m_xContentTree->SetOutlineTracking(static_cast<sal_uInt8>(m_pConfig->GetOutlineTracking())); + m_xContentTree->SetTableTracking(m_pConfig->IsTableTracking()); + m_xContentTree->SetSectionTracking(m_pConfig->IsSectionTracking()); + m_xContentTree->SetFrameTracking(m_pConfig->IsFrameTracking()); + m_xContentTree->SetImageTracking(m_pConfig->IsImageTracking()); + m_xContentTree->SetOLEobjectTracking(m_pConfig->IsOLEobjectTracking()); + m_xContentTree->SetBookmarkTracking(m_pConfig->IsBookmarkTracking()); + m_xContentTree->SetHyperlinkTracking(m_pConfig->IsHyperlinkTracking()); + m_xContentTree->SetReferenceTracking(m_pConfig->IsReferenceTracking()); + m_xContentTree->SetIndexTracking(m_pConfig->IsIndexTracking()); + m_xContentTree->SetCommentTracking(m_pConfig->IsCommentTracking()); + m_xContentTree->SetDrawingObjectTracking(m_pConfig->IsDrawingObjectTracking()); + m_xContentTree->SetFieldTracking(m_pConfig->IsFieldTracking()); + m_xContentTree->SetFootnoteTracking(m_pConfig->IsFootnoteTracking()); + UpdateInitShow(); GetCreateView(); @@ -573,23 +592,6 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, SetRegionDropMode(m_pConfig->GetRegionMode()); - m_xContentTree->SetOutlineLevel(static_cast<sal_uInt8>(m_pConfig->GetOutlineLevel())); - - m_xContentTree->SetOutlineTracking(static_cast<sal_uInt8>(m_pConfig->GetOutlineTracking())); - m_xContentTree->SetTableTracking(m_pConfig->IsTableTracking()); - m_xContentTree->SetSectionTracking(m_pConfig->IsSectionTracking()); - m_xContentTree->SetFrameTracking(m_pConfig->IsFrameTracking()); - m_xContentTree->SetImageTracking(m_pConfig->IsImageTracking()); - m_xContentTree->SetOLEobjectTracking(m_pConfig->IsOLEobjectTracking()); - m_xContentTree->SetBookmarkTracking(m_pConfig->IsBookmarkTracking()); - m_xContentTree->SetHyperlinkTracking(m_pConfig->IsHyperlinkTracking()); - m_xContentTree->SetReferenceTracking(m_pConfig->IsReferenceTracking()); - m_xContentTree->SetIndexTracking(m_pConfig->IsIndexTracking()); - m_xContentTree->SetCommentTracking(m_pConfig->IsCommentTracking()); - m_xContentTree->SetDrawingObjectTracking(m_pConfig->IsDrawingObjectTracking()); - m_xContentTree->SetFieldTracking(m_pConfig->IsFieldTracking()); - m_xContentTree->SetFootnoteTracking(m_pConfig->IsFootnoteTracking()); - m_xContentTree->set_selection_mode(SelectionMode::Single); m_xContentTree->ShowTree(); m_xContent6ToolBox->set_item_active("listbox", true); |