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 /svx/source | |
parent | f595e70cfee85a423f592190c607231cb00e3180 (diff) |
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 'svx/source')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx | 62 | ||||
-rw-r--r-- | svx/source/unodraw/shapepropertynotifier.cxx | 4 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 4 |
3 files changed, 35 insertions, 35 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx index 4c0312bc6d0c..1b62812dc91c 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx @@ -325,15 +325,15 @@ public: class UnaryFunctionExpression : public ExpressionNode { const ExpressionFunct meFunct; - ExpressionNodeSharedPtr mpArg; + std::shared_ptr<ExpressionNode> mpArg; public: - UnaryFunctionExpression( const ExpressionFunct eFunct, const ExpressionNodeSharedPtr& rArg ) : + UnaryFunctionExpression( const ExpressionFunct eFunct, const std::shared_ptr<ExpressionNode>& rArg ) : meFunct( eFunct ), mpArg( rArg ) { } - static double getValue( const ExpressionFunct eFunct, const ExpressionNodeSharedPtr& rArg ) + static double getValue( const ExpressionFunct eFunct, const std::shared_ptr<ExpressionNode>& rArg ) { double fRet = 0; switch( eFunct ) @@ -493,18 +493,18 @@ public: class BinaryFunctionExpression : public ExpressionNode { const ExpressionFunct meFunct; - ExpressionNodeSharedPtr mpFirstArg; - ExpressionNodeSharedPtr mpSecondArg; + std::shared_ptr<ExpressionNode> mpFirstArg; + std::shared_ptr<ExpressionNode> mpSecondArg; public: - BinaryFunctionExpression( const ExpressionFunct eFunct, const ExpressionNodeSharedPtr& rFirstArg, const ExpressionNodeSharedPtr& rSecondArg ) : + BinaryFunctionExpression( const ExpressionFunct eFunct, const std::shared_ptr<ExpressionNode>& rFirstArg, const std::shared_ptr<ExpressionNode>& rSecondArg ) : meFunct( eFunct ), mpFirstArg( rFirstArg ), mpSecondArg( rSecondArg ) { } - static double getValue( const ExpressionFunct eFunct, const ExpressionNodeSharedPtr& rFirstArg, const ExpressionNodeSharedPtr& rSecondArg ) + static double getValue( const ExpressionFunct eFunct, const std::shared_ptr<ExpressionNode>& rFirstArg, const std::shared_ptr<ExpressionNode>& rSecondArg ) { double fRet = 0; switch( eFunct ) @@ -714,15 +714,15 @@ public: class IfExpression : public ExpressionNode { - ExpressionNodeSharedPtr mpFirstArg; - ExpressionNodeSharedPtr mpSecondArg; - ExpressionNodeSharedPtr mpThirdArg; + std::shared_ptr<ExpressionNode> mpFirstArg; + std::shared_ptr<ExpressionNode> mpSecondArg; + std::shared_ptr<ExpressionNode> mpThirdArg; public: - IfExpression( const ExpressionNodeSharedPtr& rFirstArg, - const ExpressionNodeSharedPtr& rSecondArg, - const ExpressionNodeSharedPtr& rThirdArg ) : + IfExpression( const std::shared_ptr<ExpressionNode>& rFirstArg, + const std::shared_ptr<ExpressionNode>& rSecondArg, + const std::shared_ptr<ExpressionNode>& rThirdArg ) : mpFirstArg( rFirstArg ), mpSecondArg( rSecondArg ), mpThirdArg( rThirdArg ) @@ -768,7 +768,7 @@ typedef const sal_Char* StringIteratorT; 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 @@ -796,7 +796,7 @@ public: } void operator()( double n ) const { - mxContext->maOperandStack.push( ExpressionNodeSharedPtr( new ConstantValueExpression( n ) ) ); + mxContext->maOperandStack.push( std::shared_ptr<ExpressionNode>( new ConstantValueExpression( n ) ) ); } }; @@ -820,17 +820,17 @@ public: case ENUM_FUNC_ADJUSTMENT : { OUString aVal( rFirst + 1, rSecond - rFirst, RTL_TEXTENCODING_UTF8 ); - mxContext->maOperandStack.push( ExpressionNodeSharedPtr( new AdjustmentExpression( *mxContext->mpCustoShape, aVal.toInt32() ) ) ); + mxContext->maOperandStack.push( std::shared_ptr<ExpressionNode>( new AdjustmentExpression( *mxContext->mpCustoShape, aVal.toInt32() ) ) ); } break; case ENUM_FUNC_EQUATION : { OUString aVal( rFirst + 1, rSecond - rFirst, RTL_TEXTENCODING_UTF8 ); - mxContext->maOperandStack.push( ExpressionNodeSharedPtr( new EquationExpression( *mxContext->mpCustoShape, aVal.toInt32() ) ) ); + mxContext->maOperandStack.push( std::shared_ptr<ExpressionNode>( new EquationExpression( *mxContext->mpCustoShape, aVal.toInt32() ) ) ); } break; default: - mxContext->maOperandStack.push( ExpressionNodeSharedPtr( new EnumValueExpression( *mxContext->mpCustoShape, meFunct ) ) ); + mxContext->maOperandStack.push( std::shared_ptr<ExpressionNode>( new EnumValueExpression( *mxContext->mpCustoShape, meFunct ) ) ); } } }; @@ -855,13 +855,13 @@ public: throw ParseError( "Not enough arguments for unary operator" ); // retrieve arguments - ExpressionNodeSharedPtr pArg( rNodeStack.top() ); + std::shared_ptr<ExpressionNode> pArg( rNodeStack.top() ); rNodeStack.pop(); if( pArg->isConstant() ) // check for constness - rNodeStack.push( ExpressionNodeSharedPtr( new ConstantValueExpression( UnaryFunctionExpression::getValue( meFunct, pArg ) ) ) ); + rNodeStack.push( std::shared_ptr<ExpressionNode>( new ConstantValueExpression( UnaryFunctionExpression::getValue( meFunct, pArg ) ) ) ); else // push complex node, that calcs the value on demand - rNodeStack.push( ExpressionNodeSharedPtr( new UnaryFunctionExpression( meFunct, pArg ) ) ); + rNodeStack.push( std::shared_ptr<ExpressionNode>( new UnaryFunctionExpression( meFunct, pArg ) ) ); } }; @@ -893,16 +893,16 @@ public: 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 = ExpressionNodeSharedPtr( new BinaryFunctionExpression( meFunct, pFirstArg, pSecondArg ) ); + std::shared_ptr<ExpressionNode> pNode = std::shared_ptr<ExpressionNode>( new BinaryFunctionExpression( meFunct, pFirstArg, pSecondArg ) ); // check for constness if( pFirstArg->isConstant() && pSecondArg->isConstant() ) // call the operator() at pNode, store result in constant value ExpressionNode. - rNodeStack.push( ExpressionNodeSharedPtr( new ConstantValueExpression( (*pNode)() ) ) ); + rNodeStack.push( std::shared_ptr<ExpressionNode>( new ConstantValueExpression( (*pNode)() ) ) ); else // push complex node, that calcs the value on demand rNodeStack.push( pNode ); } @@ -926,18 +926,18 @@ public: throw ParseError( "Not enough arguments for ternary operator" ); // retrieve arguments - ExpressionNodeSharedPtr pThirdArg( rNodeStack.top() ); + std::shared_ptr<ExpressionNode> pThirdArg( rNodeStack.top() ); rNodeStack.pop(); - 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( new IfExpression( pFirstArg, pSecondArg, pThirdArg ) ); + std::shared_ptr<ExpressionNode> pNode( new IfExpression( pFirstArg, pSecondArg, pThirdArg ) ); // check for constness if( pFirstArg->isConstant() && pSecondArg->isConstant() && pThirdArg->isConstant() ) - rNodeStack.push( ExpressionNodeSharedPtr( new ConstantValueExpression( (*pNode)() ) ) ); // call the operator() at pNode, store result in constant value ExpressionNode. + rNodeStack.push( std::shared_ptr<ExpressionNode>( new ConstantValueExpression( (*pNode)() ) ) ); // call the operator() at pNode, store result in constant value ExpressionNode. else rNodeStack.push( pNode ); // push complex node, that calcs the value on demand } @@ -1155,7 +1155,7 @@ const ParserContextSharedPtr& getParserContext() namespace EnhancedCustomShape { -ExpressionNodeSharedPtr FunctionParser::parseFunction( const OUString& rFunction, const EnhancedCustomShape2d& rCustoShape ) +std::shared_ptr<ExpressionNode> FunctionParser::parseFunction( const OUString& rFunction, const EnhancedCustomShape2d& rCustoShape ) { // TODO(Q1): Check if a combination of the RTL_UNICODETOTEXT_FLAGS_* // gives better conversion robustness here (we might want to map space diff --git a/svx/source/unodraw/shapepropertynotifier.cxx b/svx/source/unodraw/shapepropertynotifier.cxx index 3e36e7080ac9..5d1ed99b4054 100644 --- a/svx/source/unodraw/shapepropertynotifier.cxx +++ b/svx/source/unodraw/shapepropertynotifier.cxx @@ -54,7 +54,7 @@ namespace svx using ::com::sun::star::lang::EventObject; using ::com::sun::star::beans::XPropertySet; - typedef std::unordered_map< ShapeProperty, PPropertyValueProvider, ShapePropertyHash > PropertyProviders; + typedef std::unordered_map< ShapeProperty, std::shared_ptr<IPropertyValueProvider>, ShapePropertyHash > PropertyProviders; typedef cppu::OMultiTypeInterfaceContainerHelperVar<OUString> PropertyChangeListenerContainer; @@ -100,7 +100,7 @@ namespace svx { } - void PropertyChangeNotifier::registerProvider(const ShapeProperty _eProperty, const PPropertyValueProvider& _rProvider) + void PropertyChangeNotifier::registerProvider(const ShapeProperty _eProperty, const std::shared_ptr<IPropertyValueProvider>& _rProvider) { ENSURE_OR_THROW( _eProperty != eInvalidShapeProperty, "Illegal ShapeProperty value!" ); ENSURE_OR_THROW( !!_rProvider, "NULL factory not allowed." ); diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 53173746007c..72a010dcd2ee 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -327,9 +327,9 @@ svx::PropertyChangeNotifier& SvxShape::getShapePropertyChangeNotifier() void SvxShape::impl_construct() { mpImpl->maPropertyNotifier.registerProvider( svx::eShapePosition, - svx::PPropertyValueProvider( new ShapePositionProvider( *mpImpl ) ) ); + std::shared_ptr<svx::IPropertyValueProvider>( new ShapePositionProvider( *mpImpl ) ) ); mpImpl->maPropertyNotifier.registerProvider( svx::eShapeSize, - svx::PPropertyValueProvider( new ShapeSizeProvider( *mpImpl ) ) ); + std::shared_ptr<svx::IPropertyValueProvider>( new ShapeSizeProvider( *mpImpl ) ) ); if ( mpObj.is() ) impl_initFromSdrObject(); |