summaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2015-03-10 13:12:30 +0300
committerCaolán McNamara <caolanm@redhat.com>2015-03-19 11:01:54 +0000
commitd66458347f552cbd436d82700626d45eeb1f80fb (patch)
tree7d6dc79ee9f2241d30c67a72f21cc927ba4ad22c /sw
parentvcl/text: fix duplicate text in fontwork tdf#81876 (diff)
downloadcore-d66458347f552cbd436d82700626d45eeb1f80fb.tar.gz
core-d66458347f552cbd436d82700626d45eeb1f80fb.zip
tdf#68963 avoid __refheading__ regression reported in tdf#89482
bugfix tdf#68963 (scheduled for 4.3.7) marked all __refheading__ bookmarks at TOC, but those crossreferences were deleted if they are not recorded in aReferencedTOCBookmarks. I decided to NOT introduce the full fix (which allows LO to author a .doc with working cross-references) into the stable 4.3 branch to ensure there are no further regressions. This patch both avoids a regression and allows sharing of crossref documents authored in LO 4.4.2+. Change-Id: I5d8b979bf1b884cbf74b31d875dc7c80a6c4b903 Reviewed-on: https://gerrit.libreoffice.org/14865 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index e4f9a6fa9f84..4b352051aabe 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -100,7 +100,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());
+ return rName.startsWith("_Toc") || rName.startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()+"_Toc");
}
::rtl::OUString EnsureTOCBookmarkName( const ::rtl::OUString& rName )
@@ -1960,6 +1960,15 @@ eF_ResT SwWW8ImplReader::Read_F_Ref( WW8FieldDesc*, OUString& rStr )
OUString sBkmName(GetMappedBookmark(sOrigBkmName));
+ // #i120879# add cross reference bookmark name prefix, if it
+ // matches internal TOC bookmark naming convention
+ if ( IsTOCBookmarkName( sBkmName ) )
+ {
+ sBkmName = EnsureTOCBookmarkName(sBkmName);
+ // track <sBookmarkName> as referenced TOC bookmark.
+ pReffedStck->aReferencedTOCBookmarks.insert( sBkmName );
+ }
+
SwGetRefField aFld(
(SwGetRefFieldType*)rDoc.GetSysFldType( RES_GETREFFLD ),
sBkmName,REF_BOOKMARK,0,eFormat);