fdo#53210 testcase
Change-Id: I23606a7601b71890acf7e260951e1bacc0fc2df9
This commit is contained in:
BIN
sw/qa/extras/odfimport/data/fdo53210.odt
Normal file
BIN
sw/qa/extras/odfimport/data/fdo53210.odt
Normal file
Binary file not shown.
Binary file not shown.
@@ -32,13 +32,13 @@ using rtl::OUString;
|
||||
class Test : public SwModelTestBase
|
||||
{
|
||||
public:
|
||||
void testHello();
|
||||
void testEmptySvgFamilyName();
|
||||
void testHideAllSections();
|
||||
|
||||
CPPUNIT_TEST_SUITE(Test);
|
||||
#if !defined(MACOSX) && !defined(WNT)
|
||||
CPPUNIT_TEST(testHello);
|
||||
CPPUNIT_TEST(testEmptySvgFamilyName);
|
||||
CPPUNIT_TEST(testHideAllSections);
|
||||
#endif
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
@@ -52,18 +52,25 @@ void Test::load(const OUString& rFilename)
|
||||
mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/odfimport/data/") + rFilename);
|
||||
}
|
||||
|
||||
void Test::testHello()
|
||||
{
|
||||
load("hello.odt");
|
||||
CPPUNIT_ASSERT_EQUAL(12, getLength());
|
||||
}
|
||||
|
||||
void Test::testEmptySvgFamilyName()
|
||||
{
|
||||
// .odt import did crash on the empty font list (which I think is valid according SVG spec)
|
||||
load( "empty-svg-family-name.odt" );
|
||||
}
|
||||
|
||||
void Test::testHideAllSections()
|
||||
{
|
||||
// This document has a section that is conditionally hidden, but has no empty paragraph after it.
|
||||
load("fdo53210.odt");
|
||||
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
|
||||
uno::Reference<container::XNameAccess> xMasters = xTextFieldsSupplier->getTextFieldMasters();
|
||||
// Set _CS_Allgemein to 0
|
||||
uno::Reference<beans::XPropertySet> xMaster(xMasters->getByName("com.sun.star.text.fieldmaster.User._CS_Allgemein"), uno::UNO_QUERY);
|
||||
xMaster->setPropertyValue("Content", uno::makeAny(OUString("0")));
|
||||
// This used to crash
|
||||
uno::Reference<util::XRefreshable>(xTextFieldsSupplier->getTextFields(), uno::UNO_QUERY)->refresh();
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
|
||||
|
||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||
|
Reference in New Issue
Block a user