From 6109589065b61807d8d802329d872a019540e4ac Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 26 Nov 2019 20:00:09 +0100 Subject: 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 --- slideshow/source/engine/animationnodes/basenode.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'slideshow') 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 ); -- cgit