[Libreoffice-commits] core.git: slideshow/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 6 15:45:22 UTC 2018


 slideshow/source/engine/animationnodes/animationcommandnode.cxx |    7 +++++--
 slideshow/source/engine/animationnodes/animationcommandnode.hxx |    1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit f820f6eb6036197bbb53e2d5e4bf4d5341ad280d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Dec 6 13:19:57 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Dec 6 16:44:56 2018 +0100

    Resolves: tdf#121942 action deactivated twice
    
    Change-Id: I25b1ed89b8d0e7a7c0e36c621a43644bc2b4aa7b
    Reviewed-on: https://gerrit.libreoffice.org/64708
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.cxx b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
index 3bd05db936b2..1b764b1c5a4a 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.cxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
@@ -38,6 +38,7 @@ AnimationCommandNode::AnimationCommandNode( uno::Reference<animations::XAnimatio
                                              ::std::shared_ptr<BaseContainerNode> const& pParent,
                                              NodeContext const& rContext ) :
     BaseNode( xNode, pParent, rContext ),
+    mbToggled(false),
     mpShape(),
     mxCommandNode( xNode, css::uno::UNO_QUERY_THROW )
 {
@@ -80,12 +81,13 @@ void AnimationCommandNode::activate_st()
         // the command toggles the pause status on a media object
     case EffectCommands::TOGGLEPAUSE:
     {
-        if( mpShape )
+        if (mpShape)
         {
             if( mpShape->isPlaying() )
                 mpShape->pause();
             else
                 mpShape->play();
+            mbToggled = true;
         }
         break;
     }
@@ -115,12 +117,13 @@ void AnimationCommandNode::deactivate_st( NodeState /*eDestState*/ )
     // the command toggles the pause status on a media object
     case EffectCommands::TOGGLEPAUSE:
     {
-        if( mpShape )
+        if (mpShape && mbToggled)
         {
             if( mpShape->isPlaying() )
                 mpShape->pause();
             else
                 mpShape->play();
+            mbToggled = false;
         }
         break;
     }
diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.hxx b/slideshow/source/engine/animationnodes/animationcommandnode.hxx
index cf753e001949..1aacd1b6a071 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.hxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.hxx
@@ -50,6 +50,7 @@ private:
     virtual bool hasPendingAnimation() const override;
 
 private:
+    bool mbToggled;
     IExternalMediaShapeBaseSharedPtr mpShape;
     css::uno::Reference<css::animations::XCommand > mxCommandNode;
 };


More information about the Libreoffice-commits mailing list