summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2021-05-05 12:38:51 +0200
committerLászló Németh <nemeth@numbertext.org>2021-05-10 11:40:18 +0200
commitc89a7e2d900da5a6bded573f6dcff04c7be98339 (patch)
tree8c935490734032dd109d3e6175c383d30b2ae238 /sd/source
parent7ef207a79e13cbb3a98b03d7370e741f5796186c (diff)
tdf#124457 PPTX animation: export repeatCount
Aanimation timing property "repeatCount" wasn't exported. Note: PPTX uses a 1000 multiplication in repeatCount to support fractional movement of animated objects, e.g. 1500 means one and a half steps. Change-Id: Iac0dd10007c3e48f06c131d61671e1f78cad45a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115138 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/filter/eppt/pptx-animations.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx
index 63423c8489c0..43ef7ce4d55d 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -994,11 +994,13 @@ void PPTXAnimationExport::WriteAnimationNodeCommonPropsStart()
{
const Reference<XAnimationNode>& rXNode = getCurrentNode();
std::optional<OString> sDuration;
+ std::optional<OString> sRepeatCount;
const char* pRestart = nullptr;
const char* pNodeType = nullptr;
const char* pPresetClass = nullptr;
const char* pFill = nullptr;
double fDuration = 0;
+ double fRepeatCount = 0;
Any aAny;
assert(mpContext);
@@ -1070,12 +1072,30 @@ void PPTXAnimationExport::WriteAnimationNodeCommonPropsStart()
bool bAutoReverse = rXNode->getAutoReverse();
+ aAny = rXNode->getRepeatCount();
+ if (aAny.hasValue())
+ {
+ Timing eTiming;
+
+ if (aAny >>= eTiming)
+ {
+ if (eTiming == Timing_INDEFINITE)
+ sRepeatCount = "indefinite";
+ }
+ else
+ aAny >>= fRepeatCount;
+ }
+
+ if (fRepeatCount != 0)
+ sRepeatCount = OString::number(static_cast<sal_Int32>(fRepeatCount * 1000.0));
+
mpFS->startElementNS(
XML_p, XML_cTn, XML_id, OString::number(GetNextAnimationNodeId(rXNode)), XML_dur, sDuration,
XML_autoRev, sax_fastparser::UseIf("1", bAutoReverse), XML_restart, pRestart, XML_nodeType,
pNodeType, XML_fill, pFill, XML_presetClass, pPresetClass, XML_presetID,
sax_fastparser::UseIf(OString::number(nPresetId), bPresetId), XML_presetSubtype,
- sax_fastparser::UseIf(OString::number(nPresetSubType), bPresetSubType));
+ sax_fastparser::UseIf(OString::number(nPresetSubType), bPresetSubType), XML_repeatCount,
+ sRepeatCount);
WriteAnimationCondList(mpContext->getCondition(true), XML_stCondLst);
WriteAnimationCondList(mpContext->getCondition(false), XML_endCondLst);