From 08fe82e59cbc598d2683d72877653316c1e41962 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 13 Dec 2013 09:29:22 +0200 Subject: Remove unnecessary use of OUString constructor in + expressions Convert code like aFilename = OUString::number(nFilePostfixCount) + OUString(".bmp"); to aFilename = OUString::number(nFilePostfixCount) + ".bmp"; Change-Id: I03f513ad1c8ec8846b2afbdc67ab12525ed07e50 --- connectivity/source/commontools/TIndexes.cxx | 4 +--- connectivity/source/commontools/TTableHelper.cxx | 2 +- connectivity/source/drivers/ado/AStatement.cxx | 2 +- connectivity/source/drivers/macab/MacabRecords.cxx | 14 +++++++------- connectivity/source/drivers/mork/MConnection.cxx | 4 ++-- connectivity/source/drivers/mork/MNSFolders.cxx | 2 +- connectivity/source/drivers/mork/MStatement.cxx | 2 +- connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx | 2 +- connectivity/source/drivers/mysql/YUsers.cxx | 2 +- 9 files changed, 16 insertions(+), 18 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx index 6c89a81b3458..f9aa564b07a7 100644 --- a/connectivity/source/commontools/TIndexes.cxx +++ b/connectivity/source/commontools/TIndexes.cxx @@ -232,9 +232,7 @@ void OIndexesHelper::dropObject(sal_Int32 /*_nPos*/,const OUString _sElementName OUString sIndexName,sTemp; sIndexName = dbtools::composeTableName( m_pTable->getMetaData(), sTemp, aSchema, aName, sal_True, ::dbtools::eInIndexDefinitions ); - aSql += sIndexName - + OUString(" ON ") - + aComposedName; + aSql += sIndexName + " ON " + aComposedName; Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); if ( xStmt.is() ) diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 98dde62d2947..e7e4da0ec9fe 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -520,7 +520,7 @@ void SAL_CALL OTableHelper::rename( const OUString& newName ) throw(SQLException OUString sComposedName; sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sal_True,::dbtools::eInDataManipulation); sSql += sComposedName - + OUString(" TO "); + + " TO "; sComposedName = ::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,sal_True,::dbtools::eInDataManipulation); sSql += sComposedName; diff --git a/connectivity/source/drivers/ado/AStatement.cxx b/connectivity/source/drivers/ado/AStatement.cxx index c02397ee92da..404101ebe57c 100644 --- a/connectivity/source/drivers/ado/AStatement.cxx +++ b/connectivity/source/drivers/ado/AStatement.cxx @@ -354,7 +354,7 @@ Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( ) throw(SQLException, OUString aBatchSql; sal_Int32 nLen = 0; for(::std::list< OUString>::const_iterator i=m_aBatchList.begin();i != m_aBatchList.end();++i,++nLen) - aBatchSql = aBatchSql + *i + OUString(";"); + aBatchSql = aBatchSql + *i + ";"; if ( m_RecordSet.IsValid() ) diff --git a/connectivity/source/drivers/macab/MacabRecords.cxx b/connectivity/source/drivers/macab/MacabRecords.cxx index 364213db7807..802a15a52b55 100644 --- a/connectivity/source/drivers/macab/MacabRecords.cxx +++ b/connectivity/source/drivers/macab/MacabRecords.cxx @@ -557,7 +557,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert multiLabelString = CFStringToOUString(localizedMultiLabel); CFRelease(multiLabel); CFRelease(localizedMultiLabel); - headerNameString = multiPropertyString + OUString(": ") + fixLabel(multiLabelString); + headerNameString = multiPropertyString + ": " + fixLabel(multiLabelString); headerNames[i] = new macabfield; headerNames[i]->value = OUStringToCFString(headerNameString); headerNames[i]->type = multiType; @@ -608,7 +608,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert if(multiValue && multiLabel) { localizedMultiLabel = ABCopyLocalizedPropertyOrLabel(multiLabel); - multiLabelString = multiPropertyString + OUString(": ") + fixLabel(CFStringToOUString(localizedMultiLabel)); + multiLabelString = multiPropertyString + ": " + fixLabel(CFStringToOUString(localizedMultiLabel)); CFRelease(multiLabel); CFRelease(localizedMultiLabel); multiLabel = OUStringToCFString(multiLabelString); @@ -696,7 +696,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert dictType = (ABPropertyType) getABTypeFromCFType( CFGetTypeID(dictValues[i]) ); localizedDictKey = ABCopyLocalizedPropertyOrLabel(dictKeys[i]); dictKeyString = CFStringToOUString(localizedDictKey); - dictLabelString = propertyNameString + OUString(": ") + fixLabel(dictKeyString); + dictLabelString = propertyNameString + ": " + fixLabel(dictKeyString); dictLabel = OUStringToCFString(dictLabelString); dictHeaders[i] = createHeaderForProperty(dictType, dictValues[i], dictLabel); if (!dictHeaders[i]) @@ -942,7 +942,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT * property into the record. */ sal_Bool bPlaced = sal_False; - OUString columnName = OUString(_propertyName); + OUString columnName = _propertyName; sal_Int32 i = 1; // A big safeguard to prevent two fields from having the same name. @@ -957,7 +957,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT { bPlaced = sal_False; i++; - columnName = OUString(_propertyName) + OUString(" (") + OUString::number(i) + OUString(")"); + columnName = _propertyName + " (" + OUString::number(i) + ")"; } // success! @@ -1029,7 +1029,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT localizedDictKey = ABCopyLocalizedPropertyOrLabel(dictKeys[i]); dictKeyString = CFStringToOUString(localizedDictKey); CFRelease(localizedDictKey); - newPropertyName = _propertyName + OUString(": ") + fixLabel(dictKeyString); + newPropertyName = _propertyName + ": " + fixLabel(dictKeyString); insertPropertyIntoMacabRecord(_abrecord, _header, newPropertyName, dictValues[i]); } @@ -1072,7 +1072,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT localizedMultiLabel = ABCopyLocalizedPropertyOrLabel(multiLabel); multiLabelString = CFStringToOUString(localizedMultiLabel); - newPropertyName = _propertyName + OUString(": ") + fixLabel(multiLabelString); + newPropertyName = _propertyName + ": " + fixLabel(multiLabelString); insertPropertyIntoMacabRecord(multiType, _abrecord, _header, newPropertyName, multiValue); /* free our variables */ diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index d9ea6a74ba2a..78956371372f 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -127,8 +127,8 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >& OUString path = m_pProfileAccess->getProfilePath(::com::sun::star::mozilla::MozillaProductType_Thunderbird, defaultProfile); SAL_INFO("connectivity.mork", "DefaultProfile: " << defaultProfile); SAL_INFO("connectivity.mork", "ProfilePath: " << path); - abook = path + OUString( "/abook.mab" ); - history = path + OUString( "/history.mab" ); + abook = path + "/abook.mab"; + history = path + "/history.mab"; SAL_INFO("connectivity.mork", "AdressbookPath (abook): " << abook); SAL_INFO("connectivity.mork", "AdressbookPath (history): " << history); } diff --git a/connectivity/source/drivers/mork/MNSFolders.cxx b/connectivity/source/drivers/mork/MNSFolders.cxx index 029d9e39be67..71a01493d659 100644 --- a/connectivity/source/drivers/mork/MNSFolders.cxx +++ b/connectivity/source/drivers/mork/MNSFolders.cxx @@ -56,7 +56,7 @@ namespace aSecurity.getHomeDir( aConfigPath ); #endif - return aConfigPath + OUString("/"); + return aConfigPath + "/"; } // ------------------------------------------------------------------- diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx index e498128b8c35..2418877570dc 100644 --- a/connectivity/source/drivers/mork/MStatement.cxx +++ b/connectivity/source/drivers/mork/MStatement.cxx @@ -258,7 +258,7 @@ OCommonStatement::StatementType OCommonStatement::parseSql( const OUString& sql else if(!bAdjusted) //Our sql parser does not support a statement like "create table foo" // So we append ("E-mail" varchar) to the last of it to make it work { - return parseSql(sql + OUString( "(""E-mail"" character)"),sal_True); + return parseSql(sql + "(""E-mail"" character)", sal_True); } getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this ); diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx index 029d9e39be67..71a01493d659 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx @@ -56,7 +56,7 @@ namespace aSecurity.getHomeDir( aConfigPath ); #endif - return aConfigPath + OUString("/"); + return aConfigPath + "/"; } // ------------------------------------------------------------------- diff --git a/connectivity/source/drivers/mysql/YUsers.cxx b/connectivity/source/drivers/mysql/YUsers.cxx index 90ee347294dd..a84181909cbc 100644 --- a/connectivity/source/drivers/mysql/YUsers.cxx +++ b/connectivity/source/drivers/mysql/YUsers.cxx @@ -72,7 +72,7 @@ sdbcx::ObjectType OUsers::appendObject( const OUString& _rForName, const Referen OUString aQuote = m_xConnection->getMetaData()->getIdentifierQuoteString( ); OUString sUserName( _rForName ); aSql += ::dbtools::quoteName(aQuote,sUserName) - + OUString(" @\"%\" "); + + " @\"%\" "; OUString sPassword; descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD)) >>= sPassword; if ( !sPassword.isEmpty() ) -- cgit