summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/editsh.hxx2
-rw-r--r--sw/source/core/edit/editsh.cxx14
-rw-r--r--sw/source/uibase/utlui/content.cxx2
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)
{