summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2018-01-05 18:12:08 +0100
committerMichael Stahl <mstahl@redhat.com>2018-01-09 20:50:58 +0100
commitf890d79bb2bc82cd05b80eeb83b22971ed618817 (patch)
tree7672d37804aad0ae2bc35b2fdbbbb12465c3ba72
parent3b81d36d58172695021e3109d2490b937c3908b3 (diff)
tdf#114848 Don't save empty themes
Change-Id: I7136f5c0bc884a2f9ea945b4e0bc093a5ef2d8df Reviewed-on: https://gerrit.libreoffice.org/47481 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/47617 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sd/qa/unit/data/pptx/tdf114848.pptxbin0 -> 117854 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx15
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx3
3 files changed, 18 insertions, 0 deletions
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
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf114848.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 9722d2de9b36..c998c45c6709 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 testTdf114848();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -141,6 +142,7 @@ public:
CPPUNIT_TEST(testGroupsPosition);
CPPUNIT_TEST(testGroupsRotatedPosition);
CPPUNIT_TEST(testAccentColor);
+ CPPUNIT_TEST(testTdf114848);
CPPUNIT_TEST_SUITE_END();
@@ -893,6 +895,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 a49fa7dc4948..b74e449083a7 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2222,6 +2222,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++)
{