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

Szymon Kłos szymon.klos at collabora.com
Mon Apr 30 10:36:51 UTC 2018


 sd/qa/unit/data/pptx/tdf84205.pptx       |binary
 sd/qa/unit/export-tests-ooxml2.cxx       |   14 ++++++++++++++
 sd/source/filter/eppt/pptx-epptooxml.cxx |    8 ++++++--
 3 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 40306c728ac4ba305106193637c547a699b67fdf
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Fri Mar 16 21:35:01 2018 +0100

    tdf#84205 If theme not found, use first
    
    Not a complete fix, workaround.
    
    Change-Id: If4d765eaeae3419f4f1deb4e1cfbe0113a71da94
    Reviewed-on: https://gerrit.libreoffice.org/51440
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/51581
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit ee47da7ae49be26dcb69ba1b720be93720b79959)
    Reviewed-on: https://gerrit.libreoffice.org/53654
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/qa/unit/data/pptx/tdf84205.pptx b/sd/qa/unit/data/pptx/tdf84205.pptx
new file mode 100644
index 000000000000..211cea6d0251
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf84205.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index a4f948ae887a..34cc04a10aab 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -110,6 +110,7 @@ public:
     void testGroupsPosition();
     void testGroupsRotatedPosition();
     void testAccentColor();
+    void testThemeColors();
     void testTdf114848();
     /// SmartArt animated elements
     void testTdf104792();
@@ -145,6 +146,7 @@ public:
     CPPUNIT_TEST(testGroupsPosition);
     CPPUNIT_TEST(testGroupsRotatedPosition);
     CPPUNIT_TEST(testAccentColor);
+    CPPUNIT_TEST(testThemeColors);
     CPPUNIT_TEST(testTdf114848);
     CPPUNIT_TEST(testTdf104792);
     CPPUNIT_TEST(testTdf90627);
@@ -900,6 +902,18 @@ void SdOOXMLExportTest2::testAccentColor()
     assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", "deb340");
 }
 
+void SdOOXMLExportTest2::testThemeColors()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf84205.pptx"), PPTX);
+    utl::TempFile tempFile;
+    xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+    xDocShRef->DoClose();
+
+    xmlDocPtr pXmlDocTheme2 = parseExport(tempFile, "ppt/theme/theme2.xml");
+    assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "44546a");
+    assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent3/a:srgbClr", "val", "a5a5a5");
+}
+
 void SdOOXMLExportTest2::testTdf114848()
 {
     ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf114848.pptx"), PPTX);
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 198ef6b5a8e7..72b40c3aac38 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2290,8 +2290,12 @@ void PowerPointExport::WriteTheme( sal_Int32 nThemeNum )
 
     if (!WriteColorSchemes(pFS, sThemePath))
     {
-        // color schemes are required - use default values
-        WriteDefaultColorSchemes(pFS);
+        // if style is not defined, try to use first one
+        if (!WriteColorSchemes(pFS, "ppt/theme/theme1.xml"))
+        {
+            // color schemes are required - use default values
+            WriteDefaultColorSchemes(pFS);
+        }
     }
 
     pFS->endElementNS(XML_a, XML_clrScheme);


More information about the Libreoffice-commits mailing list