diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2018-03-16 21:35:01 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-27 15:09:02 +0200 |
commit | cbc7ee4a2d22022f74f463176379929a395a4608 (patch) | |
tree | 8081e7b35a124a231b5cbfbc58be9a3ee478eed2 /sd | |
parent | 5c0ad243ab5275df8e68cfdc3ab72e1c18ab9ffb (diff) |
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@libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/51458
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 586d56208861135e6548a4d73961e64cd3df5d68)
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf84205.pptx | bin | 0 -> 45600 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 14 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptooxml.cxx | 8 |
3 files changed, 20 insertions, 2 deletions
diff --git a/sd/qa/unit/data/pptx/tdf84205.pptx b/sd/qa/unit/data/pptx/tdf84205.pptx Binary files differnew file mode 100644 index 000000000000..211cea6d0251 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf84205.pptx diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 288b0fe192bd..5315f3558001 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -124,6 +124,7 @@ public: void testGroupsPosition(); void testGroupsRotatedPosition(); void testAccentColor(); + void testThemeColors(); void testTdf114848(); void testFontScale(); void testTdf115394(); @@ -178,6 +179,7 @@ public: CPPUNIT_TEST(testGroupsPosition); CPPUNIT_TEST(testGroupsRotatedPosition); CPPUNIT_TEST(testAccentColor); + CPPUNIT_TEST(testThemeColors); CPPUNIT_TEST(testTdf114848); CPPUNIT_TEST(testFontScale); CPPUNIT_TEST(testTdf115394); @@ -1119,6 +1121,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 9a8c67e65c22..bc6d9623f945 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -2652,8 +2652,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); |