diff options
author | Mark Page <aptitude@btconnect.com> | 2016-06-07 11:59:24 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-08 11:09:44 +0000 |
commit | 22fa9289fdc6fd8d82d754adfef39fee3fd3c52f (patch) | |
tree | 9adcbeb8394912bd45f6c346d2dac3144c621593 /slideshow | |
parent | Simplify GfxLink using smart pointers (diff) | |
download | core-22fa9289fdc6fd8d82d754adfef39fee3fd3c52f.tar.gz core-22fa9289fdc6fd8d82d754adfef39fee3fd3c52f.zip |
tdf#96099 Remove various smart pointer typedefs
Change-Id: I76843139e43ca1c158a977e24d210d5af93e4d0f
Reviewed-on: https://gerrit.libreoffice.org/26014
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/activities/activitiesfactory.cxx | 8 | ||||
-rw-r--r-- | slideshow/source/engine/activities/activityparameters.hxx | 2 | ||||
-rw-r--r-- | slideshow/source/engine/expressionnodefactory.cxx | 76 | ||||
-rw-r--r-- | slideshow/source/engine/smilfunctionparser.cxx | 20 | ||||
-rw-r--r-- | slideshow/source/inc/expressionnode.hxx | 2 | ||||
-rw-r--r-- | slideshow/source/inc/expressionnodefactory.hxx | 28 | ||||
-rw-r--r-- | slideshow/source/inc/smilfunctionparser.hxx | 4 |
7 files changed, 69 insertions, 71 deletions
diff --git a/slideshow/source/engine/activities/activitiesfactory.cxx b/slideshow/source/engine/activities/activitiesfactory.cxx index 17868c25761a..f7b3e8f57d0a 100644 --- a/slideshow/source/engine/activities/activitiesfactory.cxx +++ b/slideshow/source/engine/activities/activitiesfactory.cxx @@ -53,7 +53,7 @@ namespace { template<typename ValueType> struct FormulaTraits { static ValueType getPresentationValue( - const ValueType& rVal, const ExpressionNodeSharedPtr& ) + const ValueType& rVal, const std::shared_ptr<ExpressionNode>& ) { return rVal; } @@ -63,7 +63,7 @@ template<typename ValueType> struct FormulaTraits template<> struct FormulaTraits<double> { static double getPresentationValue( - double const& rVal, ExpressionNodeSharedPtr const& rFormula ) + double const& rVal, std::shared_ptr<ExpressionNode> const& rFormula ) { return rFormula ? (*rFormula)(rVal) : rVal; } @@ -352,7 +352,7 @@ private: const OptionalValueType maTo; const OptionalValueType maBy; - ExpressionNodeSharedPtr mpFormula; + std::shared_ptr<ExpressionNode> mpFormula; ValueType maStartValue; ValueType maEndValue; @@ -589,7 +589,7 @@ public: private: ValueVectorType maValues; - ExpressionNodeSharedPtr mpFormula; + std::shared_ptr<ExpressionNode> mpFormula; std::shared_ptr<AnimationType> mpAnim; Interpolator< ValueType > maInterpolator; diff --git a/slideshow/source/engine/activities/activityparameters.hxx b/slideshow/source/engine/activities/activityparameters.hxx index 67b3a893a902..1faa1dd26d60 100644 --- a/slideshow/source/engine/activities/activityparameters.hxx +++ b/slideshow/source/engine/activities/activityparameters.hxx @@ -110,7 +110,7 @@ struct ActivityParameters ActivitiesQueue& mrActivitiesQueue; /// Optional formula - ExpressionNodeSharedPtr mpFormula; + std::shared_ptr<ExpressionNode> mpFormula; /// Key times, for discrete and key time activities ::std::vector< double > maDiscreteTimes; diff --git a/slideshow/source/engine/expressionnodefactory.cxx b/slideshow/source/engine/expressionnodefactory.cxx index 2c9dc9e1c8b8..5f185d378009 100644 --- a/slideshow/source/engine/expressionnodefactory.cxx +++ b/slideshow/source/engine/expressionnodefactory.cxx @@ -84,8 +84,8 @@ namespace slideshow class BinaryExpressionBase : public ExpressionNode { public: - BinaryExpressionBase( const ExpressionNodeSharedPtr& rFirstArg, - const ExpressionNodeSharedPtr& rSecondArg ) : + BinaryExpressionBase( const std::shared_ptr<ExpressionNode>& rFirstArg, + const std::shared_ptr<ExpressionNode>& rSecondArg ) : mpFirstArg( rFirstArg ), mpSecondArg( rSecondArg ) { @@ -99,15 +99,15 @@ namespace slideshow } protected: - ExpressionNodeSharedPtr mpFirstArg; - ExpressionNodeSharedPtr mpSecondArg; + std::shared_ptr<ExpressionNode> mpFirstArg; + std::shared_ptr<ExpressionNode> mpSecondArg; }; class PlusExpression : public BinaryExpressionBase { public: - PlusExpression( const ExpressionNodeSharedPtr& rFirstArg, - const ExpressionNodeSharedPtr& rSecondArg ) : + PlusExpression( const std::shared_ptr<ExpressionNode>& rFirstArg, + const std::shared_ptr<ExpressionNode>& rSecondArg ) : BinaryExpressionBase( rFirstArg, rSecondArg ) { } @@ -121,8 +121,8 @@ namespace slideshow class MinusExpression : public BinaryExpressionBase { public: - MinusExpression( const ExpressionNodeSharedPtr& rFirstArg, - const ExpressionNodeSharedPtr& rSecondArg ) : + MinusExpression( const std::shared_ptr<ExpressionNode>& rFirstArg, + const std::shared_ptr<ExpressionNode>& rSecondArg ) : BinaryExpressionBase( rFirstArg, rSecondArg ) { } @@ -136,8 +136,8 @@ namespace slideshow class MultipliesExpression : public BinaryExpressionBase { public: - MultipliesExpression( const ExpressionNodeSharedPtr& rFirstArg, - const ExpressionNodeSharedPtr& rSecondArg ) : + MultipliesExpression( const std::shared_ptr<ExpressionNode>& rFirstArg, + const std::shared_ptr<ExpressionNode>& rSecondArg ) : BinaryExpressionBase( rFirstArg, rSecondArg ) { } @@ -151,8 +151,8 @@ namespace slideshow class DividesExpression : public BinaryExpressionBase { public: - DividesExpression( const ExpressionNodeSharedPtr& rFirstArg, - const ExpressionNodeSharedPtr& rSecondArg ) : + DividesExpression( const std::shared_ptr<ExpressionNode>& rFirstArg, + const std::shared_ptr<ExpressionNode>& rSecondArg ) : BinaryExpressionBase( rFirstArg, rSecondArg ) { } @@ -166,8 +166,8 @@ namespace slideshow class MinExpression : public BinaryExpressionBase { public: - MinExpression( const ExpressionNodeSharedPtr& rFirstArg, - const ExpressionNodeSharedPtr& rSecondArg ) : + MinExpression( const std::shared_ptr<ExpressionNode>& rFirstArg, + const std::shared_ptr<ExpressionNode>& rSecondArg ) : BinaryExpressionBase( rFirstArg, rSecondArg ) { } @@ -181,8 +181,8 @@ namespace slideshow class MaxExpression : public BinaryExpressionBase { public: - MaxExpression( const ExpressionNodeSharedPtr& rFirstArg, - const ExpressionNodeSharedPtr& rSecondArg ) : + MaxExpression( const std::shared_ptr<ExpressionNode>& rFirstArg, + const std::shared_ptr<ExpressionNode>& rSecondArg ) : BinaryExpressionBase( rFirstArg, rSecondArg ) { } @@ -194,50 +194,50 @@ namespace slideshow }; } - ExpressionNodeSharedPtr ExpressionNodeFactory::createConstantValueExpression( double rConstantValue ) + std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createConstantValueExpression( double rConstantValue ) { - return ExpressionNodeSharedPtr( new ConstantValueExpression(rConstantValue) ); + return std::shared_ptr<ExpressionNode>( new ConstantValueExpression(rConstantValue) ); } - ExpressionNodeSharedPtr ExpressionNodeFactory::createValueTExpression() + std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createValueTExpression() { - return ExpressionNodeSharedPtr( new TValueExpression() ); + return std::shared_ptr<ExpressionNode>( new TValueExpression() ); } - ExpressionNodeSharedPtr ExpressionNodeFactory::createPlusExpression( const ExpressionNodeSharedPtr& rLHS, - const ExpressionNodeSharedPtr& rRHS ) + std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createPlusExpression( const std::shared_ptr<ExpressionNode>& rLHS, + const std::shared_ptr<ExpressionNode>& rRHS ) { - return ExpressionNodeSharedPtr( new PlusExpression(rLHS, rRHS) ); + return std::shared_ptr<ExpressionNode>( new PlusExpression(rLHS, rRHS) ); } - ExpressionNodeSharedPtr ExpressionNodeFactory::createMinusExpression( const ExpressionNodeSharedPtr& rLHS, - const ExpressionNodeSharedPtr& rRHS ) + std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createMinusExpression( const std::shared_ptr<ExpressionNode>& rLHS, + const std::shared_ptr<ExpressionNode>& rRHS ) { - return ExpressionNodeSharedPtr( new MinusExpression(rLHS, rRHS) ); + return std::shared_ptr<ExpressionNode>( new MinusExpression(rLHS, rRHS) ); } - ExpressionNodeSharedPtr ExpressionNodeFactory::createMultipliesExpression( const ExpressionNodeSharedPtr& rLHS, - const ExpressionNodeSharedPtr& rRHS ) + std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createMultipliesExpression( const std::shared_ptr<ExpressionNode>& rLHS, + const std::shared_ptr<ExpressionNode>& rRHS ) { - return ExpressionNodeSharedPtr( new MultipliesExpression(rLHS, rRHS) ); + return std::shared_ptr<ExpressionNode>( new MultipliesExpression(rLHS, rRHS) ); } - ExpressionNodeSharedPtr ExpressionNodeFactory::createDividesExpression( const ExpressionNodeSharedPtr& rLHS, - const ExpressionNodeSharedPtr& rRHS ) + std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createDividesExpression( const std::shared_ptr<ExpressionNode>& rLHS, + const std::shared_ptr<ExpressionNode>& rRHS ) { - return ExpressionNodeSharedPtr( new DividesExpression(rLHS, rRHS) ); + return std::shared_ptr<ExpressionNode>( new DividesExpression(rLHS, rRHS) ); } - ExpressionNodeSharedPtr ExpressionNodeFactory::createMinExpression ( const ExpressionNodeSharedPtr& rOuterFunction, - const ExpressionNodeSharedPtr& rInnerFunction ) + std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createMinExpression ( const std::shared_ptr<ExpressionNode>& rOuterFunction, + const std::shared_ptr<ExpressionNode>& rInnerFunction ) { - return ExpressionNodeSharedPtr( new MinExpression(rOuterFunction, rInnerFunction) ); + return std::shared_ptr<ExpressionNode>( new MinExpression(rOuterFunction, rInnerFunction) ); } - ExpressionNodeSharedPtr ExpressionNodeFactory::createMaxExpression ( const ExpressionNodeSharedPtr& rOuterFunction, - const ExpressionNodeSharedPtr& rInnerFunction ) + std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createMaxExpression ( const std::shared_ptr<ExpressionNode>& rOuterFunction, + const std::shared_ptr<ExpressionNode>& rInnerFunction ) { - return ExpressionNodeSharedPtr( new MaxExpression(rOuterFunction, rInnerFunction) ); + return std::shared_ptr<ExpressionNode>( new MaxExpression(rOuterFunction, rInnerFunction) ); } } diff --git a/slideshow/source/engine/smilfunctionparser.cxx b/slideshow/source/engine/smilfunctionparser.cxx index dcc807a16b53..8cfea83efc17 100644 --- a/slideshow/source/engine/smilfunctionparser.cxx +++ b/slideshow/source/engine/smilfunctionparser.cxx @@ -59,7 +59,7 @@ namespace slideshow struct ParserContext { - typedef ::std::stack< ExpressionNodeSharedPtr > OperandStack; + typedef ::std::stack< std::shared_ptr<ExpressionNode> > OperandStack; // stores a stack of not-yet-evaluated operands. This is used // by the operators (i.e. '+', '*', 'sin' etc.) to pop their @@ -197,7 +197,7 @@ namespace slideshow { public: UnaryFunctionExpression( const Functor& rFunctor, - const ExpressionNodeSharedPtr& rArg ) : + const std::shared_ptr<ExpressionNode>& rArg ) : maFunctor( rFunctor ), mpArg( rArg ) { @@ -215,7 +215,7 @@ namespace slideshow private: Functor maFunctor; - ExpressionNodeSharedPtr mpArg; + std::shared_ptr<ExpressionNode> mpArg; }; public: @@ -236,7 +236,7 @@ namespace slideshow throw ParseError( "Not enough arguments for unary operator" ); // retrieve arguments - ExpressionNodeSharedPtr pArg( rNodeStack.top() ); + std::shared_ptr<ExpressionNode> pArg( rNodeStack.top() ); rNodeStack.pop(); // check for constness @@ -250,7 +250,7 @@ namespace slideshow { // push complex node, that calcs the value on demand rNodeStack.push( - ExpressionNodeSharedPtr( + std::shared_ptr<ExpressionNode>( new UnaryFunctionExpression( maFunctor, pArg ) ) ); @@ -311,13 +311,13 @@ namespace slideshow throw ParseError( "Not enough arguments for binary operator" ); // retrieve arguments - ExpressionNodeSharedPtr pSecondArg( rNodeStack.top() ); + std::shared_ptr<ExpressionNode> pSecondArg( rNodeStack.top() ); rNodeStack.pop(); - ExpressionNodeSharedPtr pFirstArg( rNodeStack.top() ); + std::shared_ptr<ExpressionNode> pFirstArg( rNodeStack.top() ); rNodeStack.pop(); // create combined ExpressionNode - ExpressionNodeSharedPtr pNode( maGenerator( pFirstArg, + std::shared_ptr<ExpressionNode> pNode( maGenerator( pFirstArg, pSecondArg ) ); // check for constness if( pFirstArg->isConstant() && @@ -526,7 +526,7 @@ namespace slideshow #endif } - ExpressionNodeSharedPtr SmilFunctionParser::parseSmilValue( const OUString& rSmilValue, + std::shared_ptr<ExpressionNode> SmilFunctionParser::parseSmilValue( const OUString& rSmilValue, const ::basegfx::B2DRectangle& rRelativeShapeBounds ) { // TODO(Q1): Check if a combination of the RTL_UNICODETOTEXT_FLAGS_* @@ -575,7 +575,7 @@ namespace slideshow return pContext->maOperandStack.top(); } - ExpressionNodeSharedPtr SmilFunctionParser::parseSmilFunction( const OUString& rSmilFunction, + std::shared_ptr<ExpressionNode> SmilFunctionParser::parseSmilFunction( const OUString& rSmilFunction, const ::basegfx::B2DRectangle& rRelativeShapeBounds ) { // TODO(Q1): Check if a combination of the RTL_UNICODETOTEXT_FLAGS_* diff --git a/slideshow/source/inc/expressionnode.hxx b/slideshow/source/inc/expressionnode.hxx index 8bd0b14e2e85..bb6aff2cba7d 100644 --- a/slideshow/source/inc/expressionnode.hxx +++ b/slideshow/source/inc/expressionnode.hxx @@ -76,8 +76,6 @@ namespace slideshow */ virtual bool isConstant() const = 0; }; - - typedef ::std::shared_ptr< ExpressionNode > ExpressionNodeSharedPtr; } } diff --git a/slideshow/source/inc/expressionnodefactory.hxx b/slideshow/source/inc/expressionnodefactory.hxx index 5c3d994034a6..d4a60b3c72c9 100644 --- a/slideshow/source/inc/expressionnodefactory.hxx +++ b/slideshow/source/inc/expressionnodefactory.hxx @@ -41,29 +41,29 @@ namespace slideshow class ExpressionNodeFactory { public: - static ExpressionNodeSharedPtr createConstantValueExpression( double rConstantValue ); + static std::shared_ptr<ExpressionNode> createConstantValueExpression( double rConstantValue ); - static ExpressionNodeSharedPtr createValueTExpression (); + static std::shared_ptr<ExpressionNode> createValueTExpression (); - static ExpressionNodeSharedPtr createPlusExpression ( const ExpressionNodeSharedPtr& rLHS, - const ExpressionNodeSharedPtr& rRHS ); - static ExpressionNodeSharedPtr createMinusExpression ( const ExpressionNodeSharedPtr& rLHS, - const ExpressionNodeSharedPtr& rRHS ); - static ExpressionNodeSharedPtr createMultipliesExpression( const ExpressionNodeSharedPtr& rLHS, - const ExpressionNodeSharedPtr& rRHS ); - static ExpressionNodeSharedPtr createDividesExpression ( const ExpressionNodeSharedPtr& rLHS, - const ExpressionNodeSharedPtr& rRHS ); + static std::shared_ptr<ExpressionNode> createPlusExpression ( const std::shared_ptr<ExpressionNode>& rLHS, + const std::shared_ptr<ExpressionNode>& rRHS ); + static std::shared_ptr<ExpressionNode> createMinusExpression ( const std::shared_ptr<ExpressionNode>& rLHS, + const std::shared_ptr<ExpressionNode>& rRHS ); + static std::shared_ptr<ExpressionNode> createMultipliesExpression( const std::shared_ptr<ExpressionNode>& rLHS, + const std::shared_ptr<ExpressionNode>& rRHS ); + static std::shared_ptr<ExpressionNode> createDividesExpression ( const std::shared_ptr<ExpressionNode>& rLHS, + const std::shared_ptr<ExpressionNode>& rRHS ); /** Composes two ExpressionNode function. The resulting expression will calculate rOuterFunction( rInnerFunction(t) ). */ - static ExpressionNodeSharedPtr createMinExpression ( const ExpressionNodeSharedPtr& rOuterFunction, - const ExpressionNodeSharedPtr& rInnerFunction ); + static std::shared_ptr<ExpressionNode> createMinExpression ( const std::shared_ptr<ExpressionNode>& rOuterFunction, + const std::shared_ptr<ExpressionNode>& rInnerFunction ); - static ExpressionNodeSharedPtr createMaxExpression ( const ExpressionNodeSharedPtr& rOuterFunction, - const ExpressionNodeSharedPtr& rInnerFunction ); + static std::shared_ptr<ExpressionNode> createMaxExpression ( const std::shared_ptr<ExpressionNode>& rOuterFunction, + const std::shared_ptr<ExpressionNode>& rInnerFunction ); }; } } diff --git a/slideshow/source/inc/smilfunctionparser.hxx b/slideshow/source/inc/smilfunctionparser.hxx index 42a07be7941c..236dce4fdfbd 100644 --- a/slideshow/source/inc/smilfunctionparser.hxx +++ b/slideshow/source/inc/smilfunctionparser.hxx @@ -95,7 +95,7 @@ namespace slideshow @return the generated function object. */ - static ExpressionNodeSharedPtr parseSmilValue( const OUString& rSmilValue, + static std::shared_ptr<ExpressionNode> parseSmilValue( const OUString& rSmilValue, const ::basegfx::B2DRectangle& rRelativeShapeBounds ); // throw ParseError /** Parse a string containing a SMIL function. @@ -143,7 +143,7 @@ namespace slideshow @return the generated function object. */ - static ExpressionNodeSharedPtr parseSmilFunction( const OUString& rSmilFunction, + static std::shared_ptr<ExpressionNode> parseSmilFunction( const OUString& rSmilFunction, const ::basegfx::B2DRectangle& rRelativeShapeBounds ); // throw ParseError }; |