[Libreoffice-commits] core.git: oox/source sd/qa

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 29 05:06:43 UTC 2020


 oox/source/core/xmlfilterbase.cxx   |    3 ++-
 sd/qa/unit/data/pptx/tdf119087.pptx |binary
 sd/qa/unit/export-tests-ooxml2.cxx  |    9 +++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 9be543a27ab18427a1c4e66a70cc49b0332b6aa1
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Apr 28 13:05:55 2020 +0200
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Wed Apr 29 07:06:08 2020 +0200

    tdf#119087 Don't treat OOXML strict namespace as custom XML
    
    Change-Id: I5037ac09f57c92e02e330cbc906da3afbe4c747c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93056
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index a8dfbb194843..e7a355e2c7dd 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -988,7 +988,8 @@ void XmlFilterBase::importCustomFragments(css::uno::Reference<css::embed::XStora
         }
 
         // Preserve non-standard (i.e. custom) entries.
-        if (!sType.match("http://schemas.openxmlformats.org"))
+        if (!sType.match("http://schemas.openxmlformats.org") // OOXML/ECMA Transitional
+            && !sType.match("http://purl.oclc.org")) // OOXML Strict
         {
             StreamDataSequence aDataSeq;
             if (importBinaryData(aDataSeq, sTarget))
diff --git a/sd/qa/unit/data/pptx/tdf119087.pptx b/sd/qa/unit/data/pptx/tdf119087.pptx
new file mode 100644
index 000000000000..d70bc8b0d4ff
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf119087.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index b2b4439d9924..6f77a2ecd849 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -191,6 +191,7 @@ public:
     void testTdf98603();
     void testTdf129372();
     void testShapeGlowEffect();
+    void testTdf119087();
     void testTdf131554();
     void testTdf132282();
 
@@ -301,6 +302,7 @@ public:
     CPPUNIT_TEST(testTdf98603);
     CPPUNIT_TEST(testTdf129372);
     CPPUNIT_TEST(testShapeGlowEffect);
+    CPPUNIT_TEST(testTdf119087);
     CPPUNIT_TEST(testTdf131554);
     CPPUNIT_TEST(testTdf132282);
 
@@ -2804,6 +2806,13 @@ void SdOOXMLExportTest2::testShapeGlowEffect()
     CPPUNIT_ASSERT_EQUAL(Color(0xFFC000), nColor);
 }
 
+void SdOOXMLExportTest2::testTdf119087()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf119087.pptx"), PPTX);
+    xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+    // This would fail both on export validation, and reloading the saved pptx file.
+}
+
 void SdOOXMLExportTest2::testTdf131554()
 {
     ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf131554.pptx"), PPTX);


More information about the Libreoffice-commits mailing list