sw/source/uibase/utlui/content.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit a33b8ec923b4e86a2ca2075f9541e79a729b2ed7
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Mon Sep 12 15:27:11 2022 -0800
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Wed Sep 14 23:21:26 2022 +0200

    tdf#143547 SwNavigator: restore content tree scroll position
    
    after promote, demote, and move chapter
    
    Change-Id: Ie165fadf6154a019ad79a0fed489f63aa768c8f9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139823
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 68691799573f..55e51b52d51b 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3419,9 +3419,16 @@ void SwContentTree::ExecCommand(std::string_view rCmd, 
bool bOutlineWithChildren
         if (m_aActiveContentArr[ContentTypeId::OUTLINE])
             m_aActiveContentArr[ContentTypeId::OUTLINE]->Invalidate();
 
+        // tdf#143547 LO Writer: navigator should stand still on promoting and 
demoting
+        // In addition to m_bIgnoreDocChange being true, selections are 
cleared before the Display
+        // call. Either of these conditions disable restore of scroll position 
happening in the
+        // Display function so it needs to be done here.
+        auto nOldScrollPos = m_xTreeView->vadjustment_get_value();
+
         // clear all selections to prevent the Display function from trying to 
reselect selected entries
         m_xTreeView->unselect_all();
         Display(true);
+        m_xTreeView->vadjustment_set_value(nOldScrollPos);
 
         // reselect entries
         const SwOutlineNodes::size_type nCurrPos = 
pShell->GetOutlinePos(MAXLEVEL);

Reply via email to