diff options
author | Jim Raykowski <raykowj@gmail.com> | 2021-09-21 18:24:38 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2021-09-22 23:25:35 +0200 |
commit | 8644a3114d412e8de6cc6712c2f2bcad436906c9 (patch) | |
tree | 23e119853e204d66a1a42be98d8c9653e6748f2d /sw/source/uibase/utlui | |
parent | 3b6dd54994ab1e624729cb007a8e3dc2b5f3b891 (diff) |
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 <raykowj@gmail.com>
Diffstat (limited to 'sw/source/uibase/utlui')
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
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) && |