diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-08-02 14:11:50 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-08-02 16:54:12 +0200 |
commit | e3aca9772f4e1f9fcabecbe5bf22123259b3143a (patch) | |
tree | 5124cde1c0c603f1afab0f9c87bdb935e9e4e3d3 | |
parent | 77e71450913129fb45da7c6216f2f1b17ce94d6c (diff) |
fdo#46020: fixed missing footnote docx/doc/rtf export
Don't skip a next position when parsing a paragraph into runs to export.
Change-Id: If7e887ea84ad24256b37aa96187bc30ea154632b
-rw-r--r-- | sw/qa/extras/ww8export/data/fdo46020.odt | bin | 0 -> 12611 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 4 |
3 files changed, 14 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/data/fdo46020.odt b/sw/qa/extras/ww8export/data/fdo46020.odt Binary files differnew file mode 100644 index 000000000000..478c931b22d0 --- /dev/null +++ b/sw/qa/extras/ww8export/data/fdo46020.odt diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 58692a65f925..f8fbba99441c 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -42,11 +42,13 @@ class Test : public SwModelTestBase public: void testN325936(); void testFdo45724(); + void testFdo46020(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) CPPUNIT_TEST(testN325936); CPPUNIT_TEST(testFdo45724); + CPPUNIT_TEST(testFdo46020); #endif CPPUNIT_TEST_SUITE_END(); @@ -95,6 +97,15 @@ void Test::testFdo45724() CPPUNIT_ASSERT_EQUAL(OUString("xxx"), xComponent->getCurrentValue().get<OUString>()); } +void Test::testFdo46020() +{ + // The footnote in that document wasn't exported, check that it is actually exported + roundtrip("fdo46020.odt"); + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xFootnotes->getCount()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 09969f54c3ad..efb6e2a26dfd 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1622,8 +1622,10 @@ void MSWordExportBase::UpdatePosition( SwWW8AttrIter* aAttrIter, xub_StrLen nAkt xub_StrLen nNextPos; // go to next attribute if no bookmark is found or if the bookmark is behind the next attribute position + // It may happend that the WhereNext() wasn't used in the previous increment because there was a + // bookmark before it. Use that position before trying to find another one. bool bNextBookmark = NearestBookmark( nNextPos, nAktPos, true ); - if( !bNextBookmark || nNextPos > aAttrIter->WhereNext() ) + if( nAktPos == aAttrIter->WhereNext() && ( !bNextBookmark || nNextPos > aAttrIter->WhereNext() ) ) aAttrIter->NextPos(); } |