Kaydet (Commit) f820f6eb authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#121942 action deactivated twice

Change-Id: I25b1ed89b8d0e7a7c0e36c621a43644bc2b4aa7b
Reviewed-on: https://gerrit.libreoffice.org/64708
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b3d0b00f
...@@ -38,6 +38,7 @@ AnimationCommandNode::AnimationCommandNode( uno::Reference<animations::XAnimatio ...@@ -38,6 +38,7 @@ AnimationCommandNode::AnimationCommandNode( uno::Reference<animations::XAnimatio
::std::shared_ptr<BaseContainerNode> const& pParent, ::std::shared_ptr<BaseContainerNode> const& pParent,
NodeContext const& rContext ) : NodeContext const& rContext ) :
BaseNode( xNode, pParent, rContext ), BaseNode( xNode, pParent, rContext ),
mbToggled(false),
mpShape(), mpShape(),
mxCommandNode( xNode, css::uno::UNO_QUERY_THROW ) mxCommandNode( xNode, css::uno::UNO_QUERY_THROW )
{ {
...@@ -80,12 +81,13 @@ void AnimationCommandNode::activate_st() ...@@ -80,12 +81,13 @@ void AnimationCommandNode::activate_st()
// the command toggles the pause status on a media object // the command toggles the pause status on a media object
case EffectCommands::TOGGLEPAUSE: case EffectCommands::TOGGLEPAUSE:
{ {
if( mpShape ) if (mpShape)
{ {
if( mpShape->isPlaying() ) if( mpShape->isPlaying() )
mpShape->pause(); mpShape->pause();
else else
mpShape->play(); mpShape->play();
mbToggled = true;
} }
break; break;
} }
...@@ -115,12 +117,13 @@ void AnimationCommandNode::deactivate_st( NodeState /*eDestState*/ ) ...@@ -115,12 +117,13 @@ void AnimationCommandNode::deactivate_st( NodeState /*eDestState*/ )
// the command toggles the pause status on a media object // the command toggles the pause status on a media object
case EffectCommands::TOGGLEPAUSE: case EffectCommands::TOGGLEPAUSE:
{ {
if( mpShape ) if (mpShape && mbToggled)
{ {
if( mpShape->isPlaying() ) if( mpShape->isPlaying() )
mpShape->pause(); mpShape->pause();
else else
mpShape->play(); mpShape->play();
mbToggled = false;
} }
break; break;
} }
......
...@@ -50,6 +50,7 @@ private: ...@@ -50,6 +50,7 @@ private:
virtual bool hasPendingAnimation() const override; virtual bool hasPendingAnimation() const override;
private: private:
bool mbToggled;
IExternalMediaShapeBaseSharedPtr mpShape; IExternalMediaShapeBaseSharedPtr mpShape;
css::uno::Reference<css::animations::XCommand > mxCommandNode; css::uno::Reference<css::animations::XCommand > mxCommandNode;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment