Kaydet (Commit) 9a9b81c7 authored tarafından Mark Hung's avatar Mark Hung
üst 0fa2a778
......@@ -425,9 +425,10 @@ bool isValidTarget(const Any& rTarget)
return false;
}
/// convert animation node type to corresponding ooxml element.
sal_Int32 convertNodeType(sal_Int16 nType)
/// extract ooxml node type from a XAnimationNode.
sal_Int32 extractNodeType(const Reference<XAnimationNode>& rXNode)
{
sal_Int16 nType = rXNode->getType();
sal_Int32 xmlNodeType = -1;
switch (nType)
{
......@@ -445,9 +446,17 @@ sal_Int32 convertNodeType(sal_Int16 nType)
xmlNodeType = XML_animMotion;
break;
case AnimationNodeType::ANIMATETRANSFORM:
// could be XML_animScale or XML_animRot based on xTransform->getTransformType()
xmlNodeType = -1;
{
Reference<XAnimateTransform> xTransform(rXNode, UNO_QUERY);
if (xTransform.is())
{
if (xTransform->getTransformType() == AnimationTransformType::SCALE)
xmlNodeType = XML_animScale;
else if (xTransform->getTransformType() == AnimationTransformType::ROTATE)
xmlNodeType = XML_animRot;
}
break;
}
case AnimationNodeType::ANIMATECOLOR:
xmlNodeType = XML_animClr;
break;
......@@ -1136,7 +1145,10 @@ void PPTXAnimationExport::WriteAnimationNode(const NodeContextPtr& pContext)
const Reference<XAnimationNode>& rXNode = getCurrentNode();
SAL_INFO("sd.eppt", "export node type: " << rXNode->getType());
sal_Int32 xmlNodeType = convertNodeType(rXNode->getType());
sal_Int32 xmlNodeType = extractNodeType(rXNode);
if (xmlNodeType == -1)
return;
switch (rXNode->getType())
{
......@@ -1150,22 +1162,6 @@ void PPTXAnimationExport::WriteAnimationNode(const NodeContextPtr& pContext)
WriteAnimationNodeSeq();
break;
case AnimationNodeType::ANIMATETRANSFORM:
{
Reference<XAnimateTransform> xTransform(rXNode, UNO_QUERY);
if (xTransform.is())
{
if (xTransform->getTransformType() == AnimationTransformType::SCALE)
xmlNodeType = XML_animScale;
else if (xTransform->getTransformType() == AnimationTransformType::ROTATE)
xmlNodeType = XML_animRot;
WriteAnimationNodeAnimate(xmlNodeType);
}
else
SAL_WARN("sd.eppt",
"XAnimateTransform not handled: " << xTransform->getTransformType());
}
break;
case AnimationNodeType::ANIMATE:
case AnimationNodeType::ANIMATEMOTION:
case AnimationNodeType::ANIMATECOLOR:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment