Kaydet (Commit) 9a9b81c7 authored tarafından Mark Hung's avatar Mark Hung
üst 0fa2a778
...@@ -425,9 +425,10 @@ bool isValidTarget(const Any& rTarget) ...@@ -425,9 +425,10 @@ bool isValidTarget(const Any& rTarget)
return false; return false;
} }
/// convert animation node type to corresponding ooxml element. /// extract ooxml node type from a XAnimationNode.
sal_Int32 convertNodeType(sal_Int16 nType) sal_Int32 extractNodeType(const Reference<XAnimationNode>& rXNode)
{ {
sal_Int16 nType = rXNode->getType();
sal_Int32 xmlNodeType = -1; sal_Int32 xmlNodeType = -1;
switch (nType) switch (nType)
{ {
...@@ -445,9 +446,17 @@ sal_Int32 convertNodeType(sal_Int16 nType) ...@@ -445,9 +446,17 @@ sal_Int32 convertNodeType(sal_Int16 nType)
xmlNodeType = XML_animMotion; xmlNodeType = XML_animMotion;
break; break;
case AnimationNodeType::ANIMATETRANSFORM: 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; break;
}
case AnimationNodeType::ANIMATECOLOR: case AnimationNodeType::ANIMATECOLOR:
xmlNodeType = XML_animClr; xmlNodeType = XML_animClr;
break; break;
...@@ -1136,7 +1145,10 @@ void PPTXAnimationExport::WriteAnimationNode(const NodeContextPtr& pContext) ...@@ -1136,7 +1145,10 @@ void PPTXAnimationExport::WriteAnimationNode(const NodeContextPtr& pContext)
const Reference<XAnimationNode>& rXNode = getCurrentNode(); const Reference<XAnimationNode>& rXNode = getCurrentNode();
SAL_INFO("sd.eppt", "export node type: " << rXNode->getType()); 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()) switch (rXNode->getType())
{ {
...@@ -1150,22 +1162,6 @@ void PPTXAnimationExport::WriteAnimationNode(const NodeContextPtr& pContext) ...@@ -1150,22 +1162,6 @@ void PPTXAnimationExport::WriteAnimationNode(const NodeContextPtr& pContext)
WriteAnimationNodeSeq(); WriteAnimationNodeSeq();
break; break;
case AnimationNodeType::ANIMATETRANSFORM: 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::ANIMATE:
case AnimationNodeType::ANIMATEMOTION: case AnimationNodeType::ANIMATEMOTION:
case AnimationNodeType::ANIMATECOLOR: 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