summaryrefslogtreecommitdiff
path: root/sd/source/filter
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-07-17 18:58:27 +0800
committerMark Hung <marklh9@gmail.com>2018-07-25 15:00:10 +0200
commit7ff086c9141429e32c733f38d288cf67d6e9e3c9 (patch)
tree1e0866d4f6b4ac7fdb708c5df190bc9352d6c9dd /sd/source/filter
parent981ffeb876e3b3d898b00054ed5072035cf27c1a (diff)
tdf#118836: fix grow-shrink animation in saved pptx.
Convert AnimeTransform with transform type SCALE to animScale. Change-Id: I39dfbdb814afa78ca981238bb1876f4af0995791 Reviewed-on: https://gerrit.libreoffice.org/57790 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'sd/source/filter')
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx30
1 files changed, 29 insertions, 1 deletions
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 80e87fa1db0c..e23af1110080 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -918,6 +918,27 @@ void PowerPointExport::WriteAnimationProperty(const FSHelperPtr& pFS, const Any&
if (!rAny.hasValue())
return;
+ ValuePair aPair;
+
+ if (rAny >>= aPair)
+ {
+ double x, y;
+ if ((aPair.First >>= x) && (aPair.Second >>= y))
+ {
+ if (nToken == XML_by)
+ {
+ // MS needs ending values but we have offset values.
+ x += 1.0;
+ y += 1.0;
+ }
+ pFS->singleElementNS(XML_p, nToken,
+ XML_x, OString::number(x*100000).getStr(),
+ XML_y, OString::number(y*100000).getStr(),
+ FSEND);
+ }
+ return;
+ }
+
sal_uInt32 nRgb;
double fDouble;
@@ -1345,6 +1366,12 @@ void PowerPointExport::WriteAnimationNodeAnimateInside(const FSHelperPtr& pFS, c
WriteAnimateColorColor(pFS, xColor->getFrom(), XML_from);
WriteAnimateColorColor(pFS, xColor->getTo(), XML_to);
}
+ else if (xTransform.is() && xTransform->getTransformType() == AnimationTransformType::SCALE)
+ {
+ WriteAnimationProperty(pFS, rXAnimate->getBy(), XML_by);
+ WriteAnimationProperty(pFS, rXAnimate->getFrom(), XML_from);
+ WriteAnimationProperty(pFS, rXAnimate->getTo(), XML_to);
+ }
else if (bWriteTo)
WriteAnimateTo(pFS, rXAnimate->getTo(), rXAnimate->getAttributeName());
}
@@ -1781,7 +1808,8 @@ void PowerPointExport::WriteAnimationNode(const FSHelperPtr& pFS, const Referenc
{
if (xTransform->getTransformType() == AnimationTransformType::SCALE)
{
- SAL_WARN("sd.eppt", "SCALE transform type not handled");
+ xmlNodeType = XML_animScale;
+ pMethod = &PowerPointExport::WriteAnimationNodeAnimate;
}
else if (xTransform->getTransformType() == AnimationTransformType::ROTATE)
{