Kaydet (Commit) e3aca977 authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

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
üst 77e71450
...@@ -42,11 +42,13 @@ class Test : public SwModelTestBase ...@@ -42,11 +42,13 @@ class Test : public SwModelTestBase
public: public:
void testN325936(); void testN325936();
void testFdo45724(); void testFdo45724();
void testFdo46020();
CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT) #if !defined(MACOSX) && !defined(WNT)
CPPUNIT_TEST(testN325936); CPPUNIT_TEST(testN325936);
CPPUNIT_TEST(testFdo45724); CPPUNIT_TEST(testFdo45724);
CPPUNIT_TEST(testFdo46020);
#endif #endif
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
...@@ -95,6 +97,15 @@ void Test::testFdo45724() ...@@ -95,6 +97,15 @@ void Test::testFdo45724()
CPPUNIT_ASSERT_EQUAL(OUString("xxx"), xComponent->getCurrentValue().get<OUString>()); 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_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -1622,8 +1622,10 @@ void MSWordExportBase::UpdatePosition( SwWW8AttrIter* aAttrIter, xub_StrLen nAkt ...@@ -1622,8 +1622,10 @@ void MSWordExportBase::UpdatePosition( SwWW8AttrIter* aAttrIter, xub_StrLen nAkt
xub_StrLen nNextPos; xub_StrLen nNextPos;
// go to next attribute if no bookmark is found or if the bookmark is behind the next attribute position // 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 ); bool bNextBookmark = NearestBookmark( nNextPos, nAktPos, true );
if( !bNextBookmark || nNextPos > aAttrIter->WhereNext() ) if( nAktPos == aAttrIter->WhereNext() && ( !bNextBookmark || nNextPos > aAttrIter->WhereNext() ) )
aAttrIter->NextPos(); aAttrIter->NextPos();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment