diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-10 12:30:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-10 13:07:41 +0100 |
commit | 175a2063effa1c5a3eab896c6c4b0d07f3588edb (patch) | |
tree | 4a252a7e9e6e714343e9ff21c3d78c8e41086009 /connectivity | |
parent | ddf901664d3dd12191f98b77182652a6889f2b26 (diff) |
use more std::make_shared
found using 'git grep', I tried using clang-tidy, but it only
successfully found a tiny fraction of these
Change-Id: I61c7d85105ff7a911722750e759d6641d578da33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/RowFunctionParser.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/commontools/TTableHelper.cxx | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/connectivity/source/commontools/RowFunctionParser.cxx b/connectivity/source/commontools/RowFunctionParser.cxx index d158994d5b5a..b970d93f5a9a 100644 --- a/connectivity/source/commontools/RowFunctionParser.cxx +++ b/connectivity/source/commontools/RowFunctionParser.cxx @@ -157,7 +157,7 @@ public: void operator()( StringIteratorT rFirst,StringIteratorT rSecond) const { OUString sVal( rFirst, rSecond - rFirst, RTL_TEXTENCODING_UTF8 ); - mpContext->maOperandStack.push( std::shared_ptr<ExpressionNode>( new ConstantValueExpression( new ORowSetValueDecorator( sVal ) ) ) ); + mpContext->maOperandStack.push( std::make_shared<ConstantValueExpression>( new ORowSetValueDecorator( sVal ) ) ); } }; @@ -174,7 +174,7 @@ public: } void operator()( sal_Int32 n ) const { - mpContext->maOperandStack.push( std::shared_ptr<ExpressionNode>( new ConstantValueExpression( new ORowSetValueDecorator( n ) ) ) ); + mpContext->maOperandStack.push( std::make_shared<ConstantValueExpression>( new ORowSetValueDecorator( n ) ) ); } }; @@ -212,7 +212,7 @@ public: rNodeStack.pop(); // create combined ExpressionNode - std::shared_ptr<ExpressionNode> pNode( new BinaryFunctionExpression( meFunct, pFirstArg, pSecondArg ) ); + auto pNode = std::make_shared<BinaryFunctionExpression>( meFunct, pFirstArg, pSecondArg ); // check for constness rNodeStack.push( pNode ); } @@ -260,7 +260,7 @@ public: std::shared_ptr<ExpressionNode> pArg( std::move(rNodeStack.top()) ); rNodeStack.pop(); - rNodeStack.push( std::shared_ptr<ExpressionNode>( new UnaryFunctionExpression( pArg ) ) ); + rNodeStack.push( std::make_shared<UnaryFunctionExpression>( pArg ) ); } }; diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index f9e91f180763..5086f7e8500a 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -317,7 +317,7 @@ void OTableHelper::refreshPrimaryKeys(::std::vector< OUString>& _rNames) if ( xResult.is() ) { - std::shared_ptr<sdbcx::KeyProperties> pKeyProps(new sdbcx::KeyProperties(OUString(),KeyType::PRIMARY,0,0)); + auto pKeyProps = std::make_shared<sdbcx::KeyProperties>(OUString(),KeyType::PRIMARY,0,0); OUString aPkName; bool bAlreadyFetched = false; const Reference< XRow > xRow(xResult,UNO_QUERY); |