sw/source/uibase/utlui/content.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit c6c343db72a97bb027ccb493cef6fa7f1025f119
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Fri Jan 28 17:34:48 2022 -0900
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Mon Jan 31 03:47:35 2022 +0100

    tdf#147041 Always show navigated heading at top of visible view area
    
    Revert to pre commit 1df2581cfffc87386c6de7614793b2d664244e5a behavior
    
    Change-Id: I06fe630bf0c0e611351e0e9a56361a3028f207d9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129129
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>
    (cherry picked from commit b0434f62c17b69e10caf05ad85a60f1bffdb5238)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129080
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 01c0b005f8ff..d3c2bc2b2b81 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -5286,9 +5286,11 @@ void SwContentTree::GotoContent(const SwContent* pCnt)
     rView.GetPostItMgr()->SetActiveSidebarWin(nullptr);
     rView.GetEditWin().GrabFocus();
 
-    // assure visible view area is at cursor position
-    if (!m_pActiveShell->IsCursorVisible() && 
!m_pActiveShell->IsFrameSelected() &&
-            !m_pActiveShell->IsObjSelected())
+    // Assure cursor is in visible view area.
+    // (tdf#147041) Always show the navigated outline at the top of the 
visible view area.
+    if (pCnt->GetParent()->GetType() == ContentTypeId::OUTLINE ||
+            (!m_pActiveShell->IsCursorVisible() && 
!m_pActiveShell->IsFrameSelected() &&
+            !m_pActiveShell->IsObjSelected()))
     {
         Point rPoint = m_pActiveShell->GetCursorDocPos();
         rPoint.setX(0);

Reply via email to