[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sd/qa sd/source

Szymon Kłos szymon.klos at collabora.com
Wed Jan 10 16:14:11 UTC 2018


 sd/qa/unit/data/pptx/tdf114848.pptx      |binary
 sd/qa/unit/export-tests-ooxml2.cxx       |   15 +++++++++++++++
 sd/source/filter/eppt/pptx-epptooxml.cxx |    3 +++
 3 files changed, 18 insertions(+)

New commits:
commit 2b48e006b8f52eaf44e1b1c1ef3dbb898c69a5fc
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Fri Jan 5 18:12:08 2018 +0100

    tdf#114848 Don't save empty themes
    
    Change-Id: I7136f5c0bc884a2f9ea945b4e0bc093a5ef2d8df
    Reviewed-on: https://gerrit.libreoffice.org/47481
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/47579
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sd/qa/unit/data/pptx/tdf114848.pptx b/sd/qa/unit/data/pptx/tdf114848.pptx
new file mode 100644
index 000000000000..5b8b6c3fad7f
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf114848.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 9bad50abbdab..f678ab64f940 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -112,6 +112,7 @@ public:
     void testGroupsPosition();
     void testGroupsRotatedPosition();
     void testAccentColor();
+    void testTdf114848();
 
     CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -145,6 +146,7 @@ public:
     CPPUNIT_TEST(testGroupsPosition);
     CPPUNIT_TEST(testGroupsRotatedPosition);
     CPPUNIT_TEST(testAccentColor);
+    CPPUNIT_TEST(testTdf114848);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -889,6 +891,19 @@ void SdOOXMLExportTest2::testAccentColor()
     assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", "deb340");
 }
 
+void SdOOXMLExportTest2::testTdf114848()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf114848.pptx"), PPTX);
+    utl::TempFile tempFile;
+    xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+    xDocShRef->DoClose();
+
+    xmlDocPtr pXmlDocTheme1 = parseExport(tempFile, "ppt/theme/theme1.xml");
+    assertXPath(pXmlDocTheme1, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "1f497d");
+    xmlDocPtr pXmlDocTheme2 = parseExport(tempFile, "ppt/theme/theme2.xml");
+    assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "1f497d");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 0ac4d87f6dbf..0e6793deb9cc 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2224,6 +2224,9 @@ bool PowerPointExport::WriteColorSchemes(FSHelperPtr pFS, const OUString& rTheme
 
                 aGrabBag.getValue(rThemePath) >>= aCurrentTheme;
 
+                if (!aCurrentTheme.getLength())
+                    return false;
+
                 // Order is important
                 for (int nId = PredefinedClrSchemeId::dk2; nId != PredefinedClrSchemeId::Count; nId++)
                 {


More information about the Libreoffice-commits mailing list