summaryrefslogtreecommitdiff
path: root/sw/qa/extras/odfimport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-08-13 10:59:26 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-08-13 11:04:01 +0200
commit10e02dfdffb5ef3a02a40b52c6cda176f7f4447c (patch)
tree55ad9527c6569075f7e5d95001e4604da33f3118 /sw/qa/extras/odfimport
parent7b87ccf916547b4d59d0e892519600a2bf53b867 (diff)
fdo#53210 testcase
Change-Id: I23606a7601b71890acf7e260951e1bacc0fc2df9
Diffstat (limited to 'sw/qa/extras/odfimport')
-rw-r--r--sw/qa/extras/odfimport/data/fdo53210.odtbin0 -> 11355 bytes
-rw-r--r--sw/qa/extras/odfimport/data/hello.odtbin8159 -> 0 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx23
3 files changed, 15 insertions, 8 deletions
diff --git a/sw/qa/extras/odfimport/data/fdo53210.odt b/sw/qa/extras/odfimport/data/fdo53210.odt
new file mode 100644
index 000000000000..cfa504409391
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/fdo53210.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/data/hello.odt b/sw/qa/extras/odfimport/data/hello.odt
deleted file mode 100644
index 23ce6a4db9af..000000000000
--- a/sw/qa/extras/odfimport/data/hello.odt
+++ /dev/null
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index d4738932d8e2..ef51e318ceba 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -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();