[Libreoffice-commits] core.git: sw/source

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 23 16:54:25 UTC 2020


 sw/source/uibase/utlui/content.cxx |   21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

New commits:
commit 05022d6cfff72d26fa3b916a4f86ac6488298dac
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Sat Mar 21 22:31:34 2020 -0800
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Mar 23 17:53:47 2020 +0100

    Keep Writer Navigator content view vertical scroll position
    
    ...when an object is renamed
    
    Change-Id: Ib8984fd67653e6bec30d9b27c2d2fbe86b7ce0c7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90891
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 340a3a90ba1f..b7f85297087a 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1773,7 +1773,6 @@ void SwContentTree::Display( bool bActive )
             nEntryRelPos = GetModel()->GetAbsPos(pOldSelEntry) - GetModel()->GetAbsPos(pParentEntry);
         }
     }
-    SetUpdateMode( false );
     SvTreeListBox::Clear();
     if (!bActive)
         m_eState = State::HIDDEN;
@@ -1849,7 +1848,6 @@ void SwContentTree::Display( bool bActive )
             }
             if(pSelEntry)
             {
-                MakeVisible(pSelEntry);
                 Select(pSelEntry);
             }
             else
@@ -1912,16 +1910,17 @@ void SwContentTree::Display( bool bActive )
                 SetCurEntry(pParent);
         }
     }
-    ScrollBar* pVScroll = GetVScroll();
-    if(GetEntryCount() == nOldEntryCount &&
-        nOldScrollPos && pVScroll && pVScroll->IsVisible()
-        && pVScroll->GetThumbPos() != nOldScrollPos)
+    if (!m_bIsInPromoteDemote)
     {
-        sal_Int32 nDelta = pVScroll->GetThumbPos() - nOldScrollPos;
-        ScrollOutputArea( static_cast<short>(nDelta) );
+        ScrollBar* pVScroll = GetVScroll();
+        if(GetEntryCount() == nOldEntryCount &&
+                nOldScrollPos && pVScroll && pVScroll->IsVisible()
+                && pVScroll->GetThumbPos() != nOldScrollPos)
+        {
+            sal_Int32 nDelta = pVScroll->GetThumbPos() - nOldScrollPos;
+            ScrollOutputArea( static_cast<short>(nDelta) );
+        }
     }
-    if (!m_bIsInPromoteDemote)
-        SetUpdateMode( true );
 }
 
 void SwContentTree::Clear()
@@ -2725,8 +2724,6 @@ void SwContentTree::ExecCommand(const OUString& rCmd, bool bOutlineWithChildren)
                 }
             }
         }
-        // SetUpdateMode is set false in the Display function
-        SetUpdateMode(true);
     }
     m_bIsInPromoteDemote = false;
 }


More information about the Libreoffice-commits mailing list