diff options
author | Andre Fischer <af@openoffice.org> | 2009-03-09 10:45:37 +0000 |
---|---|---|
committer | Andre Fischer <af@openoffice.org> | 2009-03-09 10:45:37 +0000 |
commit | a7bd3d52eec783eadd078797f504c1e3c4878ab8 (patch) | |
tree | c757e0683763f5e6f1971ad81a43988f6d5f885d /slideshow | |
parent | 6ff3e037e87b5ca49f177eb1899f0c6715427782 (diff) |
#i48179# Fixed handling of main sequence effects that are not user triggered.
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/effectrewinder.cxx | 42 | ||||
-rw-r--r-- | slideshow/source/engine/effectrewinder.hxx | 2 |
2 files changed, 37 insertions, 7 deletions
diff --git a/slideshow/source/engine/effectrewinder.cxx b/slideshow/source/engine/effectrewinder.cxx index b4fd51968a15..465512a915cd 100644 --- a/slideshow/source/engine/effectrewinder.cxx +++ b/slideshow/source/engine/effectrewinder.cxx @@ -97,7 +97,8 @@ EffectRewinder::EffectRewinder ( mpAnimationStartHandler(), mnMainSequenceEffectCount(0), mpAsynchronousRewindEvent(), - mxCurrentAnimationRootNode() + mxCurrentAnimationRootNode(), + mbNonUserTriggeredMainSequenceEffectSeen(false) { initialize(); } @@ -341,14 +342,30 @@ bool EffectRewinder::notifyAnimationStart (const AnimationNodeSharedPtr& rpNode) // This notification is only relevant for us when the rpNode belongs to // the main sequence. BaseNodeSharedPtr pBaseNode (::boost::dynamic_pointer_cast<BaseNode>(rpNode)); - if (pBaseNode) + if ( ! pBaseNode) + return false; + + BaseContainerNodeSharedPtr pParent (pBaseNode->getParentNode()); + if ( ! (pParent && pParent->isMainSequenceRootNode())) + return false; + + // This notification is only relevant for us when the effect is user + // triggered. + bool bIsUserTriggered (false); + + Reference<animations::XAnimationNode> xNode (rpNode->getXAnimationNode()); + if (xNode.is()) { - BaseContainerNodeSharedPtr pParent (pBaseNode->getParentNode()); - if (pParent && pParent->isMainSequenceRootNode()) - { - ++mnMainSequenceEffectCount; - } + animations::Event aEvent; + if ((xNode->getBegin() >>= aEvent)) + bIsUserTriggered = (aEvent.Trigger == animations::EventTrigger::ON_NEXT); } + + if (bIsUserTriggered) + ++mnMainSequenceEffectCount; + else + mbNonUserTriggeredMainSequenceEffectSeen = true; + return false; } @@ -379,7 +396,16 @@ void EffectRewinder::asynchronousRewind ( } else { + // Process initial events and skip any animations that are started + // when the slide is shown. + mbNonUserTriggeredMainSequenceEffectSeen = false; mrEventQueue.forceEmpty(); + if (mbNonUserTriggeredMainSequenceEffectSeen) + { + mrUserEventQueue.callSkipEffectEventHandler(); + mrEventQueue.forceEmpty(); + } + while (--nEffectCount >= 0) skipSingleMainSequenceEffects(); @@ -401,4 +427,6 @@ void EffectRewinder::asynchronousRewindToPreviousSlide ( } + + } } // end of namespace ::slideshow::internal diff --git a/slideshow/source/engine/effectrewinder.hxx b/slideshow/source/engine/effectrewinder.hxx index c00131233b0e..804696c99c92 100644 --- a/slideshow/source/engine/effectrewinder.hxx +++ b/slideshow/source/engine/effectrewinder.hxx @@ -133,6 +133,8 @@ private: css::uno::Reference<css::animations::XAnimationNode> mxCurrentAnimationRootNode; ::boost::shared_ptr<ScreenUpdater::UpdateLock> mpPaintLock; + bool mbNonUserTriggeredMainSequenceEffectSeen; + void initialize (void); bool resetEffectCount (void); |