dev/null                                 |binary
 sw/source/core/crsr/crossrefbookmark.cxx |    2 +-
 sw/source/filter/ww8/ww8par5.cxx         |   11 ++++++++++-
 3 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 92a43d05d14b1ab7b8bfb4052874d0f0e6c62ef9
Author: Justin Luth <justin_l...@sil.org>
Date:   Mon Mar 9 15:26:14 2015 +0300

    tdf#89482 fix __refheading__ regression, set only CrossRefs as TOC.
    
    bugfix tdf#68963 marked all __refheading__ bookmarks at TOC, but
    those crossreferences were deleted if they are not recorded in
    aReferencedTOCBookmarks.  Redesigned the fix to include _Toc in the
    crossreference name that is auto-generated, which is how MSWord
    differentiates the markers.
    
    Change-Id: Ic5bdc4b475f2eb7963cbcf3bf0ec74337daef5be
    Reviewed-on: https://gerrit.libreoffice.org/14864
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/qa/extras/ww8import/data/fdo68963.doc 
b/sw/qa/extras/ww8import/data/fdo68963.doc
deleted file mode 100644
index 4b331f0..0000000
Binary files a/sw/qa/extras/ww8import/data/fdo68963.doc and /dev/null differ
diff --git a/sw/source/core/crsr/crossrefbookmark.cxx 
b/sw/source/core/crsr/crossrefbookmark.cxx
index 700a3f2..67a25d0 100644
--- a/sw/source/core/crsr/crossrefbookmark.cxx
+++ b/sw/source/core/crsr/crossrefbookmark.cxx
@@ -72,7 +72,7 @@ namespace sw { namespace mark
         const vcl::KeyCode& rCode,
         const OUString& rName,
         const OUString& rShortName)
-        : CrossRefBookmark(rPaM, rCode, rName, rShortName, 
IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix())
+        : CrossRefBookmark(rPaM, rCode, rName, rShortName, 
IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()+"_Toc")
     { }
 
     bool CrossRefHeadingBookmark::IsLegalName(const OUString& rName)
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 246d3f6..bbde7d7 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -102,7 +102,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 )
@@ -1970,6 +1970,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.getIDocumentFieldsAccess().GetSysFldType( 
RES_GETREFFLD ),
         sBkmName,REF_BOOKMARK,0,eFormat);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to