summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-11-26 20:00:09 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-11-27 08:56:16 +0100
commit6109589065b61807d8d802329d872a019540e4ac (patch)
tree995fef328609dffda74aa7065441841b310617f4 /slideshow
parent8cb7deff9bf49d17b7519d9d49aea5943d14baa3 (diff)
Turn StateTransition::Options into scoped enum
(the enum type itself was identified as unused by upcoming loplugin:unusedmember and is put into use this way) Change-Id: Ic63931d17b512d675a0182cb9045aad5d0e9e835 Reviewed-on: https://gerrit.libreoffice.org/83824 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/animationnodes/basenode.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/slideshow/source/engine/animationnodes/basenode.cxx b/slideshow/source/engine/animationnodes/basenode.cxx
index afe0a0111e50..dee7b862b8fd 100644
--- a/slideshow/source/engine/animationnodes/basenode.cxx
+++ b/slideshow/source/engine/animationnodes/basenode.cxx
@@ -263,7 +263,7 @@ bool isMainSequenceRootNode_(
class BaseNode::StateTransition
{
public:
- enum Options { NONE, FORCE };
+ enum class Options { NONE, FORCE };
explicit StateTransition( BaseNode * pNode )
: mpNode(pNode), meToState(INVALID) {}
@@ -275,13 +275,13 @@ public:
StateTransition(const StateTransition&) = delete;
StateTransition& operator=(const StateTransition&) = delete;
- bool enter( NodeState eToState, int options = NONE )
+ bool enter( NodeState eToState, Options options = Options::NONE )
{
OSL_ENSURE( meToState == INVALID,
"### commit() before enter()ing again!" );
if (meToState != INVALID)
return false;
- bool const bForce = ((options & FORCE) != 0);
+ bool const bForce = options == Options::FORCE;
if (!bForce && !mpNode->isTransition( mpNode->meCurrState, eToState ))
return false;
// recursion detection:
@@ -570,7 +570,7 @@ void BaseNode::deactivate()
if (isTransition( meCurrState, FROZEN, false /* no OSL_ASSERT */ )) {
// do transition to FROZEN:
StateTransition st(this);
- if (st.enter( FROZEN, StateTransition::FORCE )) {
+ if (st.enter( FROZEN, StateTransition::Options::FORCE )) {
deactivate_st( FROZEN );
st.commit();
@@ -607,7 +607,7 @@ void BaseNode::end()
"end state not reachable in transition table" );
StateTransition st(this);
- if (!st.enter( ENDED, StateTransition::FORCE ))
+ if (!st.enter( ENDED, StateTransition::Options::FORCE ))
return;
deactivate_st( ENDED );