diff --git a/sw/CppunitTest_sw_subsequent_rtfexport.mk b/sw/CppunitTest_sw_subsequent_rtfexport.mk index e55af88b6aa6..bdc47cd8b29f 100644 --- a/sw/CppunitTest_sw_subsequent_rtfexport.mk +++ b/sw/CppunitTest_sw_subsequent_rtfexport.mk @@ -69,7 +69,9 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_rtfexport,\ filter/source/config/cache/filterconfig1 \ framework/util/fwk \ i18npool/util/i18npool \ + package/source/xstor/xstor \ package/util/package2 \ + sax/source/expatwrap/expwrap \ sfx2/util/sfx \ svl/source/fsstor/fsstorage \ svtools/util/svt \ diff --git a/sw/qa/extras/rtfexport/data/fdo48335.odt b/sw/qa/extras/rtfexport/data/fdo48335.odt new file mode 100644 index 000000000000..4259f984ab76 Binary files /dev/null and b/sw/qa/extras/rtfexport/data/fdo48335.odt differ diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 428b7e158b6c..599b5b66a6c5 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -49,6 +49,7 @@ public: void testFdo44174(); void testFdo50087(); void testFdo50831(); + void testFdo48335(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -58,6 +59,7 @@ public: CPPUNIT_TEST(testFdo44174); CPPUNIT_TEST(testFdo50087); CPPUNIT_TEST(testFdo50831); + CPPUNIT_TEST(testFdo48335); #endif CPPUNIT_TEST_SUITE_END(); @@ -144,6 +146,34 @@ void Test::testFdo50831() CPPUNIT_ASSERT_EQUAL(10.f, fValue); } +void Test::testFdo48335() +{ + /* + * The problem was that we exported a fake pagebreak, make sure it's just a soft one now. + * + * oParas = ThisComponent.Text.createEnumeration + * oPara = oParas.nextElement + * oPara = oParas.nextElement + * oPara = oParas.nextElement + * oRuns = oPara.createEnumeration + * oRun = oRuns.nextElement + * xray oRun.TextPortionType 'was Text, should be SoftPageBreak + */ + roundtrip("fdo48335.odt"); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + for (int i = 0; i < 2; i++) + xParaEnum->nextElement(); + uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xRunEnum = xRunEnumAccess->createEnumeration(); + uno::Reference xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); + OUString aValue; + xPropertySet->getPropertyValue("TextPortionType") >>= aValue; + CPPUNIT_ASSERT_EQUAL(OUString("SoftPageBreak"), aValue); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT();