[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - sw/qa sw/source

Szymon Kłos szymon.klos at collabora.com
Wed Nov 29 09:53:02 UTC 2017


 sw/qa/extras/ooxmlexport/data/tdf65955_2.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx    |   13 +++++++++++++
 sw/source/filter/ww8/docxexport.cxx          |    4 +---
 3 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 243478afd9c6b950bac5e9bdb326d3bea86d497a
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Tue Nov 28 18:57:52 2017 +0100

    tdf#65955 Bookmarks on two paragraphs
    
    Change-Id: I61fe660ee4fc5d3f6fc86c29e07369811eb38935
    Reviewed-on: https://gerrit.libreoffice.org/45434
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/45461
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf65955_2.odt b/sw/qa/extras/ooxmlexport/data/tdf65955_2.odt
new file mode 100755
index 000000000000..5ad9146dc2b3
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf65955_2.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index de69453e71c2..7d733ebf49d2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -1833,6 +1833,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf65955, "tdf65955.odt")
     CPPUNIT_ASSERT_EQUAL(OUString("r"), xRange2->getString());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf65955_2, "tdf65955_2.odt")
+{
+    uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(xBookmarksByIdx->getCount(), static_cast<sal_Int32>(1));
+    uno::Reference<container::XNameAccess> xBookmarksByName(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xBookmarksByName->hasByName("test"));
+
+    uno::Reference<text::XTextContent> xContent3(xBookmarksByName->getByName("test"), uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> xRange3(xContent3->getAnchor(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(xRange3->getString(), OUString("foo bar"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 1283f44ee726..d32ca0550ca5 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -158,12 +158,10 @@ void DocxExport::AppendBookmarks( const SwTextNode& rNode, sal_Int32 nAktPos, sa
         }
     }
 
-    SwWW8AttrIter aAttrIter( *this, rNode );
-    const sal_Int32 nNextAttr = GetNextPos( &aAttrIter, rNode, nAktPos );
     const OUString& aStr( rNode.GetText() );
     const sal_Int32 nEnd = aStr.getLength();
 
-    if ( nNextAttr == nEnd && nAktPos == nEnd )
+    if ( nAktPos == nEnd )
         m_pAttrOutput->WriteFinalBookmarks_Impl( aStarts, aEnds );
     else
         m_pAttrOutput->WriteBookmarks_Impl( aStarts, aEnds );


More information about the Libreoffice-commits mailing list