[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - sd/qa xmloff/source

Serge Krot Serge.Krot at cib.de
Wed Mar 21 07:45:51 UTC 2018


 sd/qa/unit/data/odp/tdf115005.odp          |binary
 sd/qa/unit/export-tests-ooxml2.cxx         |   22 ++++++++++++++++++++++
 xmloff/source/core/xmlmultiimagehelper.cxx |    4 ++++
 3 files changed, 26 insertions(+)

New commits:
commit 070f3db51da48c70cde12050c18fb03de2192c0f
Author: Serge Krot <Serge.Krot at cib.de>
Date:   Mon Mar 19 22:19:38 2018 +0100

    tdf#115005 Do not remove original vector images from slides
    
    During calculation of the quality index of the image, we should
    take into account also SVM vector image type.
    Its mime type is image/x-vclgraphic.
    
    Reviewed-on: https://gerrit.libreoffice.org/51599
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    
    Conflicts:
            sd/qa/unit/export-tests-ooxml2.cxx
            xmloff/source/core/xmlmultiimagehelper.cxx
    
    Change-Id: I7c723e99995f73258bb59d976a6c7670c51f7a25
    Reviewed-on: https://gerrit.libreoffice.org/51655
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/sd/qa/unit/data/odp/tdf115005.odp b/sd/qa/unit/data/odp/tdf115005.odp
new file mode 100755
index 000000000000..764a862feda7
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf115005.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 0c8540dc55d0..4f6f86566530 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -124,6 +124,7 @@ public:
     void testGroupsRotatedPosition();
     void testAccentColor();
     void testTdf114848();
+    void testTdf115005();
     /// SmartArt animated elements
     void testTdf104792();
     void testTdf90627();
@@ -178,6 +179,7 @@ public:
     CPPUNIT_TEST(testGroupsRotatedPosition);
     CPPUNIT_TEST(testAccentColor);
     CPPUNIT_TEST(testTdf114848);
+    CPPUNIT_TEST(testTdf115005);
     CPPUNIT_TEST(testTdf104792);
     CPPUNIT_TEST(testTdf90627);
     CPPUNIT_TEST(testTdf104786);
@@ -1324,6 +1326,26 @@ void SdOOXMLExportTest2::testTdf114848()
     assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "1f497d");
 }
 
+void SdOOXMLExportTest2::testTdf115005()
+{
+    sd::DrawDocShellRef xDocShRefOriginal = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf115005.odp"), ODP);
+    utl::TempFile tempFile;
+    sd::DrawDocShellRef xDocShRefResaved = saveAndReload(xDocShRefOriginal.get(), ODP, &tempFile);
+
+    // additional checks of the output file
+    uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), tempFile.GetURL());
+
+    // check that the document contains original vector images
+    const uno::Sequence<OUString> names = xNameAccess->getElementNames();
+    int nSVMFiles = 0;
+    for (int i=0; i<names.getLength(); i++)
+    {
+        if(names[i].endsWith(".svm"))
+            nSVMFiles++;
+    }
+    CPPUNIT_ASSERT_EQUAL(3, nSVMFiles);
+}
+
 void SdOOXMLExportTest2::testTdf104792()
 {
     ::sd::DrawDocShellRef xDocShRef = loadURL(
diff --git a/xmloff/source/core/xmlmultiimagehelper.cxx b/xmloff/source/core/xmlmultiimagehelper.cxx
index 3d7725a3b24f..c0e437c1f370 100644
--- a/xmloff/source/core/xmlmultiimagehelper.cxx
+++ b/xmloff/source/core/xmlmultiimagehelper.cxx
@@ -64,6 +64,10 @@ namespace
         }
 
         // vector formats, prefer always
+        if(sMimeType == "image/x-vclgraphic") // MIMETYPE_VCLGRAPHIC
+        {
+            return 990;
+        }
         if(sMimeType == "image/x-svm")
         {
             return 1000;


More information about the Libreoffice-commits mailing list