diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-06 08:54:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-06 09:13:25 +0000 |
commit | c9c3cb5446bfeb621d5fee5d50d19c8e030e3087 (patch) | |
tree | 4d563d16c2d35e153dcab833de7ad87e5a2e6620 /connectivity | |
parent | OpenGLWindow typeinfo unavailable without HAVE_FEATURE_OPENGL (diff) | |
download | core-c9c3cb5446bfeb621d5fee5d50d19c8e030e3087.tar.gz core-c9c3cb5446bfeb621d5fee5d50d19c8e030e3087.zip |
loplugin:unusedenumconstants in connectivity..cui
Convert ExpressionFunct to scoped enum and drop FUNC_CONST value.
Convert MQueryExpressionBase::node_type to scoped enum and drop Unknown
value.
Dop PageType::Color value
Change-Id: Icb1f5503c230fb91329acc7d9e1da665fa28d95e
Reviewed-on: https://gerrit.libreoffice.org/33948
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/RowFunctionParser.cxx | 14 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MQueryHelper.hxx | 15 | ||||
-rw-r--r-- | connectivity/source/inc/RowFunctionParser.hxx | 9 |
3 files changed, 18 insertions, 20 deletions
diff --git a/connectivity/source/commontools/RowFunctionParser.cxx b/connectivity/source/commontools/RowFunctionParser.cxx index b44713f4c961..dd7d05f03900 100644 --- a/connectivity/source/commontools/RowFunctionParser.cxx +++ b/connectivity/source/commontools/RowFunctionParser.cxx @@ -93,13 +93,13 @@ public: ORowSetValueDecoratorRef aRet; switch(meFunct) { - case ENUM_FUNC_EQUATION: + case ExpressionFunct::Equation: aRet = new ORowSetValueDecorator( mpFirstArg->evaluate(_aRow )->getValue() == mpSecondArg->evaluate(_aRow )->getValue() ); break; - case ENUM_FUNC_AND: + case ExpressionFunct::And: aRet = new ORowSetValueDecorator( mpFirstArg->evaluate(_aRow )->getValue().getBool() && mpSecondArg->evaluate(_aRow )->getValue().getBool() ); break; - case ENUM_FUNC_OR: + case ExpressionFunct::Or: aRet = new ORowSetValueDecorator( mpFirstArg->evaluate(_aRow )->getValue().getBool() || mpSecondArg->evaluate(_aRow )->getValue().getBool() ); break; default: @@ -111,7 +111,7 @@ public: { switch(meFunct) { - case ENUM_FUNC_EQUATION: + case ExpressionFunct::Equation: (*mpFirstArg->evaluate(_aRow )) = mpSecondArg->evaluate(_aRow )->getValue(); break; default: @@ -334,18 +334,18 @@ public: assignment = unaryFunction >> ch_p('=') >> argument - [ BinaryFunctionFunctor( ENUM_FUNC_EQUATION, self.getContext()) ] + [ BinaryFunctionFunctor( ExpressionFunct::Equation, self.getContext()) ] ; andExpression = assignment | ( '(' >> orExpression >> ')' ) - | ( assignment >> AND_ >> assignment ) [ BinaryFunctionFunctor( ENUM_FUNC_AND, self.getContext()) ] + | ( assignment >> AND_ >> assignment ) [ BinaryFunctionFunctor( ExpressionFunct::And, self.getContext()) ] ; orExpression = andExpression - | ( orExpression >> OR_ >> andExpression ) [ BinaryFunctionFunctor( ENUM_FUNC_OR, self.getContext()) ] + | ( orExpression >> OR_ >> andExpression ) [ BinaryFunctionFunctor( ExpressionFunct::Or, self.getContext()) ] ; basicExpression = diff --git a/connectivity/source/drivers/mork/MQueryHelper.hxx b/connectivity/source/drivers/mork/MQueryHelper.hxx index 1871b4591e77..3861b5791a16 100644 --- a/connectivity/source/drivers/mork/MQueryHelper.hxx +++ b/connectivity/source/drivers/mork/MQueryHelper.hxx @@ -47,11 +47,10 @@ namespace connectivity class MQueryExpressionBase { public: - typedef enum { - Unknown, + enum class node_type { StringExpr, Expr - } node_type; + }; protected: node_type m_eNodeType; @@ -61,8 +60,8 @@ namespace connectivity public: virtual ~MQueryExpressionBase() {} - bool isStringExpr( ) const { return m_eNodeType == StringExpr; } - bool isExpr( ) const { return m_eNodeType == Expr; } + bool isStringExpr( ) const { return m_eNodeType == node_type::StringExpr; } + bool isExpr( ) const { return m_eNodeType == node_type::Expr; } }; class MQueryExpressionString : public MQueryExpressionBase { @@ -76,7 +75,7 @@ namespace connectivity MQueryExpressionString( const OUString& lhs, MQueryOp::cond_type cond, const OUString& rhs ) - : MQueryExpressionBase( MQueryExpressionBase::StringExpr ) + : MQueryExpressionBase( MQueryExpressionBase::node_type::StringExpr ) , m_aName( lhs ) , m_aBooleanCondition( cond ) , m_aValue( rhs ) @@ -85,7 +84,7 @@ namespace connectivity MQueryExpressionString( const OUString& lhs, MQueryOp::cond_type cond ) - : MQueryExpressionBase( MQueryExpressionBase::StringExpr ) + : MQueryExpressionBase( MQueryExpressionBase::node_type::StringExpr ) , m_aName( lhs ) , m_aBooleanCondition( cond ) , m_aValue( OUString() ) @@ -123,7 +122,7 @@ namespace connectivity bool_cond getExpressionCondition( ) const { return m_aExprCondType; } - MQueryExpression() : MQueryExpressionBase( MQueryExpressionBase::Expr ), + MQueryExpression() : MQueryExpressionBase( MQueryExpressionBase::node_type::Expr ), m_aExprCondType( OR ) {} diff --git a/connectivity/source/inc/RowFunctionParser.hxx b/connectivity/source/inc/RowFunctionParser.hxx index ed547ed6647c..df2c7ba2bf4e 100644 --- a/connectivity/source/inc/RowFunctionParser.hxx +++ b/connectivity/source/inc/RowFunctionParser.hxx @@ -29,12 +29,11 @@ namespace connectivity { -enum ExpressionFunct +enum class ExpressionFunct { - FUNC_CONST, - ENUM_FUNC_EQUATION, - ENUM_FUNC_AND, - ENUM_FUNC_OR + Equation, + And, + Or }; #define EXPRESSION_FLAG_SUMANGLE_MODE 1 |