From e3aca9772f4e1f9fcabecbe5bf22123259b3143a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Thu, 2 Aug 2012 14:11:50 +0200 Subject: [PATCH] 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 --- sw/qa/extras/ww8export/data/fdo46020.odt | Bin 0 -> 12611 bytes sw/qa/extras/ww8export/ww8export.cxx | 11 +++++++++++ sw/source/filter/ww8/wrtw8nds.cxx | 4 +++- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 sw/qa/extras/ww8export/data/fdo46020.odt diff --git a/sw/qa/extras/ww8export/data/fdo46020.odt b/sw/qa/extras/ww8export/data/fdo46020.odt new file mode 100644 index 0000000000000000000000000000000000000000..478c931b22d09a83019395913e3b5f10b0e39cbc GIT binary patch literal 12611 zcmeHtbzD?i+xDQ8gdm}GN=Oae-CY8LG{ex$5JR^}mr5fg-Q7qCN-5F}qI7rXH|X)` zIqx~o`+Wa?zi;syX79DG>%Q-`_S*N}bFHPSa2pX106+x*7L;#^8Fa8?&;bB|n-9DS zU~6d$hPl~+jqU7gEJ4OFODF{B3^8Sa8arA#vOw*?5K}0~$rcQOvB1EtFx9^pOMHOf z&5Hy8+cTx_&sz>h$YO@*oGP805*m}9fY;DwFQCy*zyDa9S6VQ%<#~_!tAVU zY|N~j%xpXwY+U@DeEe)2f3W|GyNT>4ft{I^mzkAagN==!i;bV1^?OL)8-I8Jo5CZ4 zm@|XiKsI1UVRm+&KTQ6u;jd^@Cx`FzT3D5nOHzYZmXk+`gZJ^@n16zPaLvIGFq{SN zwW6ho16bwzLxU_eezb`vfhUS=~B5QiCv zi`m%3#01R6!_33U24XkoLCN^MZ5Y!0*6QY9OqCc*!t+Dz4sDzr_ zbnWj@yWfy(f6(oW9gNK#jO{Fbg4zFQaDh6Q{;cEtqYh*NM}uHsho21`Kcj%ar;&?= zB@F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Qp_6sbKd6o(v7m&jb!m5(T8qcc=dPZdyBNu=$k@mnZ?631Tn?b3m-gojxJ&rkjf1W@t}yF60_Bi^FqOYtZyEn6*Kgn&{`O6 z$uTAQtGHs(z*k?qzRj6$B!Cat21rDH^xG7|B-$QXZ~A2B$yB<%GT6D%8id_~Hc4^j zHPB6hOJ5(>Mg=wKl+7m}Ry9QPL`7IWCZL?tqAz|Y&h3TGAFy+LaMfA80|B*(-BJl$ z=WFXB&iv9gh&~l!=+k=jeFKHz2VZs)xH2mYUxZUtK)8hm`1kG0@G<_a{M^j^ch=wc zDgUAyN*PWbpa+Z>y0%t^5r9cWL{tfiJ-)<)2d#z83J4`P2U|e*nOZ3jM24KlqhD7M zUoX=y-VZ7K*SYRL*!dsA_`e(bYfuUQVC;9H{J*u+{||P47ta6P&W&{btDwS_?Z1o7 ze-+aI-O`OH{;S+9P5<4}FJb+^wc`2@R(=WX|E-mhf3WgPc>i}RH`4pBvhWX9{#A(o zVf5#G{ypD*U-bIZ>LbG6h54Ve`6uu9L~@gje-#79f62|N3P{K|uzT=7J9z$SV!Ao| EKLOW#l>h($ literal 0 HcmV?d00001 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()); } +void Test::testFdo46020() +{ + // The footnote in that document wasn't exported, check that it is actually exported + roundtrip("fdo46020.odt"); + uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference 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(); }