From 40b40b74aae7e2a98dc964286baf499ecd1ae10b Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Thu, 18 Nov 2021 12:45:44 -0900 Subject: [PATCH] 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 --- sw/source/uibase/utlui/content.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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: { -- 2.11.4.GIT