summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-08-09 14:52:17 +0200
committerJan Holesovsky <kendy@collabora.com>2017-08-09 16:02:20 +0200
commitaf4602e558431bcdf51d0f15e7e400adcd142738 (patch)
tree5fc2278e482858c1ce1b78d7096915901568f91c
parent724306074951449ce4cb074b21cc329f1fb895c6 (diff)
tdf#111518 pptx: Add support for export of p:animMotion.
Change-Id: Idd5692c803b1e8d434abc0154419a341934d0753
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx57
1 files changed, 46 insertions, 11 deletions
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index ae55007e4cfd..8b3acbe9e642 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -49,6 +49,7 @@
#include <com/sun/star/animations/TransitionType.hpp>
#include <com/sun/star/animations/TransitionSubType.hpp>
#include <com/sun/star/animations/ValuePair.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>
@@ -900,23 +901,34 @@ void PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const
SAL_INFO("sd.eppt", "write attribute name: " << USS(rAttributeName));
- const char* sAttributeName = nullptr;
if (rAttributeName == "Visibility")
{
- sAttributeName = "style.visibility";
+ pFS->startElementNS(XML_p, XML_attrName, FSEND);
+ pFS->writeEscaped("style.visibility");
+ pFS->endElementNS(XML_p, XML_attrName);
}
else if (rAttributeName == "X")
{
- sAttributeName = "ppt_x";
+ pFS->startElementNS(XML_p, XML_attrName, FSEND);
+ pFS->writeEscaped("ppt_x");
+ pFS->endElementNS(XML_p, XML_attrName);
}
else if (rAttributeName == "Y")
{
- sAttributeName = "ppt_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);
}
@@ -983,10 +995,29 @@ void PowerPointExport::WriteAnimationNodeAnimate(const FSHelperPtr& pFS, const R
}
}
- pFS->startElementNS(XML_p, nXmlNodeType,
- XML_calcmode, pCalcMode,
- XML_valueType, pValueType,
- FSEND);
+ 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_calcmode, pCalcMode,
+ XML_valueType, pValueType,
+ XML_path, OUStringToOString(aPath, RTL_TEXTENCODING_UTF8),
+ FSEND);
+ }
WriteAnimationNodeAnimateInside(pFS, rXNode, bMainSeqChild, bSimple);
pFS->endElementNS(XML_p, nXmlNodeType);
}
@@ -1409,6 +1440,10 @@ void PowerPointExport::WriteAnimationNode(const FSHelperPtr& pFS, const Referenc
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;