[Libreoffice-commits] core.git: sw/qa

Miklos Vajna vmiklos at collabora.co.uk
Tue Feb 14 15:13:01 UTC 2017


 sw/qa/extras/odfexport/odfexport.cxx |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 489e39d9c5a1304ff73b1d4655bff5edf963ad03
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Feb 14 13:58:42 2017 +0100

    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

diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index caae889..43aee57 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
 


More information about the Libreoffice-commits mailing list