sw/source/uibase/utlui/content.cxx |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 40b40b74aae7e2a98dc964286baf499ecd1ae10b
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Thu Nov 18 12:45:44 2021 -0900
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Sat Nov 20 10:23:14 2021 +0100

    SwNavigator: fall thru to outline tracking when section tracking is off
    
    and the last GotoContent is not the current section
    
    Change-Id: I762163f82f2a376f04ce6fcb1c001fde6544e84d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125510
    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 8b5c13ffb088..36686253ff83 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3869,9 +3869,21 @@ void SwContentTree::UpdateTracking()
                 !(m_bIsRoot && m_nRootType != ContentTypeId::REGION))
         {
             if (m_bSectionTracking)
+            {
                 lcl_SelectByContentTypeAndName(this, *m_xTreeView, 
SwResId(STR_CONTENT_TYPE_REGION),
                                                pSection->GetSectionName());
-            return;
+                return;
+            }
+            else
+            {
+                // prevent fall thru to outline tracking when section tracking 
is off and the last
+                // GotoContent is the current section
+                if (m_nLastSelType == ContentTypeId::REGION &&
+                        m_xTreeView->get_selected_text() == 
pSection->GetSectionName())
+                    return;
+            }
+            // fall thru to outline tracking when section tracking is off and 
the last GotoContent
+            // is not the current section
         }
     }
     // outline
@@ -5163,7 +5175,7 @@ void SwContentTree::GotoContent(const SwContent* pCnt)
 {
     m_nLastGotoContentWasOutlinePos = SwOutlineNodes::npos;
     lcl_AssureStdModeAtShell(m_pActiveShell);
-    switch(pCnt->GetParent()->GetType())
+    switch(m_nLastSelType = pCnt->GetParent()->GetType())
     {
         case ContentTypeId::TEXTFIELD:
         {

Reply via email to