diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-16 15:23:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-17 08:25:47 +0200 |
commit | ccb2a1f650bc505f8a4f1abebf8ce4f9396562a8 (patch) | |
tree | 2ee2fd4f300ae95cf23bade1f242e02f9b276c07 /dbaccess | |
parent | da5c3a1ee43dd1a07cbd1b8005488bf05432593d (diff) |
clang-tidy readability-redundant-smartptr-get
redundant get() call on smart pointer
Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd
Reviewed-on: https://gerrit.libreoffice.org/61837
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/KeySet.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSet.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetBase.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlExport.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlHelper.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlfilter.cxx | 22 | ||||
-rw-r--r-- | dbaccess/source/ui/control/RelationControl.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/adtabdlg.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/DExport.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/controllerframe.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/JoinController.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/QueryDesignView.cxx | 10 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/querycontroller.cxx | 2 |
14 files changed, 36 insertions, 32 deletions
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 5b4f64891c76..52686ba92045 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -809,7 +809,8 @@ void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow, ORowSetRow const & _rK aValue.setSigned(m_aSignedFlags[parameterName.second.nPosition-1]); if ( (_rInsertRow->get())[parameterName.second.nPosition] != aValue ) { - rtl::Reference<ORowSetValueVector> aCopy(new ORowSetValueVector(*m_aParameterValueForCache.get())); + rtl::Reference<ORowSetValueVector> aCopy( + new ORowSetValueVector(*m_aParameterValueForCache)); (aCopy->get())[i] = (_rInsertRow->get())[parameterName.second.nPosition]; m_aUpdatedParameter[i_nBookmark] = aCopy; bChanged = true; diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 4d2787ef6d2d..8d6d7c60e798 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -1704,7 +1704,9 @@ Reference< XResultSet > ORowSet::impl_prepareAndExecute_throw() { DELETEZ(m_pCache); } - m_pCache = new ORowSetCache( xResultSet, m_xComposer.get(), m_aContext, aComposedUpdateTableName, m_bModified, m_bNew, *m_aParameterValueForCache.get(),m_aFilter,m_nMaxRows ); + m_pCache + = new ORowSetCache(xResultSet, m_xComposer.get(), m_aContext, aComposedUpdateTableName, + m_bModified, m_bNew, *m_aParameterValueForCache, m_aFilter, m_nMaxRows); if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY ) { m_nPrivileges = Privilege::SELECT; diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index 7518cacf1cd7..50df0f2e01ba 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -1412,14 +1412,14 @@ void ORowSetNotifier::fire() std::vector<sal_Int32>& ORowSetNotifier::getChangedColumns() const { - OSL_ENSURE(m_pImpl.get(),"Illegal CTor call, use the other one!"); + OSL_ENSURE(m_pImpl, "Illegal CTor call, use the other one!"); return m_pImpl->aChangedColumns; } void ORowSetNotifier::firePropertyChange() { - OSL_ENSURE(m_pImpl.get(),"Illegal CTor call, use the other one!"); - if( m_pImpl.get() ) + OSL_ENSURE(m_pImpl, "Illegal CTor call, use the other one!"); + if (m_pImpl) { for (auto const& changedColumn : m_pImpl->aChangedColumns) { diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index cfac370ca6b0..06d453d645bb 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -773,8 +773,9 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) // normalize the statement so that it doesn't contain any application-level features anymore OUString sError; const std::unique_ptr< OSQLParseNode > pStatementTree( m_aSqlParser.parseTree( sError, sSQL ) ); - OSL_ENSURE( pStatementTree.get(), "OSingleSelectQueryComposer::getColumns: could not parse the column retrieval statement!" ); - if ( pStatementTree.get() ) + OSL_ENSURE(pStatementTree, "OSingleSelectQueryComposer::getColumns: could not parse the " + "column retrieval statement!"); + if (pStatementTree) if ( !pStatementTree->parseNodeToExecutableStatement( sSQL, m_xConnection, m_aSqlParser, nullptr ) ) break; @@ -1768,7 +1769,7 @@ Sequence< Sequence< PropertyValue > > OSingleSelectQueryComposer::getStructuredC OUString aErrorMsg; std::unique_ptr<OSQLParseNode> pSqlParseNode( m_aSqlParser.parseTree(aErrorMsg,aSql)); - if ( pSqlParseNode.get() ) + if (pSqlParseNode) { m_aAdditiveIterator.setParseTree(pSqlParseNode.get()); // normalize the filter diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 11e3c9768e9f..8f3f5757321e 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -749,7 +749,7 @@ void ODBExport::exportDelimiter() void ODBExport::exportAutoIncrement() { - if ( m_aAutoIncrement.get() ) + if (m_aAutoIncrement) { AddAttribute(XML_NAMESPACE_DB, XML_ADDITIONAL_COLUMN_STATEMENT,m_aAutoIncrement->second); AddAttribute(XML_NAMESPACE_DB, XML_ROW_RETRIEVING_STATEMENT,m_aAutoIncrement->first); diff --git a/dbaccess/source/filter/xml/xmlHelper.cxx b/dbaccess/source/filter/xml/xmlHelper.cxx index bcdc8d2a24a3..16385e7d0df6 100644 --- a/dbaccess/source/filter/xml/xmlHelper.cxx +++ b/dbaccess/source/filter/xml/xmlHelper.cxx @@ -52,7 +52,7 @@ const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32 switch (_nType) { case XML_DB_TYPE_EQUAL: - if ( !m_pDisplayHandler.get() ) + if (!m_pDisplayHandler) { static const SvXMLEnumMapEntry<bool> aDisplayMap[] = { diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index b99d19d905ee..8b34d35f4be4 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -629,7 +629,7 @@ void ODBFilter::fillPropertyMap(const Any& _rValue,TPropertyNameMap& _rMap) const SvXMLTokenMap& ODBFilter::GetDocElemTokenMap() const { - if ( !m_pDocElemTokenMap.get() ) + if (!m_pDocElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -648,7 +648,7 @@ const SvXMLTokenMap& ODBFilter::GetDocElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetDocContentElemTokenMap() const { - if (!m_pDocContentElemTokenMap.get()) + if (!m_pDocContentElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -669,7 +669,7 @@ const SvXMLTokenMap& ODBFilter::GetDocContentElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetDatabaseElemTokenMap() const { - if ( !m_pDatabaseElemTokenMap.get() ) + if (!m_pDatabaseElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -690,7 +690,7 @@ const SvXMLTokenMap& ODBFilter::GetDatabaseElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetDataSourceElemTokenMap() const { - if ( !m_pDataSourceElemTokenMap.get() ) + if (!m_pDataSourceElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -742,7 +742,7 @@ const SvXMLTokenMap& ODBFilter::GetDataSourceElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetLoginElemTokenMap() const { - if ( !m_pLoginElemTokenMap.get() ) + if (!m_pLoginElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -760,7 +760,7 @@ const SvXMLTokenMap& ODBFilter::GetLoginElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetDatabaseDescriptionElemTokenMap() const { - if ( !m_pDatabaseDescriptionElemTokenMap.get() ) + if (!m_pDatabaseDescriptionElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -776,7 +776,7 @@ const SvXMLTokenMap& ODBFilter::GetDatabaseDescriptionElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetDataSourceInfoElemTokenMap() const { - if ( !m_pDataSourceInfoElemTokenMap.get() ) + if (!m_pDataSourceInfoElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -803,7 +803,7 @@ const SvXMLTokenMap& ODBFilter::GetDataSourceInfoElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetDocumentsElemTokenMap() const { - if ( !m_pDocumentsElemTokenMap.get() ) + if (!m_pDocumentsElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -824,7 +824,7 @@ const SvXMLTokenMap& ODBFilter::GetDocumentsElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetComponentElemTokenMap() const { - if ( !m_pComponentElemTokenMap.get() ) + if (!m_pComponentElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -844,7 +844,7 @@ const SvXMLTokenMap& ODBFilter::GetComponentElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetQueryElemTokenMap() const { - if ( !m_pQueryElemTokenMap.get() ) + if (!m_pQueryElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -869,7 +869,7 @@ const SvXMLTokenMap& ODBFilter::GetQueryElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetColumnElemTokenMap() const { - if ( !m_pColumnElemTokenMap.get() ) + if (!m_pColumnElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index aea44e1b4bc7..a9ae4dff51b0 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -402,7 +402,7 @@ namespace dbaui OConnectionLineDataVec& rLines = m_pConnData->GetConnLineDataList(); for( const auto& rLine : rLines ) { - rLine.get()->Reset(); + rLine->Reset(); } m_pConnData->setReferencingTable(_pSource->GetData()); diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index ddee752f5376..3d12fe670f9a 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -401,7 +401,7 @@ void OAddTableDlg::impl_switchTo( ObjectList _eList ) void OAddTableDlg::Update() { - if ( !m_xCurrentList.get() ) + if (!m_xCurrentList) impl_switchTo( Tables ); else m_xCurrentList->updateTableObjectList( m_rContext.allowViews() ); diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index fec63a5630f3..d5032b306f85 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -674,7 +674,7 @@ bool ODatabaseExport::createRowSet() { m_pUpdateHelper.reset(new OParameterUpdateHelper(createPreparedStatment(m_xConnection->getMetaData(),m_xTable,m_vColumnPositions))); - return m_pUpdateHelper.get() != nullptr; + return m_pUpdateHelper != nullptr; } bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTextColor, const FontDescriptor& _rFont) diff --git a/dbaccess/source/ui/misc/controllerframe.cxx b/dbaccess/source/ui/misc/controllerframe.cxx index 93361c7a74fc..4bd0c9e4426d 100644 --- a/dbaccess/source/ui/misc/controllerframe.cxx +++ b/dbaccess/source/ui/misc/controllerframe.cxx @@ -119,7 +119,7 @@ namespace dbaui static void lcl_setFrame_nothrow( ControllerFrame_Data& _rData, const Reference< XFrame >& _rxFrame ) { // release old listener - if ( _rData.m_pListener.get() ) + if (_rData.m_pListener) { _rData.m_pListener->dispose(); _rData.m_pListener = nullptr; diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 34efc1019ae5..f41438313952 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -220,7 +220,7 @@ FeatureState OJoinController::GetState(sal_uInt16 _nId) const AddTableDialogContext& OJoinController::impl_getDialogContext() const { - if ( !m_pDialogContext.get() ) + if (!m_pDialogContext) { OJoinController* pNonConstThis = const_cast< OJoinController* >( this ); pNonConstThis->m_pDialogContext.reset( new AddTableDialogContext( *pNonConstThis ) ); diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index f977ec528d03..e605156daebc 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -768,7 +768,7 @@ namespace OUString aErrorMsg; Reference<XPropertySet> xColumn; std::unique_ptr< ::connectivity::OSQLParseNode> pParseNode(_pView->getPredicateTreeFromEntry(field,aCriteria,aErrorMsg,xColumn)); - if (pParseNode.get()) + if (pParseNode) { if (bMulti && !(field->isOtherFunction() || (aFieldName.toChar() == '*'))) pParseNode->replaceNodeValue(field->GetAlias(),aFieldName); @@ -798,7 +798,7 @@ namespace OUString aErrorMsg; Reference<XPropertySet> xColumn; std::unique_ptr< ::connectivity::OSQLParseNode> pParseNode( _pView->getPredicateTreeFromEntry(field,aCriteria,aErrorMsg,xColumn)); - if (pParseNode.get()) + if (pParseNode) { if (bMulti && !(field->isOtherFunction() || (aFieldName.toChar() == '*'))) pParseNode->replaceNodeValue(field->GetAlias(),aFieldName); @@ -1125,7 +1125,7 @@ namespace OUString aErrorMsg; Reference<XPropertySet> xColumn; std::unique_ptr< ::connectivity::OSQLParseNode> pParseNode(_pView->getPredicateTreeFromEntry(field,aTmp,aErrorMsg,xColumn)); - if (pParseNode.get()) + if (pParseNode) { OUString sGroupBy; pParseNode->getChild(0)->parseNodeToStr( sGroupBy, @@ -2824,7 +2824,7 @@ OUString OQueryDesignView::getStatement() ::connectivity::OSQLParser& rParser( rController.getParser() ); OUString sErrorMessage; std::unique_ptr<OSQLParseNode> pParseNode( rParser.parseTree( sErrorMessage, sSQL, true ) ); - if ( pParseNode.get() ) + if (pParseNode) { OSQLParseNode* pNode = pParseNode->getChild(3)->getChild(1); if ( pNode->count() > 1 ) @@ -2934,7 +2934,7 @@ OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(const OTableFieldDesc sSql += "SELECT * FROM x WHERE " + pEntry->GetField() + _sCriteria; std::unique_ptr<OSQLParseNode> pParseNode( rParser.parseTree( _rsErrorMessage, sSql, true ) ); nType = DataType::DOUBLE; - if ( pParseNode.get() ) + if (pParseNode) { OSQLParseNode* pColumnRef = pParseNode->getByRule(OSQLParseNode::column_ref); if ( pColumnRef ) diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 7026e023ef87..ff240a54130e 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -1711,7 +1711,7 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings std::unique_ptr< ::connectivity::OSQLParseNode > pNode( m_aSqlParser.parseTree( aErrorMsg, m_sStatement, m_bGraphicalDesign ) ); - if ( pNode.get() ) + if (pNode) { delete m_pSqlIterator->getParseTree(); m_pSqlIterator->setParseTree( pNode.release() ); |