sd/qa/unit/data/pptx/tdf104789.pptx |binary sd/qa/unit/export-tests-ooxml2.cxx | 15 +++++++ sd/source/filter/eppt/pptx-epptooxml.cxx | 61 +++++++++++++------------------ 3 files changed, 41 insertions(+), 35 deletions(-)
New commits: commit 63f6174b67a7e731389d477e0856b64478e6511d Author: Szymon Kłos <szymon.k...@collabora.com> Date: Thu Mar 15 19:23:20 2018 +0100 tdf#104789 Export opacity attribute name Change-Id: Id47ab6b3cb20fbcebb2d7fa589f3b0d7552e2cce Reviewed-on: https://gerrit.libreoffice.org/51369 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/51457 Reviewed-by: Andras Timar <andras.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@collabora.com> diff --git a/sd/qa/unit/data/pptx/tdf104789.pptx b/sd/qa/unit/data/pptx/tdf104789.pptx new file mode 100644 index 000000000000..d5ead6a931a7 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf104789.pptx differ diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 16c0e55c43be..288b0fe192bd 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -132,6 +132,7 @@ public: void testTdf104792(); void testTdf90627(); void testTdf104786(); + void testTdf104789(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -184,6 +185,7 @@ public: CPPUNIT_TEST(testTdf104792); CPPUNIT_TEST(testTdf90627); CPPUNIT_TEST(testTdf104786); + CPPUNIT_TEST(testTdf104789); CPPUNIT_TEST_SUITE_END(); @@ -1245,6 +1247,19 @@ void SdOOXMLExportTest2::testTdf104786() xDocShRef->DoClose(); } +void SdOOXMLExportTest2::testTdf104789() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104789.pptx"), PPTX); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml"); + OUString sAttributeName = getXPathContent(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:attrNameLst/p:attrName"); + CPPUNIT_ASSERT_EQUAL(OUString("style.opacity"), sAttributeName); + + xDocShRef->DoClose(); +} + 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 f44121b1c967..9a8c67e65c22 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -991,23 +991,19 @@ void PowerPointExport::WriteAnimationAttributeName( const FSHelperPtr& pFS, cons SAL_INFO("sd.eppt", "write attribute name: " << USS(rAttributeName)); + const char* pAttribute = nullptr; + if (rAttributeName == "Visibility") { - pFS->startElementNS(XML_p, XML_attrName, FSEND); - pFS->writeEscaped("style.visibility"); - pFS->endElementNS(XML_p, XML_attrName); + pAttribute = "style.visibility"; } else if (rAttributeName == "X") { - pFS->startElementNS(XML_p, XML_attrName, FSEND); - pFS->writeEscaped("ppt_x"); - pFS->endElementNS(XML_p, XML_attrName); + pAttribute = "ppt_x"; } else if (rAttributeName == "Y") { - pFS->startElementNS(XML_p, XML_attrName, FSEND); - pFS->writeEscaped("ppt_y"); - pFS->endElementNS(XML_p, XML_attrName); + pAttribute = "ppt_y"; } else if (rAttributeName == "X;Y") { @@ -1021,58 +1017,53 @@ void PowerPointExport::WriteAnimationAttributeName( const FSHelperPtr& pFS, cons } else if (rAttributeName == "Width") { - pFS->startElementNS(XML_p, XML_attrName, FSEND); - pFS->writeEscaped("ppt_w"); - pFS->endElementNS(XML_p, XML_attrName); + pAttribute = "ppt_w"; } else if (rAttributeName == "Height") { - pFS->startElementNS(XML_p, XML_attrName, FSEND); - pFS->writeEscaped("ppt_h"); - pFS->endElementNS(XML_p, XML_attrName); + pAttribute = "ppt_h"; } else if (rAttributeName == "Rotate") { - pFS->startElementNS(XML_p, XML_attrName, FSEND); - pFS->writeEscaped("r"); - pFS->endElementNS(XML_p, XML_attrName); + pAttribute = "r"; } else if (rAttributeName == "FillStyle") { - pFS->startElementNS(XML_p, XML_attrName, FSEND); - pFS->writeEscaped("fill.type"); - pFS->endElementNS(XML_p, XML_attrName); + pAttribute = "fill.type"; } else if (rAttributeName == "FillOn") { - pFS->startElementNS(XML_p, XML_attrName, FSEND); - pFS->writeEscaped("fill.on"); - pFS->endElementNS(XML_p, XML_attrName); + pAttribute = "fill.on"; } else if (rAttributeName == "FillColor") { - pFS->startElementNS(XML_p, XML_attrName, FSEND); - pFS->writeEscaped("fillcolor"); - pFS->endElementNS(XML_p, XML_attrName); + pAttribute = "fillcolor"; } else if (rAttributeName == "CharColor") { - pFS->startElementNS(XML_p, XML_attrName, FSEND); - pFS->writeEscaped("style.color"); - pFS->endElementNS(XML_p, XML_attrName); + pAttribute = "style.color"; } - if (rAttributeName == "SkewX") + else if (rAttributeName == "Opacity") { - pFS->startElementNS(XML_p, XML_attrName, FSEND); - pFS->writeEscaped("xshear"); - pFS->endElementNS(XML_p, XML_attrName); + pAttribute = "style.opacity"; + } + else if (rAttributeName == "SkewX") + { + pAttribute = "xshear"; } else { SAL_INFO("sd.eppt", "unhandled animation attribute name: " << rAttributeName); } - pFS->endElementNS( XML_p, XML_attrNameLst ); + if (pAttribute) + { + pFS->startElementNS(XML_p, XML_attrName, FSEND); + pFS->writeEscaped(pAttribute); + pFS->endElementNS(XML_p, XML_attrName); + } + + pFS->endElementNS(XML_p, XML_attrNameLst); } void PowerPointExport::WriteAnimationTarget( const FSHelperPtr& pFS, const Any& rTarget ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits