diff options
author | Jim Raykowski <raykowj@gmail.com> | 2022-04-13 18:15:11 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2022-04-14 18:44:14 +0200 |
commit | 78b723c3a1fad1c095de1e5c746aef513556a53b (patch) | |
tree | 41f078b685eba6931a99aa8f173fcedde0bde328 /sw | |
parent | 36b7288a0ce9588b958e0b3a68613e9ee11cf17c (diff) |
tdf#52113, tdf#148312 Don't include table of contents hyperlinks
in the Navigator content tree Hyperlinks entries
Change-Id: I8d4499ecd6d9f617192560b31d7f87f7f26269f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132988
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/editsh.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/editsh.cxx | 14 | ||||
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index 95faaf6003cd..9439d8a777e0 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -826,7 +826,7 @@ public: bool InsertURL( const SwFormatINetFormat& rFormat, const OUString& rStr, bool bKeepSelection = false ); - void GetINetAttrs( SwGetINetAttrs& rArr ); + void GetINetAttrs(SwGetINetAttrs& rArr , bool bIncludeInToxContent = true); OUString GetDropText( const sal_Int32 nChars ) const; void ReplaceDropText( const OUString &rStr, SwPaM* pPaM = nullptr ); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index b1d265305321..a6a27bcc5b57 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -685,7 +685,7 @@ bool SwEditShell::InsertURL( const SwFormatINetFormat& rFormat, const OUString& return true; } -void SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) +void SwEditShell::GetINetAttrs(SwGetINetAttrs& rArr, bool bIncludeInToxContent) { rArr.clear(); @@ -705,6 +705,18 @@ void SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) && pFrame->MapModelToView(pTextNd, pFnd->GetStart()) != pFrame->MapModelToView(pTextNd, *pFnd->GetEnd())) { + // tdf#52113, tdf#148312 Don't include table of contents hyperlinks in the + // Navigator content tree Hyperlinks entries + if (!bIncludeInToxContent) + { + if(const SwSectionNode* pSectNd = pTextNd->FindSectionNode()) + { + SectionType eType = pSectNd->GetSection().GetType(); + if(SectionType::ToxContent == eType) + continue; + } + } + SwTextINetFormat& rAttr = *pFnd; OUString sText( pTextNd->GetExpandText(GetLayout(), rAttr.GetStart(), *rAttr.GetEnd() - rAttr.GetStart()) ); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 719b2016e1b7..c614ee4d7c7d 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -714,7 +714,7 @@ void SwContentType::FillMemberList(bool* pbContentChanged) case ContentTypeId::URLFIELD: { SwGetINetAttrs aArr; - m_pWrtShell->GetINetAttrs(aArr); + m_pWrtShell->GetINetAttrs(aArr, false); if (m_bAlphabeticSort) { |