summaryrefslogtreecommitdiff
path: root/sw/qa/extras/odfexport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-04-26 12:41:22 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-04-26 13:03:50 +0200
commitdc92bac5df72ecca123472a5e945b1864a17f457 (patch)
treeeefd0306775a70d93b7877c69883ce792478f452 /sw/qa/extras/odfexport
parent6238cfe27f0a202f3fbf482cde2b0a3189adc86f (diff)
fdo#58949 testcase
Change-Id: I584efc83ef1643a683757ac369cd140f52610293
Diffstat (limited to 'sw/qa/extras/odfexport')
-rw-r--r--sw/qa/extras/odfexport/data/fdo58949.docxbin0 -> 26510 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx25
2 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/fdo58949.docx b/sw/qa/extras/odfexport/data/fdo58949.docx
new file mode 100644
index 000000000000..d8f568b16cf2
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/fdo58949.docx
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 81fcaecbc901..5c4c4082fc9f 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -17,6 +17,7 @@ public:
void testFirstHeaderFooter();
void testTextframeGradient();
void testFdo60769();
+ void testFdo58949();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -35,6 +36,7 @@ void Test::run()
{"first-header-footer.odt", &Test::testFirstHeaderFooter},
{"textframe-gradient.odt", &Test::testTextframeGradient},
{"fdo60769.odt", &Test::testFdo60769},
+ {"fdo58949.docx", &Test::testFdo58949},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -142,6 +144,29 @@ void Test::testFdo60769()
}
}
+void Test::testFdo58949()
+{
+ /*
+ * The problem was that the exporter didn't insert "Obj102" to the
+ * resulting zip file. No idea how to check for "broken" (missing OLE data
+ * and replacement image) OLE objects using UNO, so we'll check the zip file directly.
+ */
+
+ // Create the zip file.
+ utl::TempFile aTempFile;
+ aTempFile.EnableKillingFile();
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aFilterArgs(1);
+ aFilterArgs[0].Name = "FilterName";
+ aFilterArgs[0].Value <<= OUString("writer8");
+ xStorable->storeToURL(aTempFile.GetURL(), aFilterArgs);
+
+ uno::Sequence<uno::Any> aArgs(1);
+ aArgs[0] <<= OUString(aTempFile.GetURL());
+ uno::Reference<container::XNameAccess> xNameAccess(m_xSFactory->createInstanceWithArguments("com.sun.star.packages.zip.ZipFileAccess", aArgs), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("Obj102")));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();