summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-02-14 13:58:42 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-02-14 16:12:36 +0100
commit489e39d9c5a1304ff73b1d4655bff5edf963ad03 (patch)
tree830e4556f9c0446f74cc11f1c2b8ccb7c09db4a6 /sw
parent5154f0c463b6289dec8a28a844ad681957a2816c (diff)
ODT export: test that the PDF replacement image is a bitmap
Fails with commit 6657d52417295265367cf3ffe5832b60e3c38011 (vcl pdf import: use pdfium instead of draw_pdf_import, 2017-02-13) reverted. Change-Id: Ibf29df4fdf5b1bb2684b58564b6e1981463f12eb
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index caae889a30a2..43aee578696c 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -852,8 +852,26 @@ DECLARE_ODFEXPORT_TEST(testCellUserDefineAttr, "userdefattr-tablecell.odt")
DECLARE_ODFEXPORT_TEST(testEmbeddedPdf, "embedded-pdf.odt")
{
uno::Reference<drawing::XShape> xShape = getShape(1);
- // This failed, pdf+svm replacement graphics pair didn't survive an ODT roundtrip.
+ // This failed, pdf+png replacement graphics pair didn't survive an ODT roundtrip.
CPPUNIT_ASSERT(!getProperty<OUString>(xShape, "ReplacementGraphicURL").isEmpty());
+
+ if (mbExported)
+ {
+ uno::Sequence<uno::Any> aArgs(1);
+ aArgs[0] <<= maTempFile.GetURL();
+ uno::Reference<container::XNameAccess> xNameAccess(m_xSFactory->createInstanceWithArguments("com.sun.star.packages.zip.ZipFileAccess", aArgs), uno::UNO_QUERY);
+ bool bHasBitmap = false;
+ for (const auto& rElementName : xNameAccess->getElementNames())
+ {
+ if (rElementName.startsWith("Pictures") && rElementName.endsWith("png"))
+ {
+ bHasBitmap = true;
+ break;
+ }
+ }
+ // This failed, replacement was an svm file.
+ CPPUNIT_ASSERT(bHasBitmap);
+ }
}
#endif