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 /connectivity | |
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 'connectivity')
-rw-r--r-- | connectivity/source/commontools/RowFunctionParser.cxx | 28 | ||||
-rw-r--r-- | connectivity/source/commontools/TDatabaseMetaDataBase.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/commontools/TKey.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/commontools/TTableHelper.cxx | 10 | ||||
-rw-r--r-- | connectivity/source/inc/RowFunctionParser.hxx | 3 | ||||
-rw-r--r-- | connectivity/source/sdbcx/VKey.cxx | 2 |
6 files changed, 25 insertions, 26 deletions
diff --git a/connectivity/source/commontools/RowFunctionParser.cxx b/connectivity/source/commontools/RowFunctionParser.cxx index 94c2e4fc285b..b12ba73ffb07 100644 --- a/connectivity/source/commontools/RowFunctionParser.cxx +++ b/connectivity/source/commontools/RowFunctionParser.cxx @@ -77,12 +77,12 @@ 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 ) @@ -128,7 +128,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 @@ -156,7 +156,7 @@ public: void operator()( StringIteratorT rFirst,StringIteratorT rSecond) const { OUString sVal( rFirst, rSecond - rFirst, RTL_TEXTENCODING_UTF8 ); - mpContext->maOperandStack.push( ExpressionNodeSharedPtr( new ConstantValueExpression( new ORowSetValueDecorator( sVal ) ) ) ); + mpContext->maOperandStack.push( std::shared_ptr<ExpressionNode>( new ConstantValueExpression( new ORowSetValueDecorator( sVal ) ) ) ); } }; @@ -173,7 +173,7 @@ public: } void operator()( sal_Int32 n ) const { - mpContext->maOperandStack.push( ExpressionNodeSharedPtr( new ConstantValueExpression( new ORowSetValueDecorator( n ) ) ) ); + mpContext->maOperandStack.push( std::shared_ptr<ExpressionNode>( new ConstantValueExpression( new ORowSetValueDecorator( n ) ) ) ); } }; @@ -205,13 +205,13 @@ 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 rNodeStack.push( pNode ); } @@ -221,10 +221,10 @@ public: */ class UnaryFunctionExpression : public ExpressionNode { - ExpressionNodeSharedPtr mpArg; + std::shared_ptr<ExpressionNode> mpArg; public: - explicit UnaryFunctionExpression( const ExpressionNodeSharedPtr& rArg ) : + explicit UnaryFunctionExpression( const std::shared_ptr<ExpressionNode>& rArg ) : mpArg( rArg ) { } @@ -256,10 +256,10 @@ public: throw ParseError( "Not enough arguments for unary operator" ); // retrieve arguments - ExpressionNodeSharedPtr pArg( rNodeStack.top() ); + std::shared_ptr<ExpressionNode> pArg( rNodeStack.top() ); rNodeStack.pop(); - rNodeStack.push( ExpressionNodeSharedPtr( new UnaryFunctionExpression( pArg ) ) ); + rNodeStack.push( std::shared_ptr<ExpressionNode>( new UnaryFunctionExpression( pArg ) ) ); } }; @@ -400,7 +400,7 @@ const ParserContextSharedPtr& getParserContext() #endif } -ExpressionNodeSharedPtr FunctionParser::parseFunction( const OUString& _sFunction) +std::shared_ptr<ExpressionNode> FunctionParser::parseFunction( const OUString& _sFunction) { // 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/connectivity/source/commontools/TDatabaseMetaDataBase.cxx b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx index b2a8671e9101..4d8b74d7a583 100644 --- a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx +++ b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx @@ -114,7 +114,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( ) throw(SQ ,DataType::INTEGER ,DataType::INTEGER }; - ::std::vector<ExpressionNodeSharedPtr> aConditions; + ::std::vector<std::shared_ptr<ExpressionNode>> aConditions; if ( aTypeInfoSettings.getLength() > 1 && ((aTypeInfoSettings.getLength() % 2) == 0) ) { const Any* pIter = aTypeInfoSettings.getConstArray(); @@ -145,8 +145,8 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( ) throw(SQ aRow.push_back(new ORowSetValueDecorator(aValue)); } - ::std::vector<ExpressionNodeSharedPtr>::iterator aIter = aConditions.begin(); - ::std::vector<ExpressionNodeSharedPtr>::const_iterator aEnd = aConditions.end(); + ::std::vector<std::shared_ptr<ExpressionNode>>::iterator aIter = aConditions.begin(); + ::std::vector<std::shared_ptr<ExpressionNode>>::const_iterator aEnd = aConditions.end(); for (; aIter != aEnd; ++aIter) { if ( (*aIter)->evaluate(aRow)->getValue().getBool() ) diff --git a/connectivity/source/commontools/TKey.cxx b/connectivity/source/commontools/TKey.cxx index 6f2c6b7d5378..057dce0e9df5 100644 --- a/connectivity/source/commontools/TKey.cxx +++ b/connectivity/source/commontools/TKey.cxx @@ -39,7 +39,7 @@ OTableKeyHelper::OTableKeyHelper(OTableHelper* _pTable) : connectivity::sdbcx::O OTableKeyHelper::OTableKeyHelper( OTableHelper* _pTable ,const OUString& Name - ,const sdbcx::TKeyProperties& _rProps + ,const std::shared_ptr<sdbcx::KeyProperties>& _rProps ) : connectivity::sdbcx::OKey(Name,_rProps,true) ,m_pTable(_pTable) { diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 5db35247f267..6359f904b28b 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -329,7 +329,7 @@ void OTableHelper::refreshPrimaryKeys(TStringVector& _rNames) if ( xResult.is() ) { - sdbcx::TKeyProperties pKeyProps(new sdbcx::KeyProperties(OUString(),KeyType::PRIMARY,0,0)); + std::shared_ptr<sdbcx::KeyProperties> pKeyProps(new sdbcx::KeyProperties(OUString(),KeyType::PRIMARY,0,0)); OUString aPkName; bool bAlreadyFetched = false; const Reference< XRow > xRow(xResult,UNO_QUERY); @@ -366,7 +366,7 @@ void OTableHelper::refreshForeignKeys(TStringVector& _rNames) if ( xRow.is() ) { - sdbcx::TKeyProperties pKeyProps; + std::shared_ptr<sdbcx::KeyProperties> pKeyProps; OUString aName,sCatalog,aSchema,sOldFKName; while( xResult->next() ) { @@ -577,9 +577,9 @@ void SAL_CALL OTableHelper::release() throw() OTable_TYPEDEF::release(); } -sdbcx::TKeyProperties OTableHelper::getKeyProperties(const OUString& _sName) const +std::shared_ptr<sdbcx::KeyProperties> OTableHelper::getKeyProperties(const OUString& _sName) const { - sdbcx::TKeyProperties pKeyProps; + std::shared_ptr<sdbcx::KeyProperties> pKeyProps; TKeyMap::const_iterator aFind = m_pImpl->m_aKeys.find(_sName); if ( aFind != m_pImpl->m_aKeys.end() ) { @@ -594,7 +594,7 @@ sdbcx::TKeyProperties OTableHelper::getKeyProperties(const OUString& _sName) con return pKeyProps; } -void OTableHelper::addKey(const OUString& _sName,const sdbcx::TKeyProperties& _aKeyProperties) +void OTableHelper::addKey(const OUString& _sName,const std::shared_ptr<sdbcx::KeyProperties>& _aKeyProperties) { m_pImpl->m_aKeys.insert(TKeyMap::value_type(_sName,_aKeyProperties)); } diff --git a/connectivity/source/inc/RowFunctionParser.hxx b/connectivity/source/inc/RowFunctionParser.hxx index a0a8849463a0..d74d880503eb 100644 --- a/connectivity/source/inc/RowFunctionParser.hxx +++ b/connectivity/source/inc/RowFunctionParser.hxx @@ -55,7 +55,6 @@ public: virtual void fill(const ODatabaseMetaDataResultSet::ORow& _aRow ) const = 0; }; -typedef std::shared_ptr< ExpressionNode > ExpressionNodeSharedPtr; /** This exception is thrown, when the arithmetic expression parser failed to parse a string. @@ -102,7 +101,7 @@ public: @return the generated function object. */ - static ExpressionNodeSharedPtr parseFunction( const OUString& _sFunction); + static std::shared_ptr<ExpressionNode> parseFunction( const OUString& _sFunction); private: // disabled constructor/destructor, since this is diff --git a/connectivity/source/sdbcx/VKey.cxx b/connectivity/source/sdbcx/VKey.cxx index bf8b0a92667d..ce448f78cd94 100644 --- a/connectivity/source/sdbcx/VKey.cxx +++ b/connectivity/source/sdbcx/VKey.cxx @@ -66,7 +66,7 @@ OKey::OKey(bool _bCase) : ODescriptor_BASE(m_aMutex) { } -OKey::OKey(const OUString& Name,const TKeyProperties& _rProps, bool _bCase) +OKey::OKey(const OUString& Name,const std::shared_ptr<KeyProperties>& _rProps, bool _bCase) : ODescriptor_BASE(m_aMutex) ,ODescriptor(ODescriptor_BASE::rBHelper,_bCase) ,m_aProps(_rProps) |