summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-12-04 16:42:10 +0000
committerMichael Stahl <Michael.Stahl@cib.de>2018-12-12 16:58:18 +0100
commit1ec50207dfe7ac7463ee9dff5b89c26af8b4e3b8 (patch)
tree098d18bbc09bd091bac44f5727c694cf9dcd7f39
parent60e287339e563dce39574a3d66ea7218db0935e3 (diff)
tdf#121830, tdf#121942 TogglePause should reset to original...
state on deactivate_st ? is that how it should work, or should there be an additional TogglePause created at import time to get the apparent intended pause effect Reviewed-on: https://gerrit.libreoffice.org/64548 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 1aa10fcb668f67f4313b7170a4090027e52164c5) Change-Id: I0573bd8d9534271f2b36d7ab3b8cdc20e0f985a1 Reviewed-on: https://gerrit.libreoffice.org/64621 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 8b550ff4c320e3c3e1495b4a38858c23c420dc86) Reviewed-on: https://gerrit.libreoffice.org/64816 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
-rw-r--r--slideshow/source/engine/animationnodes/animationcommandnode.cxx24
-rw-r--r--slideshow/source/engine/animationnodes/animationcommandnode.hxx2
2 files changed, 25 insertions, 1 deletions
diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.cxx b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
index 0c9519589ed0..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;
}
@@ -109,6 +111,26 @@ void AnimationCommandNode::activate_st()
"AnimationCommandNode::deactivate" ) );
}
+void AnimationCommandNode::deactivate_st( NodeState /*eDestState*/ )
+{
+ switch( mxCommandNode->getCommand() ) {
+ // the command toggles the pause status on a media object
+ case EffectCommands::TOGGLEPAUSE:
+ {
+ if (mpShape && mbToggled)
+ {
+ if( mpShape->isPlaying() )
+ mpShape->pause();
+ else
+ mpShape->play();
+ mbToggled = false;
+ }
+ break;
+ }
+
+ }
+}
+
bool AnimationCommandNode::hasPendingAnimation() const
{
return mxCommandNode->getCommand() == EffectCommands::STOPAUDIO || mpShape;
diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.hxx b/slideshow/source/engine/animationnodes/animationcommandnode.hxx
index 675da7c3b0e8..1aacd1b6a071 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.hxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.hxx
@@ -46,9 +46,11 @@ protected:
private:
virtual void activate_st() override;
+ virtual void deactivate_st( NodeState eDestState ) override;
virtual bool hasPendingAnimation() const override;
private:
+ bool mbToggled;
IExternalMediaShapeBaseSharedPtr mpShape;
css::uno::Reference<css::animations::XCommand > mxCommandNode;
};