diff options
Diffstat (limited to 'slideshow/source/engine/animationnodes/animationbasenode.cxx')
-rw-r--r-- | slideshow/source/engine/animationnodes/animationbasenode.cxx | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx index 9125cc6bcac5..ee979e60e659 100644 --- a/slideshow/source/engine/animationnodes/animationbasenode.cxx +++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,7 +55,7 @@ namespace slideshow { namespace internal { AnimationBaseNode::AnimationBaseNode( - const uno::Reference< animations::XAnimationNode >& xNode, + const uno::Reference< animations::XAnimationNode >& xNode, const BaseContainerNodeSharedPtr& rParent, const NodeContext& rContext ) : BaseNode( xNode, rParent, rContext ), @@ -70,13 +70,13 @@ AnimationBaseNode::AnimationBaseNode( { // extract native node targets // =========================== - + // plain shape target uno::Reference< drawing::XShape > xShape( mxAnimateNode->getTarget(), uno::UNO_QUERY ); - + // distinguish 5 cases: - // + // // - plain shape target // (NodeContext.mpMasterShapeSubset full set) // @@ -100,7 +100,7 @@ AnimationBaseNode::AnimationBaseNode( } else { - // cases 2 & 3: subset shape + // cases 2 & 3: subset shape mpShapeSubset = rContext.mpMasterShapeSubset; } } @@ -108,9 +108,9 @@ AnimationBaseNode::AnimationBaseNode( { // no parent-provided shape, try to extract // from XAnimationNode - cases 4 and 5 - + if( xShape.is() ) - { + { mpShape = lookupAttributableShape( getContext().mpSubsettableShapeManager, xShape ); } @@ -118,18 +118,18 @@ AnimationBaseNode::AnimationBaseNode( { // no shape provided. Maybe a ParagraphTarget? presentation::ParagraphTarget aTarget; - + if( !(mxAnimateNode->getTarget() >>= aTarget) ) ENSURE_OR_THROW( false, "could not extract any target information" ); - + xShape = aTarget.Shape; - + ENSURE_OR_THROW( xShape.is(), "invalid shape in ParagraphTarget" ); - + mpShape = lookupAttributableShape( getContext().mpSubsettableShapeManager, xShape ); - + // NOTE: For shapes with ParagraphTarget, we ignore // the SubItem property. We implicitely assume that it // is set to ONLY_TEXT. @@ -140,14 +140,14 @@ AnimationBaseNode::AnimationBaseNode( presentation::ShapeAnimationSubType::AS_WHOLE, "ParagraphTarget given, but subitem not AS_TEXT or AS_WHOLE? " "Make up your mind, I'll ignore the subitem." ); - + // okay, found a ParagraphTarget with a valid XShape. Does the shape // provide the given paragraph? - const DocTreeNode& rTreeNode( + const DocTreeNode& rTreeNode( mpShape->getTreeNodeSupplier().getTreeNode( - aTarget.Paragraph, + aTarget.Paragraph, DocTreeNode::NODETYPE_LOGICAL_PARAGRAPH ) ); - + // CAUTION: the creation of the subset shape // _must_ stay in the node constructor, since // Slide::prefetchShow() initializes shape @@ -157,7 +157,7 @@ AnimationBaseNode::AnimationBaseNode( new ShapeSubset( mpShape, rTreeNode, mpSubsetManager )); - + // Override NodeContext, and flag this node as // a special independent subset one. This is // important when applying initial attributes: @@ -172,7 +172,7 @@ AnimationBaseNode::AnimationBaseNode( // the slide is initially shown, and become // visible only when the effect starts. mbIsIndependentSubset = true; - + // already enable subset right here, the // setup of initial shape attributes of // course needs the subset shape @@ -189,12 +189,12 @@ void AnimationBaseNode::dispose() mpActivity->dispose(); mpActivity.reset(); } - + maAttributeLayerHolder.reset(); mxAnimateNode.clear(); mpShape.reset(); mpShapeSubset.reset(); - + BaseNode::dispose(); } @@ -205,12 +205,12 @@ bool AnimationBaseNode::init_st() mpActivity->dispose(); mpActivity.reset(); } - + // note: actually disposing the activity too early might cause problems, // because on dequeued() it calls endAnimation(pAnim->end()), thus ending // animation _after_ last screen update. // review that end() is properly called (which calls endAnimation(), too). - + try { // TODO(F2): For restart functionality, we must regenerate activities, // since they are not able to reset their state (or implement _that_) @@ -220,7 +220,7 @@ bool AnimationBaseNode::init_st() OSL_ENSURE( false, rtl::OUStringToOString( comphelper::anyToString(cppu::getCaughtException()), RTL_TEXTENCODING_UTF8 ) ); - // catch and ignore. We later handle empty activities, but for + // catch and ignore. We later handle empty activities, but for // other nodes to function properly, the core functionality of // this node must remain up and running. } @@ -228,7 +228,7 @@ bool AnimationBaseNode::init_st() } bool AnimationBaseNode::resolve_st() -{ +{ // enable shape subset for automatically generated // subsets. Independent subsets are already setup // during construction time. Doing it only here @@ -247,17 +247,17 @@ void AnimationBaseNode::activate_st() { // create new attribute layer maAttributeLayerHolder.createAttributeLayer( getShape() ); - + ENSURE_OR_THROW( maAttributeLayerHolder.get(), "Could not generate shape attribute layer" ); - + // TODO(Q2): This affects the way mpActivity // works, but is performed here because of // locality (we're fiddling with the additive mode // here, anyway, and it's the only place where we // do). OTOH, maybe the complete additive mode // setup should be moved to the activities. - + // for simple by-animations, the SMIL spec // requires us to emulate "0,by-value" value list // behaviour, with additive mode forced to "sum", @@ -276,7 +276,7 @@ void AnimationBaseNode::activate_st() // determine whether an // Activity::getUnderlyingValue() yields the // DOM value, or already a summed-up conglomerate) - // + // // Note that this poses problems with our // hybrid activity duration (time or min number of frames), // since if activities @@ -291,7 +291,7 @@ void AnimationBaseNode::activate_st() maAttributeLayerHolder.get()->setAdditiveMode( mxAnimateNode->getAdditive() ); } - + // fake normal animation behaviour, even if we // show nothing. This is the appropriate way to // handle errors on Activity generation, because @@ -302,7 +302,7 @@ void AnimationBaseNode::activate_st() // supply Activity (and the underlying Animation) with // it's AttributeLayer, to perform the animation on mpActivity->setTargets( getShape(), maAttributeLayerHolder.get() ); - + // add to activities queue getContext().mrActivitiesQueue.addActivity( mpActivity ); } @@ -319,7 +319,7 @@ void AnimationBaseNode::deactivate_st( NodeState eDestState ) if (mpActivity) mpActivity->end(); } - + if (isDependentSubsettedShape()) { // for dependent subsets, remove subset shape // from layer, re-integrate subsetted part @@ -330,7 +330,7 @@ void AnimationBaseNode::deactivate_st( NodeState eDestState ) // will effectively re-integrate the subsetted // part into the original shape (whose // animation will hopefully have ended, too) - + // this statement will save a whole lot of // sprites for iterated text effects, since // those sprites will only exist during the @@ -339,26 +339,26 @@ void AnimationBaseNode::deactivate_st( NodeState eDestState ) mpShapeSubset->disableSubsetShape(); } } - + if (eDestState == ENDED) { - + // no shape anymore, no layer needed: maAttributeLayerHolder.reset(); - + if (! isDependentSubsettedShape()) { - + // for all other shapes, removing the // attribute layer quite possibly changes // shape display. Thus, force update AttributableShapeSharedPtr const pShape( getShape() ); - + // don't anybody dare to check against // pShape->isVisible() here, removing the // attribute layer might actually make the // shape invisible! getContext().mpSubsettableShapeManager->notifyShapeUpdate( pShape ); } - + if (mpActivity) { // kill activity, if still running mpActivity->dispose(); @@ -369,7 +369,7 @@ void AnimationBaseNode::deactivate_st( NodeState eDestState ) bool AnimationBaseNode::hasPendingAnimation() const { - // TODO(F1): This might not always be true. Are there 'inactive' + // TODO(F1): This might not always be true. Are there 'inactive' // animation nodes? return true; } @@ -378,7 +378,7 @@ bool AnimationBaseNode::hasPendingAnimation() const void AnimationBaseNode::showState() const { BaseNode::showState(); - + VERBOSE_TRACE( "AnimationBaseNode info: independent subset=%s", mbIsIndependentSubset ? "y" : "n" ); } @@ -388,17 +388,17 @@ ActivitiesFactory::CommonParameters AnimationBaseNode::fillCommonParameters() const { double nDuration = 0.0; - + // TODO(F3): Duration/End handling is barely there if( !(mxAnimateNode->getDuration() >>= nDuration) ) { mxAnimateNode->getEnd() >>= nDuration; // Wah. } - + // minimal duration we fallback to (avoid 0 here!) nDuration = ::std::max( 0.001, nDuration ); - + const bool bAutoReverse( mxAnimateNode->getAutoReverse() ); - + boost::optional<double> aRepeats; double nRepeats = 0; if( (mxAnimateNode->getRepeatCount() >>= nRepeats) ) { @@ -411,7 +411,7 @@ AnimationBaseNode::fillCommonParameters() const // active duration. Thus, calc repeat // count with already adapted simple // duration (twice the specified duration) - + // convert duration back to repeat counts if( bAutoReverse ) aRepeats.reset( nRepeats / (2.0 * nDuration) ); @@ -421,7 +421,7 @@ AnimationBaseNode::fillCommonParameters() const else { // no double value for both values - Timing::INDEFINITE? animations::Timing eTiming; - + if( !(mxAnimateNode->getRepeatDuration() >>= eTiming) || eTiming != animations::Timing_INDEFINITE ) { @@ -435,7 +435,7 @@ AnimationBaseNode::fillCommonParameters() const } } } - + // calc accel/decel: double nAcceleration = 0.0; double nDeceleration = 0.0; @@ -450,7 +450,7 @@ AnimationBaseNode::fillCommonParameters() const nDeceleration = std::max( nDeceleration, xAnimationNode->getDecelerate() ); } - + EventSharedPtr pEndEvent; if (pSelf) { pEndEvent = makeEvent( |