summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2023-01-27 20:56:55 +0800
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-01-28 17:43:54 +0000
commit28f3aeff99fa635f7d59ab88f1f41ff6a036bebb (patch)
tree50b9114c04ba7ae93f821864562101311f6a11d9
parent131904c23ab539a3eb2aba5467cbbeee0650632b (diff)
sd/source/filter refactor pptx animation export.
Refactor "Any NodeContext::getCondition(bool bBegin) const" to "const Reference<XAnimationNode>& NodeContext::getNodeForCondition() const", to get rid of the bool arguement of getCondition. Change-Id: Ic61d2caecaad2d3ada38556346f66aedb258e554 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146291 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sd/source/filter/eppt/pptx-animations.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx
index 1d53833fa89f..03c8e6cc7b49 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -572,7 +572,7 @@ public:
const OUString& getEffectPresetSubType() const { return msEffectPresetSubType; }
bool isValid() const { return mbValid; }
const std::vector<NodeContextPtr>& getChildNodes() const { return maChildNodes; };
- Any getCondition(bool bBegin) const;
+ const Reference<XAnimationNode>& getNodeForCondition() const;
};
struct Cond
@@ -1101,8 +1101,8 @@ void PPTXAnimationExport::WriteAnimationNodeCommonPropsStart()
sax_fastparser::UseIf(OString::number(nPresetSubType), bPresetSubType), XML_repeatCount,
sRepeatCount);
- WriteAnimationCondList(mpContext->getCondition(true), XML_stCondLst);
- WriteAnimationCondList(mpContext->getCondition(false), XML_endCondLst);
+ WriteAnimationCondList(mpContext->getNodeForCondition()->getBegin(), XML_stCondLst);
+ WriteAnimationCondList(mpContext->getNodeForCondition()->getEnd(), XML_endCondLst);
if (rXNode->getType() == AnimationNodeType::ITERATE)
{
@@ -1287,8 +1287,8 @@ void PPTXAnimationExport::WriteAnimationNodeMedia()
{
mpFS->startElementNS(XML_p, XML_cTn);
}
- WriteAnimationCondList(mpContext->getCondition(true), XML_stCondLst);
- WriteAnimationCondList(mpContext->getCondition(false), XML_endCondLst);
+ WriteAnimationCondList(mpContext->getNodeForCondition()->getBegin(), XML_stCondLst);
+ WriteAnimationCondList(mpContext->getNodeForCondition()->getEnd(), XML_endCondLst);
mpFS->endElementNS(XML_p, XML_cTn);
mpFS->startElementNS(XML_p, XML_tgtEl);
@@ -1528,13 +1528,12 @@ bool NodeContext::initChildNodes()
return bValid;
}
-Any NodeContext::getCondition(bool bBegin) const
+const Reference<XAnimationNode>& NodeContext::getNodeForCondition() const
{
const bool bParent
= (mnEffectNodeType != EffectNodeType::INTERACTIVE_SEQUENCE || maChildNodes.empty());
const Reference<XAnimationNode>& rNode = bParent ? mxNode : maChildNodes[0]->getNode();
-
- return bBegin ? rNode->getBegin() : rNode->getEnd();
+ return rNode;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */