Kaydet (Commit) dc92bac5 authored tarafından Miklos Vajna's avatar Miklos Vajna

fdo#58949 testcase

Change-Id: I584efc83ef1643a683757ac369cd140f52610293
üst 6238cfe2
......@@ -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 \
))
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment