incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1378619 - /incubator/ooo/trunk/main/slideshow/source/engine/animationnodes/animationbasenode.cxx
Date Wed, 29 Aug 2012 15:43:10 GMT
Author: af
Date: Wed Aug 29 15:43:10 2012
New Revision: 1378619

URL: http://svn.apache.org/viewvc?rev=1378619&view=rev
Log:
#i120750# Fixed processing of repeat count.
          
          Patch by: Wang Zhe
          Review and clean up by: Andre Fischer

Modified:
    incubator/ooo/trunk/main/slideshow/source/engine/animationnodes/animationbasenode.cxx

Modified: incubator/ooo/trunk/main/slideshow/source/engine/animationnodes/animationbasenode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/slideshow/source/engine/animationnodes/animationbasenode.cxx?rev=1378619&r1=1378618&r2=1378619&view=diff
==============================================================================
--- incubator/ooo/trunk/main/slideshow/source/engine/animationnodes/animationbasenode.cxx
(original)
+++ incubator/ooo/trunk/main/slideshow/source/engine/animationnodes/animationbasenode.cxx
Wed Aug 29 15:43:10 2012
@@ -396,8 +396,36 @@ AnimationBaseNode::fillCommonParameters(
     
     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) ) {
@@ -430,12 +458,11 @@ AnimationBaseNode::fillCommonParameters(
             }
         }
     }
-    
+
     // 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(



Mime
View raw message