clang-tidy performance-unnecessary-value-param in dbaccess

Change-Id: I9cec61867b4e6e8abde7749047974c6de87b9669
This commit is contained in:
Noel Grandin 2016-04-12 11:16:51 +02:00
parent f520af1735
commit dbd1f4b75a
19 changed files with 24 additions and 24 deletions

View File

@ -131,7 +131,7 @@ void OBookmarkSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition)
OCacheSet::fillValueRow(_rRow,_nPosition); OCacheSet::fillValueRow(_rRow,_nPosition);
} }
void OBookmarkSet::updateColumn(sal_Int32 nPos,Reference< XRowUpdate > _xParameter,const ORowSetValue& _rValue) void OBookmarkSet::updateColumn(sal_Int32 nPos, const Reference< XRowUpdate >& _xParameter, const ORowSetValue& _rValue)
{ {
if(_rValue.isBound() && _rValue.isModified()) if(_rValue.isBound() && _rValue.isModified())
{ {

View File

@ -30,7 +30,7 @@ namespace dbaccess
{ {
css::uno::Reference< css::sdbcx::XRowLocate> m_xRowLocate; css::uno::Reference< css::sdbcx::XRowLocate> m_xRowLocate;
void updateColumn(sal_Int32 nPos,css::uno::Reference< css::sdbc::XRowUpdate > _xParameter,const connectivity::ORowSetValue& _rValue); void updateColumn(sal_Int32 nPos, const css::uno::Reference< css::sdbc::XRowUpdate >& _xParameter, const connectivity::ORowSetValue& _rValue);
public: public:
explicit OBookmarkSet(sal_Int32 i_nMaxRows) : OCacheSet(i_nMaxRows) explicit OBookmarkSet(sal_Int32 i_nMaxRows) : OCacheSet(i_nMaxRows)
{} {}

View File

@ -154,7 +154,7 @@ namespace
/** transforms a parse node describing a complete statement into a pure select /** transforms a parse node describing a complete statement into a pure select
statement, without any filter/order/groupby/having clauses statement, without any filter/order/groupby/having clauses
*/ */
OUString getPureSelectStatement( const OSQLParseNode* _pRootNode, Reference< XConnection > _rxConnection ) OUString getPureSelectStatement( const OSQLParseNode* _pRootNode, const Reference< XConnection >& _rxConnection )
{ {
OUString sSQL = STR_SELECT; OUString sSQL = STR_SELECT;
_pRootNode->getChild(1)->parseNodeToStr( sSQL, _rxConnection ); _pRootNode->getChild(1)->parseNodeToStr( sSQL, _rxConnection );

View File

@ -115,7 +115,7 @@ void WrappedResultSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition)
OCacheSet::fillValueRow(_rRow,_nPosition); OCacheSet::fillValueRow(_rRow,_nPosition);
} }
void WrappedResultSet::updateColumn(sal_Int32 nPos,Reference< XRowUpdate > _xParameter,const ORowSetValue& _rValue) void WrappedResultSet::updateColumn(sal_Int32 nPos, const Reference< XRowUpdate >& _xParameter, const ORowSetValue& _rValue)
{ {
if(_rValue.isBound() && _rValue.isModified()) if(_rValue.isBound() && _rValue.isModified())
{ {

View File

@ -33,7 +33,7 @@ namespace dbaccess
css::uno::Reference< css::sdbc::XResultSetUpdate> m_xUpd; css::uno::Reference< css::sdbc::XResultSetUpdate> m_xUpd;
css::uno::Reference< css::sdbc::XRowUpdate> m_xUpdRow; css::uno::Reference< css::sdbc::XRowUpdate> m_xUpdRow;
void updateColumn(sal_Int32 nPos, css::uno::Reference< css::sdbc::XRowUpdate > _xParameter,const connectivity::ORowSetValue& _rValue); void updateColumn(sal_Int32 nPos, const css::uno::Reference< css::sdbc::XRowUpdate >& _xParameter, const connectivity::ORowSetValue& _rValue);
public: public:
explicit WrappedResultSet(sal_Int32 i_nMaxRows) : OCacheSet(i_nMaxRows) explicit WrappedResultSet(sal_Int32 i_nMaxRows) : OCacheSet(i_nMaxRows)
{} {}

View File

@ -53,14 +53,14 @@ namespace dbaccess
{ {
// ODefinitionContainer_Impl // ODefinitionContainer_Impl
void ODefinitionContainer_Impl::erase( TContentPtr _pDefinition ) void ODefinitionContainer_Impl::erase( const TContentPtr& _pDefinition )
{ {
NamedDefinitions::const_iterator aPos = find( _pDefinition ); NamedDefinitions::const_iterator aPos = find( _pDefinition );
if ( aPos != end() ) if ( aPos != end() )
m_aDefinitions.erase( aPos ); m_aDefinitions.erase( aPos );
} }
ODefinitionContainer_Impl::const_iterator ODefinitionContainer_Impl::find( TContentPtr _pDefinition ) const ODefinitionContainer_Impl::const_iterator ODefinitionContainer_Impl::find( const TContentPtr& _pDefinition ) const
{ {
return ::std::find_if( return ::std::find_if(
m_aDefinitions.begin(), m_aDefinitions.begin(),
@ -70,7 +70,7 @@ ODefinitionContainer_Impl::const_iterator ODefinitionContainer_Impl::find( TCont
}); });
} }
ODefinitionContainer_Impl::iterator ODefinitionContainer_Impl::find( TContentPtr _pDefinition ) ODefinitionContainer_Impl::iterator ODefinitionContainer_Impl::find( const TContentPtr& _pDefinition )
{ {
return ::std::find_if( return ::std::find_if(
m_aDefinitions.begin(), m_aDefinitions.begin(),

View File

@ -64,10 +64,10 @@ public:
inline const_iterator end() const { return m_aDefinitions.end(); } inline const_iterator end() const { return m_aDefinitions.end(); }
inline const_iterator find( const OUString& _rName ) const { return m_aDefinitions.find( _rName ); } inline const_iterator find( const OUString& _rName ) const { return m_aDefinitions.find( _rName ); }
const_iterator find( TContentPtr _pDefinition ) const; const_iterator find( const TContentPtr& _pDefinition ) const;
inline void erase( const OUString& _rName ) { m_aDefinitions.erase( _rName ); } inline void erase( const OUString& _rName ) { m_aDefinitions.erase( _rName ); }
void erase( TContentPtr _pDefinition ); void erase( const TContentPtr& _pDefinition );
inline void insert( const OUString& _rName, TContentPtr _pDefinition ) inline void insert( const OUString& _rName, TContentPtr _pDefinition )
{ {
@ -75,7 +75,7 @@ public:
} }
private: private:
iterator find( TContentPtr _pDefinition ); iterator find( const TContentPtr& _pDefinition );
// (for the moment, this is private. Make it public if needed. If really needed.) // (for the moment, this is private. Make it public if needed. If really needed.)
}; };

View File

@ -140,7 +140,7 @@ sal_Int32 ReadThroughComponent(
/// read a component (storage version) /// read a component (storage version)
sal_Int32 ReadThroughComponent( sal_Int32 ReadThroughComponent(
uno::Reference< embed::XStorage > xStorage, const uno::Reference< embed::XStorage >& xStorage,
const uno::Reference<XComponent>& xModelComponent, const uno::Reference<XComponent>& xModelComponent,
const sal_Char* pStreamName, const sal_Char* pStreamName,
const sal_Char* pCompatibilityStreamName, const sal_Char* pCompatibilityStreamName,

View File

@ -90,7 +90,7 @@ using namespace com::sun::star::frame;
namespace namespace
{ {
bool implCheckItemType( SfxItemSet& _rSet, const sal_uInt16 _nId, std::function<bool ( const SfxPoolItem* )> isItemType ) bool implCheckItemType( SfxItemSet& _rSet, const sal_uInt16 _nId, const std::function<bool ( const SfxPoolItem* )>& isItemType )
{ {
bool bCorrectType = false; bool bCorrectType = false;

View File

@ -71,7 +71,7 @@ namespace dbaui
void SetDefaultValue(const css::uno::Any& _rDefaultValue); void SetDefaultValue(const css::uno::Any& _rDefaultValue);
void SetControlDefault(const css::uno::Any& _rControlDefault); void SetControlDefault(const css::uno::Any& _rControlDefault);
void SetAutoIncrementValue(const OUString& _sAutoIncValue); void SetAutoIncrementValue(const OUString& _sAutoIncValue);
void SetType(TOTypeInfoSP _pType); void SetType(const TOTypeInfoSP& _pType);
void SetTypeValue(sal_Int32 _nType); void SetTypeValue(sal_Int32 _nType);
void SetTypeName(const OUString& _sTypeName); void SetTypeName(const OUString& _sTypeName);
void SetPrecision(const sal_Int32& _rPrecision); void SetPrecision(const sal_Int32& _rPrecision);

View File

@ -140,7 +140,7 @@ namespace dbaui
const css::uno::Sequence< css::beans::PropertyValue >& i_rFieldDescriptions const css::uno::Sequence< css::beans::PropertyValue >& i_rFieldDescriptions
); );
::connectivity::OSQLParseNode* getPredicateTreeFromEntry( OTableFieldDescRef pEntry, ::connectivity::OSQLParseNode* getPredicateTreeFromEntry( const OTableFieldDescRef& pEntry,
const OUString& _sCriteria, const OUString& _sCriteria,
OUString& _rsErrorMessage, OUString& _rsErrorMessage,
css::uno::Reference< css::beans::XPropertySet>& _rxColumn) const; css::uno::Reference< css::beans::XPropertySet>& _rxColumn) const;

View File

@ -166,7 +166,7 @@ namespace dbaui
getDataSourceByName( getDataSourceByName(
const OUString& _rDataSourceName, const OUString& _rDataSourceName,
vcl::Window* _pErrorMessageParent, vcl::Window* _pErrorMessageParent,
css::uno::Reference< css::uno::XComponentContext > _rxContext, const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
::dbtools::SQLExceptionInfo* _pErrorInfo ::dbtools::SQLExceptionInfo* _pErrorInfo
); );

View File

@ -87,7 +87,7 @@ namespace dbaui
protected: protected:
void implConstructFrom(const css::uno::Reference< css::container::XNameAccess >& _rxIndexes); void implConstructFrom(const css::uno::Reference< css::container::XNameAccess >& _rxIndexes);
static void implFillIndexInfo(OIndex& _rIndex, css::uno::Reference< css::beans::XPropertySet > _rxDescriptor); static void implFillIndexInfo(OIndex& _rIndex, const css::uno::Reference< css::beans::XPropertySet >& _rxDescriptor);
void implFillIndexInfo(OIndex& _rIndex); void implFillIndexInfo(OIndex& _rIndex);
}; };

View File

@ -209,7 +209,7 @@ SQLExceptionInfo createConnection( const Reference< css::beans::XPropertySet>&
} }
Reference< XDataSource > getDataSourceByName( const OUString& _rDataSourceName, Reference< XDataSource > getDataSourceByName( const OUString& _rDataSourceName,
vcl::Window* _pErrorMessageParent, Reference< XComponentContext > _rxContext, ::dbtools::SQLExceptionInfo* _pErrorInfo ) vcl::Window* _pErrorMessageParent, const Reference< XComponentContext >& _rxContext, ::dbtools::SQLExceptionInfo* _pErrorInfo )
{ {
Reference< XDatabaseContext > xDatabaseContext = DatabaseContext::create(_rxContext); Reference< XDatabaseContext > xDatabaseContext = DatabaseContext::create(_rxContext);

View File

@ -250,7 +250,7 @@ namespace dbaui
implFillIndexInfo(_rIndex, xIndex); implFillIndexInfo(_rIndex, xIndex);
} }
void OIndexCollection::implFillIndexInfo(OIndex& _rIndex, Reference< XPropertySet > _rxDescriptor) void OIndexCollection::implFillIndexInfo(OIndex& _rIndex, const Reference< XPropertySet >& _rxDescriptor)
{ {
static const char s_sPrimaryIndexPropertyName[] = "IsPrimaryKeyIndex"; static const char s_sPrimaryIndexPropertyName[] = "IsPrimaryKeyIndex";
static const char s_sUniquePropertyName[] = "IsUnique"; static const char s_sUniquePropertyName[] = "IsUnique";

View File

@ -124,7 +124,7 @@ namespace
} }
return sTableRange; return sTableRange;
} }
void insertConnection(const OQueryDesignView* _pView,const EJoinType& _eJoinType,OTableFieldDescRef _aDragLeft,OTableFieldDescRef _aDragRight,bool _bNatural = false) void insertConnection(const OQueryDesignView* _pView,const EJoinType& _eJoinType, const OTableFieldDescRef& _aDragLeft, const OTableFieldDescRef& _aDragRight, bool _bNatural = false)
{ {
OQueryTableView* pTableView = static_cast<OQueryTableView*>(_pView->getTableView()); OQueryTableView* pTableView = static_cast<OQueryTableView*>(_pView->getTableView());
OQueryTableConnection* pConn = static_cast<OQueryTableConnection*>( pTableView->GetTabConn(static_cast<OTableWindow*>(_aDragLeft->GetTabWindow()),static_cast<OTableWindow*>(_aDragRight->GetTabWindow()),true)); OQueryTableConnection* pConn = static_cast<OQueryTableConnection*>( pTableView->GetTabConn(static_cast<OTableWindow*>(_aDragLeft->GetTabWindow()),static_cast<OTableWindow*>(_aDragRight->GetTabWindow()),true));
@ -2998,7 +2998,7 @@ void OQueryDesignView::SaveUIConfig()
rCtrl.setSplitPos( m_aSplitter->GetSplitPosPixel() ); rCtrl.setSplitPos( m_aSplitter->GetSplitPosPixel() );
} }
OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(OTableFieldDescRef pEntry, OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(const OTableFieldDescRef& pEntry,
const OUString& _sCriteria, const OUString& _sCriteria,
OUString& _rsErrorMessage, OUString& _rsErrorMessage,
Reference<XPropertySet>& _rxColumn) const Reference<XPropertySet>& _rxColumn) const

View File

@ -1473,7 +1473,7 @@ Rectangle OSelectionBrowseBox::GetInvalidRect( sal_uInt16 nColId )
return aInvalidRect; return aInvalidRect;
} }
void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, sal_uInt16& _nColumnPosition) void OSelectionBrowseBox::InsertColumn(const OTableFieldDescRef& pEntry, sal_uInt16& _nColumnPosition)
{ {
// the control should have exactly one more column: the HandleColumn // the control should have exactly one more column: the HandleColumn
OSL_ENSURE(_nColumnPosition == BROWSER_INVALIDID || (_nColumnPosition <= (long)getFields().size()), "OSelectionBrowseBox::InsertColumn : invalid parameter nColId."); OSL_ENSURE(_nColumnPosition == BROWSER_INVALIDID || (_nColumnPosition <= (long)getFields().size()), "OSelectionBrowseBox::InsertColumn : invalid parameter nColId.");

View File

@ -84,7 +84,7 @@ namespace dbaui
void initialize(); void initialize();
OTableFieldDescRef InsertField( const OJoinExchangeData& jxdSource ); OTableFieldDescRef InsertField( const OJoinExchangeData& jxdSource );
OTableFieldDescRef InsertField( const OTableFieldDescRef& rInfo, sal_uInt16 _nColumnPosition = BROWSER_INVALIDID, bool bVis=true, bool bActivate=true ); OTableFieldDescRef InsertField( const OTableFieldDescRef& rInfo, sal_uInt16 _nColumnPosition = BROWSER_INVALIDID, bool bVis=true, bool bActivate=true );
void InsertColumn( OTableFieldDescRef pEntry, sal_uInt16& _nColumnPosition ); void InsertColumn( const OTableFieldDescRef& pEntry, sal_uInt16& _nColumnPosition );
void RemoveColumn( sal_uInt16 _nColumnId ); void RemoveColumn( sal_uInt16 _nColumnId );
void DeleteFields( const OUString& rAliasName ); void DeleteFields( const OUString& rAliasName );

View File

@ -326,7 +326,7 @@ void OFieldDescription::SetAutoIncrementValue(const OUString& _sAutoIncValue)
} }
} }
void OFieldDescription::SetType(TOTypeInfoSP _pType) void OFieldDescription::SetType(const TOTypeInfoSP& _pType)
{ {
m_pType = _pType; m_pType = _pType;
if ( m_pType.get() ) if ( m_pType.get() )