summaryrefslogtreecommitdiff
path: root/slideshow/source/engine/animationnodes/animationbasenode.cxx
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2012-08-29 14:43:10 +0000
committerAndre Fischer <af@apache.org>2012-08-29 14:43:10 +0000
commita9c0b6273e8445557c01a111d807becf887fb67a (patch)
tree56ece53563f3190284424ee6b12ca7fdeeeaa549 /slideshow/source/engine/animationnodes/animationbasenode.cxx
parent4b1db38e7d9455bd04790f544634279d9b5a8e9d (diff)
#i120750# Fixed processing of repeat count.
Patch by: Wang Zhe Review and clean up by: Andre Fischer
Notes
Diffstat (limited to 'slideshow/source/engine/animationnodes/animationbasenode.cxx')
-rw-r--r--slideshow/source/engine/animationnodes/animationbasenode.cxx35
1 files changed, 31 insertions, 4 deletions
diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx
index e371d83bed27..6d0ac74245d2 100644
--- a/slideshow/source/engine/animationnodes/animationbasenode.cxx
+++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx
@@ -396,8 +396,36 @@ AnimationBaseNode::fillCommonParameters() const
boost::optional<double> aRepeats;
double nRepeats = 0;
- if( (mxAnimateNode->getRepeatCount() >>= nRepeats) ) {
- aRepeats.reset( nRepeats );
+ bool bRepeatIndefinite = false;
+ animations::Timing eTiming;
+
+ // Search parent nodes for an explicitly stated repeat count.
+ BaseNodeSharedPtr const pSelf( getSelf() );
+ for ( boost::shared_ptr<BaseNode> pNode( pSelf );
+ pNode;
+ pNode = pNode->getParentNode() )
+ {
+ uno::Reference<animations::XAnimationNode> const xAnimationNode(
+ pNode->getXAnimationNode() );
+ if( (xAnimationNode->getRepeatCount() >>= nRepeats) )
+ {
+ // Found an explicit repeat count.
+ break;
+ }
+ if( (xAnimationNode->getRepeatCount() >>= eTiming) &&
+ (eTiming == animations::Timing_INDEFINITE ))
+ {
+ // Found an explicit repeat count of Timing::INDEFINITE.
+ bRepeatIndefinite = true;
+ break;
+ }
+ }
+
+ if( nRepeats || bRepeatIndefinite ) {
+ if (nRepeats)
+ {
+ aRepeats.reset( nRepeats );
+ }
}
else {
if( (mxAnimateNode->getRepeatDuration() >>= nRepeats) ) {
@@ -434,8 +462,7 @@ AnimationBaseNode::fillCommonParameters() const
// calc accel/decel:
double nAcceleration = 0.0;
double nDeceleration = 0.0;
- BaseNodeSharedPtr const pSelf( getSelf() );
- for ( boost::shared_ptr<BaseNode> pNode( pSelf );
+ en for ( boost::shared_ptr<BaseNode> pNode( pSelf );
pNode; pNode = pNode->getParentNode() )
{
uno::Reference<animations::XAnimationNode> const xAnimationNode(