sd/qa/unit/data/pptx/tdf111518.pptx |binary sd/qa/unit/export-tests-ooxml2.cxx | 16 ++++++ sd/source/filter/eppt/pptx-epptooxml.cxx | 71 +++++++++++++++++++++++-------- 3 files changed, 70 insertions(+), 17 deletions(-)
New commits: commit 981f3a2c7fec50e1d80b62b669caecc14ad231b6 Author: Jan Holesovsky <ke...@collabora.com> Date: Wed Aug 9 14:52:17 2017 +0200 tdf#111518 pptx: Add support for export of p:animMotion. Contains also the following patches: tdf#111518 pptx: Unit test. related tdf#111518 pptx: These attributes are not supposed to be here. Change-Id: Idd5692c803b1e8d434abc0154419a341934d0753 Reviewed-on: https://gerrit.libreoffice.org/40972 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sd/qa/unit/data/pptx/tdf111518.pptx b/sd/qa/unit/data/pptx/tdf111518.pptx new file mode 100644 index 000000000000..a0d77617f67a Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf111518.pptx differ diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index e2130861e515..817cad398a13 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -104,6 +104,7 @@ public: void testTdf92076(); void testTdf59046(); void testTdf105739(); + void testTdf111518(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -131,6 +132,7 @@ public: CPPUNIT_TEST(testTdf92076); CPPUNIT_TEST(testTdf59046); CPPUNIT_TEST(testTdf105739); + CPPUNIT_TEST(testTdf111518); CPPUNIT_TEST_SUITE_END(); @@ -790,6 +792,20 @@ void SdOOXMLExportTest2::testTdf105739() xShell->DoClose(); } +void SdOOXMLExportTest2::testTdf111518() +{ + sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf111518.pptx"), PPTX); + utl::TempFile tempFile; + tempFile.EnableKillingFile(false); + xShell = saveAndReload(xShell.get(), PPTX, &tempFile); + xShell->DoClose(); + + xmlDocPtr pXmlDocRels = parseExport(tempFile, "ppt/slides/slide1.xml"); + assertXPath(pXmlDocRels, + "/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:animMotion", + "path", + "M -3.54167E-6 -4.81481E-6 L 0.39037 -0.00069"); +} CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 1a54791bb5b7..ac11c3798c0c 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -46,7 +46,7 @@ #include <com/sun/star/animations/EventTrigger.hpp> #include <com/sun/star/animations/Timing.hpp> #include <com/sun/star/animations/ValuePair.hpp> -#include <com/sun/star/animations/XAnimateSet.hpp> +#include <com/sun/star/animations/XAnimateMotion.hpp> #include <com/sun/star/animations/XAnimationNode.hpp> #include <com/sun/star/animations/XAnimationNodeSupplier.hpp> #include <com/sun/star/animations/XTransitionFilter.hpp> @@ -887,18 +887,34 @@ void PowerPointExport::WriteAnimationAttributeName( const FSHelperPtr& pFS, cons SAL_INFO("sd.eppt", "write attribute name: " << USS(rAttributeName)); - const char* sAttributeName = nullptr; - if ( rAttributeName == "Visibility" ) { - sAttributeName = "style.visibility"; - } else if ( rAttributeName == "X" ) { - sAttributeName = "ppt_x"; - } else if ( rAttributeName == "Y" ) { - sAttributeName = "ppt_y"; + if (rAttributeName == "Visibility") + { + pFS->startElementNS(XML_p, XML_attrName, FSEND); + pFS->writeEscaped("style.visibility"); + pFS->endElementNS(XML_p, XML_attrName); + } + else if (rAttributeName == "X") + { + pFS->startElementNS(XML_p, XML_attrName, FSEND); + pFS->writeEscaped("ppt_x"); + pFS->endElementNS(XML_p, XML_attrName); + } + else if (rAttributeName == "Y") + { + pFS->startElementNS(XML_p, XML_attrName, FSEND); + pFS->writeEscaped("ppt_y"); + pFS->endElementNS(XML_p, XML_attrName); } + else if (rAttributeName == "X;Y") + { + pFS->startElementNS(XML_p, XML_attrName, FSEND); + pFS->writeEscaped("ppt_x"); + pFS->endElementNS(XML_p, XML_attrName); - pFS->startElementNS( XML_p, XML_attrName, FSEND ); - pFS->writeEscaped( sAttributeName ); - pFS->endElementNS( XML_p, XML_attrName ); + pFS->startElementNS(XML_p, XML_attrName, FSEND); + pFS->writeEscaped("ppt_y"); + pFS->endElementNS(XML_p, XML_attrName); + } pFS->endElementNS( XML_p, XML_attrNameLst ); } @@ -960,12 +976,29 @@ void PowerPointExport::WriteAnimationNodeAnimate( const FSHelperPtr& pFS, const } } - pFS->startElementNS( XML_p, nXmlNodeType, - XML_calcmode, pCalcMode, - XML_valueType, pValueType, - FSEND ); - WriteAnimationNodeAnimateInside( pFS, rXNode, bMainSeqChild, bSimple ); - pFS->endElementNS( XML_p, nXmlNodeType ); + OUString aPath; + if (nXmlNodeType == XML_animMotion) + { + Reference<XAnimateMotion> rMotion(rXNode, UNO_QUERY); + if (rMotion.is()) + rMotion->getPath() >>= aPath; + } + + if (aPath.isEmpty()) + { + pFS->startElementNS(XML_p, nXmlNodeType, + XML_calcmode, pCalcMode, + XML_valueType, pValueType, + FSEND); + } + else + { + pFS->startElementNS(XML_p, nXmlNodeType, + XML_path, OUStringToOString(aPath, RTL_TEXTENCODING_UTF8), + FSEND); + } + WriteAnimationNodeAnimateInside(pFS, rXNode, bMainSeqChild, bSimple); + pFS->endElementNS(XML_p, nXmlNodeType); } void PowerPointExport::WriteAnimationNodeAnimateInside( const FSHelperPtr& pFS, const Reference< XAnimationNode >& rXNode, bool bMainSeqChild, bool bSimple ) @@ -1350,6 +1383,10 @@ void PowerPointExport::WriteAnimationNode( const FSHelperPtr& pFS, const Referen xmlNodeType = XML_anim; pMethod = &PowerPointExport::WriteAnimationNodeAnimate; break; + case AnimationNodeType::ANIMATEMOTION: + xmlNodeType = XML_animMotion; + pMethod = &PowerPointExport::WriteAnimationNodeAnimate; + break; case AnimationNodeType::SET: xmlNodeType = XML_set; pMethod = &PowerPointExport::WriteAnimationNodeAnimate; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits