Kaydet (Commit) 5d456dc5 authored tarafından Noel Grandin's avatar Noel Grandin

dbaccess: prefer passing OUString by reference

Change-Id: I7cec02a40db48ce3d3003b3808d06ff0455a6eb4
üst 12bb4fdd
...@@ -437,14 +437,14 @@ Sequence< Sequence< PropertyValue > > SAL_CALL OSingleSelectQueryComposer::getSt ...@@ -437,14 +437,14 @@ Sequence< Sequence< PropertyValue > > SAL_CALL OSingleSelectQueryComposer::getSt
void SAL_CALL OSingleSelectQueryComposer::appendHavingClauseByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (SQLException, RuntimeException, std::exception) void SAL_CALL OSingleSelectQueryComposer::appendHavingClauseByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (SQLException, RuntimeException, std::exception)
{ {
SAL_INFO("dbaccess", "OSingleSelectQueryComposer::appendHavingClauseByColumn" ); SAL_INFO("dbaccess", "OSingleSelectQueryComposer::appendHavingClauseByColumn" );
::std::mem_fun1_t<bool,OSingleSelectQueryComposer,OUString> F_tmp(&OSingleSelectQueryComposer::implSetHavingClause); ::std::mem_fun1_t<bool,OSingleSelectQueryComposer,const OUString&> F_tmp(&OSingleSelectQueryComposer::implSetHavingClause);
setConditionByColumn(column,andCriteria,F_tmp,filterOperator); setConditionByColumn(column,andCriteria,F_tmp,filterOperator);
} }
void SAL_CALL OSingleSelectQueryComposer::appendFilterByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw(SQLException, RuntimeException, std::exception) void SAL_CALL OSingleSelectQueryComposer::appendFilterByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw(SQLException, RuntimeException, std::exception)
{ {
SAL_INFO("dbaccess", "OSingleSelectQueryComposer::appendFilterByColumn" ); SAL_INFO("dbaccess", "OSingleSelectQueryComposer::appendFilterByColumn" );
::std::mem_fun1_t<bool,OSingleSelectQueryComposer,OUString> F_tmp(&OSingleSelectQueryComposer::implSetFilter); ::std::mem_fun1_t<bool,OSingleSelectQueryComposer,const OUString&> F_tmp(&OSingleSelectQueryComposer::implSetFilter);
setConditionByColumn(column,andCriteria,F_tmp,filterOperator); setConditionByColumn(column,andCriteria,F_tmp,filterOperator);
} }
...@@ -643,8 +643,8 @@ void SAL_CALL OSingleSelectQueryComposer::setElementaryQuery( const OUString& _r ...@@ -643,8 +643,8 @@ void SAL_CALL OSingleSelectQueryComposer::setElementaryQuery( const OUString& _r
namespace namespace
{ {
OUString getComposedClause( const OUString _rElementaryClause, const OUString _rAdditionalClause, OUString getComposedClause( const OUString& _rElementaryClause, const OUString& _rAdditionalClause,
TokenComposer& _rComposer, const OUString _rKeyword ) TokenComposer& _rComposer, const OUString& _rKeyword )
{ {
_rComposer.clear(); _rComposer.clear();
_rComposer.append( _rElementaryClause ); _rComposer.append( _rElementaryClause );
...@@ -1548,7 +1548,7 @@ void SAL_CALL OSingleSelectQueryComposer::setStructuredHavingClause( const Seque ...@@ -1548,7 +1548,7 @@ void SAL_CALL OSingleSelectQueryComposer::setStructuredHavingClause( const Seque
setHavingClause(lcl_getCondition(filter,aPredicateInput,getColumns())); setHavingClause(lcl_getCondition(filter,aPredicateInput,getColumns()));
} }
void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria ,::std::mem_fun1_t<bool,OSingleSelectQueryComposer,OUString>& _aSetFunctor,sal_Int32 filterOperator) void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria ,::std::mem_fun1_t<bool,OSingleSelectQueryComposer,const OUString& >& _aSetFunctor,sal_Int32 filterOperator)
{ {
SAL_INFO("dbaccess", "OSingleSelectQueryComposer::setConditionByColumn" ); SAL_INFO("dbaccess", "OSingleSelectQueryComposer::setConditionByColumn" );
::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed); ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
......
...@@ -349,7 +349,7 @@ namespace ...@@ -349,7 +349,7 @@ namespace
} }
} }
static Sequence< PropertyValue > lcl_appendFileNameToDescriptor( const ::comphelper::NamedValueCollection& _rDescriptor, const OUString _rURL ) static Sequence< PropertyValue > lcl_appendFileNameToDescriptor( const ::comphelper::NamedValueCollection& _rDescriptor, const OUString& _rURL )
{ {
::comphelper::NamedValueCollection aMutableDescriptor( _rDescriptor ); ::comphelper::NamedValueCollection aMutableDescriptor( _rDescriptor );
if ( !_rURL.isEmpty() ) if ( !_rURL.isEmpty() )
......
...@@ -133,7 +133,7 @@ namespace dbaccess ...@@ -133,7 +133,7 @@ namespace dbaccess
void setConditionByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column void setConditionByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column
, sal_Bool andCriteria , sal_Bool andCriteria
,::std::mem_fun1_t<bool,OSingleSelectQueryComposer,OUString>& _aSetFunctor ,::std::mem_fun1_t<bool,OSingleSelectQueryComposer,const OUString& >& _aSetFunctor
,sal_Int32 filterOperator); ,sal_Int32 filterOperator);
/** getStructuredCondition returns the structured condition for the where or having clause /** getStructuredCondition returns the structured condition for the where or having clause
...@@ -150,8 +150,8 @@ namespace dbaccess ...@@ -150,8 +150,8 @@ namespace dbaccess
setCurrentColumns( EColumnType _eType, const ::rtl::Reference< ::connectivity::OSQLColumns >& _rCols ); setCurrentColumns( EColumnType _eType, const ::rtl::Reference< ::connectivity::OSQLColumns >& _rCols );
//helper methods for mem_fun_t //helper methods for mem_fun_t
inline bool implSetFilter(OUString _sFilter) { setFilter(_sFilter); return true;} inline bool implSetFilter(const OUString& _sFilter) { setFilter(_sFilter); return true;}
inline bool implSetHavingClause(OUString _sFilter) { setHavingClause(_sFilter); return true;} inline bool implSetHavingClause(const OUString& _sFilter) { setHavingClause(_sFilter); return true;}
/** returns the part of the seelect statement /** returns the part of the seelect statement
@param _ePart @param _ePart
......
...@@ -371,7 +371,7 @@ namespace dbmm ...@@ -371,7 +371,7 @@ namespace dbmm
{ {
bool lcl_equalURLs_nothrow( bool lcl_equalURLs_nothrow(
const Reference< XComponentContext >& context, const Reference< XComponentContext >& context,
const OUString& _lhs, const OUString _rhs ) const OUString& _lhs, const OUString& _rhs )
{ {
// the cheap situation: the URLs are equal // the cheap situation: the URLs are equal
if ( _lhs == _rhs ) if ( _lhs == _rhs )
......
...@@ -341,7 +341,7 @@ sal_Bool OTableGrantControl::isAllowed(sal_uInt16 _nColumnId,sal_Int32 _nPrivile ...@@ -341,7 +341,7 @@ sal_Bool OTableGrantControl::isAllowed(sal_uInt16 _nColumnId,sal_Int32 _nPrivile
return bAllowed; return bAllowed;
} }
void OTableGrantControl::setUserName(const OUString _sUserName) void OTableGrantControl::setUserName(const OUString& _sUserName)
{ {
m_sUserName = _sUserName; m_sUserName = _sUserName;
m_aPrivMap = TTablePrivilegeMap(); m_aPrivMap = TTablePrivilegeMap();
......
...@@ -40,7 +40,7 @@ using namespace ::svt; ...@@ -40,7 +40,7 @@ using namespace ::svt;
const OString aGroupIdent("dBase III"); const OString aGroupIdent("dBase III");
ODbaseIndexDialog::ODbaseIndexDialog(Window * pParent, OUString aDataSrcName) ODbaseIndexDialog::ODbaseIndexDialog(Window * pParent, const OUString& aDataSrcName)
: ModalDialog(pParent, "DBaseIndexDialog", "dbaccess/ui/dbaseindexdialog.ui") : ModalDialog(pParent, "DBaseIndexDialog", "dbaccess/ui/dbaseindexdialog.ui")
, m_aDSN(aDataSrcName) , m_aDSN(aDataSrcName)
, m_bCaseSensitiv(true) , m_bCaseSensitiv(true)
......
...@@ -112,7 +112,7 @@ protected: ...@@ -112,7 +112,7 @@ protected:
void checkButtons(); void checkButtons();
public: public:
ODbaseIndexDialog( Window * pParent, OUString aDataSrcName ); ODbaseIndexDialog( Window * pParent, const OUString& aDataSrcName );
}; };
} // namespace dbaui } // namespace dbaui
......
...@@ -354,7 +354,7 @@ namespace dbaui ...@@ -354,7 +354,7 @@ namespace dbaui
return _inout_rDisplayName.getLength() > 0; return _inout_rDisplayName.getLength() > 0;
} }
void OGeneralPage::insertDatasourceTypeEntryData(const OUString& _sType, OUString sDisplayName) void OGeneralPage::insertDatasourceTypeEntryData(const OUString& _sType, const OUString& sDisplayName)
{ {
// insert a (temporary) entry // insert a (temporary) entry
sal_uInt16 nPos = m_pDatasourceType->InsertEntry(sDisplayName); sal_uInt16 nPos = m_pDatasourceType->InsertEntry(sDisplayName);
...@@ -363,7 +363,7 @@ namespace dbaui ...@@ -363,7 +363,7 @@ namespace dbaui
m_aURLPrefixes[nPos] = _sType; m_aURLPrefixes[nPos] = _sType;
} }
void OGeneralPageWizard::insertEmbeddedDBTypeEntryData(const OUString& _sType, OUString sDisplayName) void OGeneralPageWizard::insertEmbeddedDBTypeEntryData(const OUString& _sType, const OUString& sDisplayName)
{ {
// insert a (temporary) entry // insert a (temporary) entry
sal_uInt16 nPos = m_pEmbeddedDBType->InsertEntry(sDisplayName); sal_uInt16 nPos = m_pEmbeddedDBType->InsertEntry(sDisplayName);
......
...@@ -54,7 +54,7 @@ namespace dbaui ...@@ -54,7 +54,7 @@ namespace dbaui
sal_Bool m_bDisplayingInvalid : 1; // the currently displayed data source is deleted sal_Bool m_bDisplayingInvalid : 1; // the currently displayed data source is deleted
bool m_bInitTypeList : 1; bool m_bInitTypeList : 1;
bool approveDatasourceType( const OUString& _sURLPrefix, OUString& _inout_rDisplayName ); bool approveDatasourceType( const OUString& _sURLPrefix, OUString& _inout_rDisplayName );
void insertDatasourceTypeEntryData( const OUString& _sType, OUString sDisplayName ); void insertDatasourceTypeEntryData( const OUString& _sType, const OUString& sDisplayName );
protected: protected:
ListBox* m_pDatasourceType; ListBox* m_pDatasourceType;
...@@ -159,7 +159,7 @@ namespace dbaui ...@@ -159,7 +159,7 @@ namespace dbaui
m_aControlDependencies; m_aControlDependencies;
bool m_bInitEmbeddedDBList : 1; bool m_bInitEmbeddedDBList : 1;
void insertEmbeddedDBTypeEntryData( const OUString& _sType, OUString sDisplayName ); void insertEmbeddedDBTypeEntryData( const OUString& _sType, const OUString& sDisplayName );
public: public:
void SetCreationModeHandler( const Link& _rHandler ) { m_aCreationModeHandler = _rHandler; } void SetCreationModeHandler( const Link& _rHandler ) { m_aCreationModeHandler = _rHandler; }
......
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
OTableGrantControl( Window* pParent,const ResId& _RsId); OTableGrantControl( Window* pParent,const ResId& _RsId);
virtual ~OTableGrantControl(); virtual ~OTableGrantControl();
void UpdateTables(); void UpdateTables();
void setUserName(const OUString _sUserName); void setUserName(const OUString& _sUserName);
void setGrantUser(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XAuthorizable>& _xGrantUser); void setGrantUser(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XAuthorizable>& _xGrantUser);
void setTablesSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier >& _xTablesSup); void setTablesSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier >& _xTablesSup);
......
...@@ -84,7 +84,7 @@ namespace dbaui ...@@ -84,7 +84,7 @@ namespace dbaui
return s_aMappings; return s_aMappings;
} }
static const FeatureSet& lcl_getFeatureSet( const OUString _rURL ) static const FeatureSet& lcl_getFeatureSet( const OUString& _rURL )
{ {
typedef ::std::map< OUString, FeatureSet > FeatureSets; typedef ::std::map< OUString, FeatureSet > FeatureSets;
static FeatureSets s_aFeatureSets; static FeatureSets s_aFeatureSets;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment