sw/source/uibase/utlui/content.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+)
New commits: commit 8644a3114d412e8de6cc6712c2f2bcad436906c9 Author: Jim Raykowski <rayk...@gmail.com> AuthorDate: Tue Sep 21 18:24:38 2021 -0800 Commit: Jim Raykowski <rayk...@gmail.com> CommitDate: Wed Sep 22 23:25:35 2021 +0200 tdf#95378 Writer Navigator: Track references Resolves reference tracking part of the enhancement request. Makes the Navigator content tree highlight the corresponding reference item of the reference field at the current cursor position in the document if there is one. Change-Id: If10d0cffbf03fcc9a61e573e967e854c428f9b5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122414 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 4a0eea209990..fb8667ead94a 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -3391,6 +3391,16 @@ void SwContentTree::UpdateTracking() return; } + // references + if (SwContentAtPos aContentAtPos(IsAttrAtPos::RefMark); + m_pActiveShell->GetContentAtPos(m_pActiveShell->GetCursorDocPos(), aContentAtPos) && + !(m_bIsRoot && m_nRootType != ContentTypeId::REFERENCE)) + { + const SwFormatRefMark& rRefMark = aContentAtPos.pFndTextAttr->GetRefMark(); + lcl_SelectByContentTypeAndName(this, *m_xTreeView, SwResId(STR_CONTENT_TYPE_REFERENCE), + rRefMark.GetRefName()); + return; + } // hyperlinks if (SwContentAtPos aContentAtPos(IsAttrAtPos::InetAttr); m_pActiveShell->GetContentAtPos(m_pActiveShell->GetCursorDocPos(), aContentAtPos) &&