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

New commits:
commit 9c101e46269db89e20989553c5f1824864a6f678
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Mon Sep 12 15:27:11 2022 -0800
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Oct 3 10:06:28 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>
    (cherry picked from commit a33b8ec923b4e86a2ca2075f9541e79a729b2ed7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140875
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 1461cd84a1b6..cf2c9eb569cc 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3356,9 +3356,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