sd/qa/uitest/impress_tests/tdf137729.py |    2 +-
 sw/source/uibase/utlui/content.cxx      |   16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 0da5631e08c17d1cb183b2249b0dfa0b6832ff9f
Author:     Jim Raykowski <[email protected]>
AuthorDate: Sat Nov 26 09:18:09 2022 -0900
Commit:     Jim Raykowski <[email protected]>
CommitDate: Mon Nov 28 20:51:49 2022 +0100

    tdf#152116 SwNavigator: Restore outline headings expand state
    
    when the Navigator is reopened
    
    This patch restores the outline headings expand state to what it was
    when the Navigator was last closed. Effort here is a one session
    solution that works for all documents opened in the session. The
    expand state is not restored when a document is close and then
    reopened.
    
    Change-Id: I28e8e01694d72dee2cc3705ff69f8726c28bdecc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143326
    Tested-by: Jenkins
    Tested-by: Heiko Tietze <[email protected]>
    Reviewed-by: Heiko Tietze <[email protected]>
    Reviewed-by: Jim Raykowski <[email protected]>

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 2bb852f5b617..32a9e8ab63ce 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -138,6 +138,8 @@ class SwContentArr
 
 namespace
 {
+    std::map<OUString, std::map<void*, bool>> lcl_DocOutLineExpandStateMap;
+
     bool lcl_IsContent(const weld::TreeIter& rEntry, const weld::TreeView& 
rTreeView)
     {
         return weld::fromId<const 
SwTypeNumber*>(rTreeView.get_id(rEntry))->GetTypeId() == CTYPE_CNT;
@@ -1108,12 +1110,26 @@ 
SwContentTree::SwContentTree(std::unique_ptr<weld::TreeView> xTreeView, SwNaviga
         m_aContextStrings[i] = SwResId(STR_CONTEXT_ARY[i]);
     }
     m_nActiveBlock = m_pConfig->GetActiveBlock();
+
+    // Restore outline headings expand state (same session persistence only)
+    if (SwView* pView = GetActiveView(); pView && pView->GetDocShell())
+    {
+        OUString sDocTitle = pView->GetDocShell()->GetTitle();
+        if (lcl_DocOutLineExpandStateMap.find(sDocTitle) != 
lcl_DocOutLineExpandStateMap.end())
+            mOutLineNodeMap = lcl_DocOutLineExpandStateMap[sDocTitle];
+    }
+
     m_aUpdTimer.SetInvokeHandler(LINK(this, SwContentTree, TimerUpdate));
     m_aUpdTimer.SetTimeout(1000);
 }
 
 SwContentTree::~SwContentTree()
 {
+    if (SwView* pView = GetActiveView(); pView && pView->GetDocShell())
+    {
+        OUString sDocTitle = pView->GetDocShell()->GetTitle();
+        lcl_DocOutLineExpandStateMap[sDocTitle] = mOutLineNodeMap;
+    }
     clear(); // If applicable erase content types previously.
     m_aUpdTimer.Stop();
     SetActiveShell(nullptr);
commit 0c2d485edece9078629842a0e1202bfb75f6d0d6
Author:     Bogdan B <[email protected]>
AuthorDate: Fri Nov 11 20:17:39 2022 +0200
Commit:     Kevin Suo <[email protected]>
CommitDate: Mon Nov 28 20:51:36 2022 +0100

    tdf#132293 remove unused imports from uitest
    
    Change-Id: I7690db426741fdc46cd2632f2db98ad75361261f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142617
    Tested-by: Jenkins
    Reviewed-by: Kevin Suo <[email protected]>

diff --git a/sd/qa/uitest/impress_tests/tdf137729.py 
b/sd/qa/uitest/impress_tests/tdf137729.py
index 9180e460d0f8..fe742e0e1537 100644
--- a/sd/qa/uitest/impress_tests/tdf137729.py
+++ b/sd/qa/uitest/impress_tests/tdf137729.py
@@ -10,9 +10,9 @@
 from uitest.framework import UITestCase
 from uitest.uihelper.common import select_pos
 from com.sun.star.drawing.HatchStyle import SINGLE
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import change_measurement_unit
 
+
 class tdf137729(UITestCase):
 
     def test_tdf137729(self):

Reply via email to