Kaydet (Commit) 12b2461a authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:passstringbyref

Change-Id: Ibd88c8d980072801f533103cd16d2c3a5e9b8fc5
üst 04fcf88c
...@@ -93,7 +93,7 @@ MacabRecords *MacabAddressBook::getMacabRecords() ...@@ -93,7 +93,7 @@ MacabRecords *MacabAddressBook::getMacabRecords()
/* Get the MacabRecords for a given name: either a group name or the /* Get the MacabRecords for a given name: either a group name or the
* default table name. * default table name.
*/ */
MacabRecords *MacabAddressBook::getMacabRecords(const OUString _tableName) MacabRecords *MacabAddressBook::getMacabRecords(const OUString& _tableName)
{ {
if(_tableName == getDefaultTableName()) if(_tableName == getDefaultTableName())
{ {
...@@ -106,7 +106,7 @@ MacabRecords *MacabAddressBook::getMacabRecords(const OUString _tableName) ...@@ -106,7 +106,7 @@ MacabRecords *MacabAddressBook::getMacabRecords(const OUString _tableName)
} }
MacabRecords *MacabAddressBook::getMacabRecordsMatch(const OUString _tableName) MacabRecords *MacabAddressBook::getMacabRecordsMatch(const OUString& _tableName)
{ {
if(match(_tableName, getDefaultTableName(), '\0')) if(match(_tableName, getDefaultTableName(), '\0'))
{ {
...@@ -155,7 +155,7 @@ MacabRecords *MacabAddressBook::getMacabRecordsMatch(const OUString _tableName) ...@@ -155,7 +155,7 @@ MacabRecords *MacabAddressBook::getMacabRecordsMatch(const OUString _tableName)
} }
MacabGroup *MacabAddressBook::getMacabGroup(OUString _groupName) MacabGroup *MacabAddressBook::getMacabGroup(OUString const & _groupName)
{ {
// initialize groups if not already initialized // initialize groups if not already initialized
if(m_bRetrievedGroups == sal_False) if(m_bRetrievedGroups == sal_False)
...@@ -179,7 +179,7 @@ MacabGroup *MacabAddressBook::getMacabGroup(OUString _groupName) ...@@ -179,7 +179,7 @@ MacabGroup *MacabAddressBook::getMacabGroup(OUString _groupName)
} }
MacabGroup *MacabAddressBook::getMacabGroupMatch(OUString _groupName) MacabGroup *MacabAddressBook::getMacabGroupMatch(OUString const & _groupName)
{ {
// initialize groups if not already initialized // initialize groups if not already initialized
if(m_bRetrievedGroups == sal_False) if(m_bRetrievedGroups == sal_False)
......
...@@ -51,11 +51,11 @@ namespace connectivity ...@@ -51,11 +51,11 @@ namespace connectivity
MacabRecords *getMacabRecords(); MacabRecords *getMacabRecords();
::std::vector<MacabGroup *> getMacabGroups(); ::std::vector<MacabGroup *> getMacabGroups();
MacabGroup *getMacabGroup(OUString _groupName); MacabGroup *getMacabGroup(const OUString& _groupName);
MacabRecords *getMacabRecords(const OUString _tableName); MacabRecords *getMacabRecords(const OUString& _tableName);
MacabGroup *getMacabGroupMatch(OUString _groupName); MacabGroup *getMacabGroupMatch(const OUString& _groupName);
MacabRecords *getMacabRecordsMatch(const OUString _tableName); MacabRecords *getMacabRecordsMatch(const OUString& _tableName);
}; };
} }
......
...@@ -264,7 +264,7 @@ sal_Int32 MacabHeader::compareFields(const macabfield *_field1, const macabfield ...@@ -264,7 +264,7 @@ sal_Int32 MacabHeader::compareFields(const macabfield *_field1, const macabfield
} }
sal_Int32 MacabHeader::getColumnNumber(const OUString s) const sal_Int32 MacabHeader::getColumnNumber(const OUString& s) const
{ {
sal_Int32 i; sal_Int32 i;
for(i = 0; i < size; i++) for(i = 0; i < size; i++)
......
...@@ -37,7 +37,7 @@ namespace connectivity ...@@ -37,7 +37,7 @@ namespace connectivity
void operator+= (const MacabHeader *r); void operator+= (const MacabHeader *r);
OUString getString(const sal_Int32 i) const; OUString getString(const sal_Int32 i) const;
void sortRecord(); void sortRecord();
sal_Int32 getColumnNumber(const OUString s) const; sal_Int32 getColumnNumber(const OUString& s) const;
static sal_Int32 compareFields(const macabfield *_field1, const macabfield *_field2); static sal_Int32 compareFields(const macabfield *_field1, const macabfield *_field2);
......
...@@ -223,7 +223,7 @@ sal_Int32 MacabRecord::compareFields(const macabfield *_field1, const macabfield ...@@ -223,7 +223,7 @@ sal_Int32 MacabRecord::compareFields(const macabfield *_field1, const macabfield
* between an OUString and a macabfield (for use when creating and handling * between an OUString and a macabfield (for use when creating and handling
* SQL statement). * SQL statement).
*/ */
macabfield *MacabRecord::createMacabField(const OUString _newFieldString, const ABPropertyType _abType) macabfield *MacabRecord::createMacabField(const OUString& _newFieldString, const ABPropertyType _abType)
{ {
macabfield *newField = NULL; macabfield *newField = NULL;
switch(_abType) switch(_abType)
......
...@@ -59,7 +59,7 @@ namespace connectivity ...@@ -59,7 +59,7 @@ namespace connectivity
macabfield *get(const sal_Int32 i) const; macabfield *get(const sal_Int32 i) const;
static sal_Int32 compareFields(const macabfield *_field1, const macabfield *_field2); static sal_Int32 compareFields(const macabfield *_field1, const macabfield *_field2);
static macabfield *createMacabField(const OUString _newFieldString, const ABPropertyType _abtype); static macabfield *createMacabField(const OUString& _newFieldString, const ABPropertyType _abtype);
static OUString fieldToString(const macabfield *_aField); static OUString fieldToString(const macabfield *_aField);
}; };
......
...@@ -229,7 +229,7 @@ macabfield *MacabRecords::getField(const sal_Int32 _recordNumber, const sal_Int3 ...@@ -229,7 +229,7 @@ macabfield *MacabRecords::getField(const sal_Int32 _recordNumber, const sal_Int3
} }
macabfield *MacabRecords::getField(const sal_Int32 _recordNumber, const OUString _columnName) const macabfield *MacabRecords::getField(const sal_Int32 _recordNumber, const OUString& _columnName) const
{ {
if(header != NULL) if(header != NULL)
{ {
...@@ -247,7 +247,7 @@ macabfield *MacabRecords::getField(const sal_Int32 _recordNumber, const OUString ...@@ -247,7 +247,7 @@ macabfield *MacabRecords::getField(const sal_Int32 _recordNumber, const OUString
} }
sal_Int32 MacabRecords::getFieldNumber(const OUString _columnName) const sal_Int32 MacabRecords::getFieldNumber(const OUString& _columnName) const
{ {
if(header != NULL) if(header != NULL)
return header->getColumnNumber(_columnName); return header->getColumnNumber(_columnName);
...@@ -895,7 +895,7 @@ MacabRecord *MacabRecords::createMacabRecord(const ABRecordRef _abrecord, const ...@@ -895,7 +895,7 @@ MacabRecord *MacabRecords::createMacabRecord(const ABRecordRef _abrecord, const
* receives the property value). It is called when we aren't given the * receives the property value). It is called when we aren't given the
* property's type already. * property's type already.
*/ */
void MacabRecords::insertPropertyIntoMacabRecord(MacabRecord *_abrecord, const MacabHeader *_header, const OUString _propertyName, const CFTypeRef _propertyValue) const void MacabRecords::insertPropertyIntoMacabRecord(MacabRecord *_abrecord, const MacabHeader *_header, const OUString& _propertyName, const CFTypeRef _propertyValue) const
{ {
CFTypeID cf_type = CFGetTypeID(_propertyValue); CFTypeID cf_type = CFGetTypeID(_propertyValue);
ABPropertyType ab_type = getABTypeFromCFType( cf_type ); ABPropertyType ab_type = getABTypeFromCFType( cf_type );
...@@ -908,7 +908,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(MacabRecord *_abrecord, const M ...@@ -908,7 +908,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(MacabRecord *_abrecord, const M
/* Inserts a given property into a MacabRecord. This method is recursive /* Inserts a given property into a MacabRecord. This method is recursive
* because properties can contain many sub-properties. * because properties can contain many sub-properties.
*/ */
void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyType, MacabRecord *_abrecord, const MacabHeader *_header, const OUString _propertyName, const CFTypeRef _propertyValue) const void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyType, MacabRecord *_abrecord, const MacabHeader *_header, const OUString& _propertyName, const CFTypeRef _propertyValue) const
{ {
/* If there is no value, return */ /* If there is no value, return */
if(_propertyValue == NULL) if(_propertyValue == NULL)
...@@ -1190,7 +1190,7 @@ void MacabRecords::swap(const sal_Int32 _id1, const sal_Int32 _id2) ...@@ -1190,7 +1190,7 @@ void MacabRecords::swap(const sal_Int32 _id1, const sal_Int32 _id2)
} }
void MacabRecords::setName(const OUString _sName) void MacabRecords::setName(const OUString& _sName)
{ {
m_sName = _sName; m_sName = _sName;
} }
......
...@@ -75,8 +75,8 @@ namespace connectivity ...@@ -75,8 +75,8 @@ namespace connectivity
MacabHeader *createHeaderForProperty(const ABPropertyType _propertyType, const CFTypeRef _propertyValue, const CFStringRef _propertyName) const; MacabHeader *createHeaderForProperty(const ABPropertyType _propertyType, const CFTypeRef _propertyValue, const CFStringRef _propertyName) const;
void manageDuplicateHeaders(macabfield **_headerNames, const sal_Int32 _length) const; void manageDuplicateHeaders(macabfield **_headerNames, const sal_Int32 _length) const;
ABPropertyType getABTypeFromCFType(const CFTypeID cf_type ) const; ABPropertyType getABTypeFromCFType(const CFTypeID cf_type ) const;
void insertPropertyIntoMacabRecord(MacabRecord *_abrecord, const MacabHeader *_header, const OUString _propertyName, const CFTypeRef _propertyValue) const; void insertPropertyIntoMacabRecord(MacabRecord *_abrecord, const MacabHeader *_header, const OUString& _propertyName, const CFTypeRef _propertyValue) const;
void insertPropertyIntoMacabRecord(const ABPropertyType _propertyType, MacabRecord *_abrecord, const MacabHeader *_header, const OUString _propertyName, const CFTypeRef _propertyValue) const; void insertPropertyIntoMacabRecord(const ABPropertyType _propertyType, MacabRecord *_abrecord, const MacabHeader *_header, const OUString& _propertyName, const CFTypeRef _propertyValue) const;
public: public:
MacabRecords(const ABAddressBookRef _addressBook, MacabHeader *_header, MacabRecord **_records, sal_Int32 _numRecords); MacabRecords(const ABAddressBookRef _addressBook, MacabHeader *_header, MacabRecord **_records, sal_Int32 _numRecords);
MacabRecords(const MacabRecords *_copy); MacabRecords(const MacabRecords *_copy);
...@@ -88,7 +88,7 @@ namespace connectivity ...@@ -88,7 +88,7 @@ namespace connectivity
void setHeader(MacabHeader *_header); void setHeader(MacabHeader *_header);
MacabHeader *getHeader() const; MacabHeader *getHeader() const;
void setName(const OUString _sName); void setName(const OUString& _sName);
OUString getName() const; OUString getName() const;
MacabRecord *insertRecord(MacabRecord *_newRecord, const sal_Int32 _location); MacabRecord *insertRecord(MacabRecord *_newRecord, const sal_Int32 _location);
...@@ -97,8 +97,8 @@ namespace connectivity ...@@ -97,8 +97,8 @@ namespace connectivity
void swap(const sal_Int32 _id1, const sal_Int32 _id2); void swap(const sal_Int32 _id1, const sal_Int32 _id2);
macabfield *getField(const sal_Int32 _recordNumber, const sal_Int32 _columnNumber) const; macabfield *getField(const sal_Int32 _recordNumber, const sal_Int32 _columnNumber) const;
macabfield *getField(const sal_Int32 _recordNumber, const OUString _columnName) const; macabfield *getField(const sal_Int32 _recordNumber, const OUString& _columnName) const;
sal_Int32 getFieldNumber(const OUString _columnName) const; sal_Int32 getFieldNumber(const OUString& _columnName) const;
sal_Int32 size() const; sal_Int32 size() const;
......
...@@ -127,7 +127,7 @@ void MacabResultSet::sortMacabRecords(const MacabOrder *pOrder) ...@@ -127,7 +127,7 @@ void MacabResultSet::sortMacabRecords(const MacabOrder *pOrder)
} }
void MacabResultSet::setTableName(OUString _sTableName) void MacabResultSet::setTableName(OUString const & _sTableName)
{ {
m_sTableName = _sTableName; m_sTableName = _sTableName;
} }
......
...@@ -101,7 +101,7 @@ namespace connectivity ...@@ -101,7 +101,7 @@ namespace connectivity
void allMacabRecords(); void allMacabRecords();
void someMacabRecords(const class MacabCondition *pCondition); void someMacabRecords(const class MacabCondition *pCondition);
void sortMacabRecords(const class MacabOrder *pOrder); void sortMacabRecords(const class MacabOrder *pOrder);
void setTableName(const OUString _sTableName); void setTableName(const OUString& _sTableName);
// ::cppu::OComponentHelper // ::cppu::OComponentHelper
virtual void SAL_CALL disposing(void); virtual void SAL_CALL disposing(void);
......
...@@ -30,7 +30,7 @@ using namespace com::sun::star::uno; ...@@ -30,7 +30,7 @@ using namespace com::sun::star::uno;
using namespace com::sun::star::lang; using namespace com::sun::star::lang;
using namespace com::sun::star::sdbc; using namespace com::sun::star::sdbc;
MacabResultSetMetaData::MacabResultSetMetaData(MacabConnection* _pConnection, OUString _sTableName) MacabResultSetMetaData::MacabResultSetMetaData(MacabConnection* _pConnection, OUString const & _sTableName)
: m_pConnection(_pConnection), : m_pConnection(_pConnection),
m_sTableName(_sTableName), m_sTableName(_sTableName),
m_aMacabFields() m_aMacabFields()
......
...@@ -47,7 +47,7 @@ namespace connectivity ...@@ -47,7 +47,7 @@ namespace connectivity
virtual ~MacabResultSetMetaData(); virtual ~MacabResultSetMetaData();
public: public:
MacabResultSetMetaData(MacabConnection* _pConnection, OUString _sTableName); MacabResultSetMetaData(MacabConnection* _pConnection, OUString const & _sTableName);
// avoid ambigous cast error from the compiler // avoid ambigous cast error from the compiler
inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw() inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
......
...@@ -97,7 +97,7 @@ namespace connectivity ...@@ -97,7 +97,7 @@ namespace connectivity
} }
inline OUString fixLabel(const OUString _originalLabel) inline OUString fixLabel(const OUString& _originalLabel)
{ {
/* Get the length, and make sure that there is actually a string /* Get the length, and make sure that there is actually a string
* here. * here.
......
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