summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww1/fltshell.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx25
2 files changed, 10 insertions, 17 deletions
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index 330b2a0c5f00..6fd4c3d434ca 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -948,7 +948,7 @@ SwFltBookmark::SwFltBookmark( const OUString& rNa, const OUString& rVa,
// otherwise: Src Charset from argument for aName
// Src Charset from filter for aVal ( Text )
- if ( IsTOCBookmark() && ! rNa.startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()) )
+ if ( IsTOCBookmark() )
{
maName = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
maName += rNa;
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index a2b93e13768a..cac63fd0750c 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -101,18 +101,7 @@ namespace
// #120879# - helper method to identify a bookmark name to match the internal TOC bookmark naming convention
bool IsTOCBookmarkName( const ::rtl::OUString& rName )
{
- return rName.startsWith("_Toc") || rName.startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix());
- }
-
- ::rtl::OUString EnsureTOCBookmarkName( const ::rtl::OUString& rName )
- {
- OUString sTmp = rName;
- if ( IsTOCBookmarkName ( rName ) )
- {
- if ( ! rName.startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()) )
- sTmp = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix() + rName;
- }
- return sTmp;
+ return rName.startsWith("_Toc");
}
}
@@ -226,7 +215,7 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
const OUString sOrigName = BookmarkToWriter(*pName);
pReffedStck->NewAttr( aStart,
- SwFltBookmark( EnsureTOCBookmarkName( sOrigName ), aVal, pB->GetHandle(), IsTOCBookmarkName( sOrigName ) ));
+ SwFltBookmark( sOrigName, aVal, pB->GetHandle(), IsTOCBookmarkName( sOrigName ) ));
return 0;
}
@@ -2076,7 +2065,8 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, OUString& rStr )
OUString sBookmarkName;
if ( IsTOCBookmarkName( sName ) )
{
- sBookmarkName = EnsureTOCBookmarkName(sName);
+ sBookmarkName = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
+ sBookmarkName += sName;
// track <sBookmarkName> as referenced TOC bookmark.
pReffedStck->aReferencedTOCBookmarks.insert( sBookmarkName );
}
@@ -2102,7 +2092,8 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, OUString& rStr )
OUString sPageRefBookmarkName;
if ( IsTOCBookmarkName( sName ) )
{
- sPageRefBookmarkName = EnsureTOCBookmarkName(sName);
+ sPageRefBookmarkName = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
+ sPageRefBookmarkName += sName;
// track <sPageRefBookmarkName> as referenced TOC bookmark.
pReffedStck->aReferencedTOCBookmarks.insert( sPageRefBookmarkName );
}
@@ -3425,7 +3416,9 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, OUString& rStr
// #120879# add cross reference bookmark name prefix, if it matches internal TOC bookmark naming convention
if ( IsTOCBookmarkName( sMark ) )
{
- sMark = EnsureTOCBookmarkName(sMark);
+ OUString sTmp = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
+ sTmp += sMark;
+ sMark = sTmp;
// track <sMark> as referenced TOC bookmark.
pReffedStck->aReferencedTOCBookmarks.insert( sMark );
}