[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/source
Justin Luth
justin_luth at sil.org
Thu Mar 19 04:02:16 PDT 2015
sw/source/filter/ww8/ww8par5.cxx | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
New commits:
commit d66458347f552cbd436d82700626d45eeb1f80fb
Author: Justin Luth <justin_luth at sil.org>
Date: Tue Mar 10 13:12:30 2015 +0300
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index e4f9a6f..4b35205 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);
More information about the Libreoffice-commits
mailing list