diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-04-26 12:41:22 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-04-26 13:03:50 +0200 |
commit | dc92bac5df72ecca123472a5e945b1864a17f457 (patch) | |
tree | eefd0306775a70d93b7877c69883ce792478f452 /sw | |
parent | 6238cfe27f0a202f3fbf482cde2b0a3189adc86f (diff) |
fdo#58949 testcase
Change-Id: I584efc83ef1643a683757ac369cd140f52610293
Diffstat (limited to 'sw')
-rw-r--r-- | sw/CppunitTest_sw_odfexport.mk | 13 | ||||
-rw-r--r-- | sw/qa/extras/odfexport/data/fdo58949.docx | bin | 0 -> 26510 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 25 |
3 files changed, 34 insertions, 4 deletions
diff --git a/sw/CppunitTest_sw_odfexport.mk b/sw/CppunitTest_sw_odfexport.mk index aae298d54395..a484b9afcb4a 100644 --- a/sw/CppunitTest_sw_odfexport.mk +++ b/sw/CppunitTest_sw_odfexport.mk @@ -49,28 +49,33 @@ $(eval $(call gb_CppunitTest_use_api,sw_odfexport,\ $(eval $(call gb_CppunitTest_use_ure,sw_odfexport)) $(eval $(call gb_CppunitTest_use_components,sw_odfexport,\ - basic/util/sb \ + basic/util/sb \ comphelper/util/comphelp \ configmgr/source/configmgr \ + embeddedobj/util/embobj \ fileaccess/source/fileacc \ filter/source/config/cache/filterconfig1 \ framework/util/fwk \ i18npool/util/i18npool \ linguistic/source/lng \ - package/util/package2 \ + oox/util/oox \ package/source/xstor/xstor \ - sw/util/sw \ - sw/util/swd \ + package/util/package2 \ sax/source/expatwrap/expwrap \ + sax/source/fastparser/fastsax \ sfx2/util/sfx \ + starmath/util/sm \ svl/source/fsstor/fsstorage \ svtools/util/svt \ + sw/util/sw \ + sw/util/swd \ toolkit/util/tk \ ucb/source/core/ucb1 \ ucb/source/ucp/file/ucpfile1 \ unotools/util/utl \ unoxml/source/service/unoxml \ uui/util/uui \ + writerfilter/util/writerfilter \ $(if $(filter DESKTOP,$(BUILD_TYPE)),xmlhelp/util/ucpchelp1) \ xmloff/util/xo \ )) diff --git a/sw/qa/extras/odfexport/data/fdo58949.docx b/sw/qa/extras/odfexport/data/fdo58949.docx Binary files differnew file mode 100644 index 000000000000..d8f568b16cf2 --- /dev/null +++ b/sw/qa/extras/odfexport/data/fdo58949.docx 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(); |