summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-25 17:17:50 +0200
committerNoel Grandin <noel@peralex.com>2013-11-04 10:11:07 +0200
commitaeb41c9b9b7559c6d87bf92807acdc0df9e104cc (patch)
tree5a36bcd5af873c2b597fcda5fbd7e2f76f997669 /connectivity
parent57c2de08ddf14c0da80de06736d99382ad036539 (diff)
remove redundant calls to OUString constructor
Change code like this: aStr = OUString("xxxx"); into this: aStr = "xxxx"; Change-Id: I31cb92e21658d57bb9e14b65c179536eae8096f6
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/TColumnsHelper.cxx18
-rw-r--r--connectivity/source/commontools/TTableHelper.cxx6
-rw-r--r--connectivity/source/commontools/dbtools.cxx6
-rw-r--r--connectivity/source/commontools/dbtools2.cxx11
-rw-r--r--connectivity/source/commontools/predicateinput.cxx6
-rw-r--r--connectivity/source/drivers/dbase/DIndex.cxx18
-rw-r--r--connectivity/source/drivers/dbase/DIndexes.cxx7
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx2
-rw-r--r--connectivity/source/drivers/firebird/Services.cxx4
-rw-r--r--connectivity/source/drivers/hsqldb/HTable.cxx49
-rw-r--r--connectivity/source/drivers/hsqldb/HTables.cxx4
-rw-r--r--connectivity/source/drivers/hsqldb/HUser.cxx50
-rw-r--r--connectivity/source/drivers/hsqldb/HUsers.cxx10
-rw-r--r--connectivity/source/drivers/hsqldb/HViews.cxx10
-rw-r--r--connectivity/source/drivers/hsqldb/accesslog.cxx5
-rw-r--r--connectivity/source/drivers/macab/MacabAddressBook.cxx5
-rw-r--r--connectivity/source/drivers/macab/MacabRecords.cxx2
-rw-r--r--connectivity/source/drivers/mork/MNSProfileDiscover.cxx3
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx3
-rw-r--r--connectivity/source/drivers/mysql/YDriver.cxx6
-rw-r--r--connectivity/source/drivers/mysql/YTable.cxx34
-rw-r--r--connectivity/source/drivers/mysql/YTables.cxx4
-rw-r--r--connectivity/source/drivers/mysql/YUser.cxx51
-rw-r--r--connectivity/source/drivers/mysql/YUsers.cxx4
-rw-r--r--connectivity/source/drivers/mysql/YViews.cxx2
-rw-r--r--connectivity/source/drivers/odbcbase/OConnection.cxx6
-rw-r--r--connectivity/source/parse/sqlnode.cxx2
27 files changed, 133 insertions, 195 deletions
diff --git a/connectivity/source/commontools/TColumnsHelper.cxx b/connectivity/source/commontools/TColumnsHelper.cxx
index 8d97941e869f..527fd6f6b584 100644
--- a/connectivity/source/commontools/TColumnsHelper.cxx
+++ b/connectivity/source/commontools/TColumnsHelper.cxx
@@ -177,11 +177,10 @@ sdbcx::ObjectType OColumnsHelper::appendObject( const OUString& _rForName, const
return cloneDescriptor( descriptor );
Reference<XDatabaseMetaData> xMetaData = m_pTable->getConnection()->getMetaData();
- OUString aSql( "ALTER TABLE " );
-
- aSql += ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::eInTableDefinitions, false, false, true );
- aSql += OUString(" ADD ");
- aSql += ::dbtools::createStandardColumnPart(descriptor,m_pTable->getConnection(),NULL,m_pTable->getTypeCreatePattern());
+ OUString aSql = "ALTER TABLE " +
+ ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::eInTableDefinitions, false, false, true ) +
+ " ADD " +
+ ::dbtools::createStandardColumnPart(descriptor,m_pTable->getConnection(),NULL,m_pTable->getTypeCreatePattern());
Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
if ( xStmt.is() )
@@ -198,13 +197,12 @@ void OColumnsHelper::dropObject(sal_Int32 /*_nPos*/,const OUString _sElementName
OSL_ENSURE(m_pTable,"OColumnsHelper::dropByName: Table is null!");
if ( m_pTable && !m_pTable->isNew() )
{
- OUString aSql( "ALTER TABLE " );
Reference<XDatabaseMetaData> xMetaData = m_pTable->getConnection()->getMetaData();
OUString aQuote = xMetaData->getIdentifierQuoteString( );
-
- aSql += ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::eInTableDefinitions, false, false, true );
- aSql += OUString(" DROP ");
- aSql += ::dbtools::quoteName( aQuote,_sElementName);
+ OUString aSql = "ALTER TABLE " +
+ ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::eInTableDefinitions, false, false, true ) +
+ " DROP " +
+ ::dbtools::quoteName( aQuote,_sElementName);
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 3e29b7bbd524..f77eefca4b3e 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -483,10 +483,10 @@ void OTableHelper::refreshIndexes()
OUString OTableHelper::getRenameStart() const
{
OUString sSql("RENAME ");
- if ( m_Type == OUString("VIEW") )
- sSql += OUString(" VIEW ");
+ if ( m_Type == "VIEW" )
+ sSql += " VIEW ";
else
- sSql += OUString(" TABLE ");
+ sSql += " TABLE ";
return sSql;
}
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index e54ab300f17a..c2df4738fe67 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -999,9 +999,9 @@ try
{
OSL_UNUSED( e );
#ifdef DBG_UTIL
- OUString sMessage("TransferFormComponentProperties : could not transfer the value for property \"");
- sMessage += pResult->Name;
- sMessage += OUString("\"");
+ OUString sMessage = "TransferFormComponentProperties : could not transfer the value for property \"" +
+ pResult->Name +
+ "\"";
OSL_FAIL(OUStringToOString(sMessage, RTL_TEXTENCODING_ASCII_US).getStr());
#endif
}
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index de82465c8dc1..689fc5c64547 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -825,14 +825,9 @@ void collectColumnInformation(const Reference< XConnection>& _xConnection,
const OUString& _rName,
ColumnInformationMap& _rInfo)
{
- static OUString STR_WHERE = OUString(" WHERE ");
-
- OUString sSelect = OUString("SELECT ");
- sSelect += _rName;
- sSelect += OUString(" FROM ");
- sSelect += _sComposedName;
- sSelect += STR_WHERE;
- sSelect += OUString("0 = 1");
+ OUString sSelect = "SELECT " + _rName +
+ " FROM " + _sComposedName +
+ " WHERE 0 = 1";
try
{
diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx
index f27bc142da55..0d04af9510a3 100644
--- a/connectivity/source/commontools/predicateinput.cxx
+++ b/connectivity/source/commontools/predicateinput.cxx
@@ -343,11 +343,7 @@ namespace dbtools
if ( nType == DataType::OTHER || sField.isEmpty() )
{
// first try the international version
- OUString sSql;
- sSql += OUString("SELECT * ");
- sSql += OUString(" FROM x WHERE ");
- sSql += sField;
- sSql += _rPredicateValue;
+ OUString sSql = "SELECT * FROM x WHERE " + sField + _rPredicateValue;
::std::auto_ptr<OSQLParseNode> pParseNode( const_cast< OSQLParser& >( m_aParser ).parseTree( sError, sSql, sal_True ) );
nType = DataType::DOUBLE;
if ( pParseNode.get() )
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index 836e198b6631..8fbfe9bb8183 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -365,10 +365,9 @@ SvStream& connectivity::dbase::operator << (SvStream &rStream, ODbaseIndex& rInd
// -------------------------------------------------------------------------
OUString ODbaseIndex::getCompletePath()
{
- OUString sDir = m_pTable->getConnection()->getURL();
- sDir += OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELIMITER);
- sDir += m_Name;
- sDir += OUString(".ndx");
+ OUString sDir = m_pTable->getConnection()->getURL() +
+ OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELIMITER) +
+ m_Name + ".ndx";
return sDir;
}
//------------------------------------------------------------------
@@ -420,10 +419,9 @@ sal_Bool ODbaseIndex::DropImpl()
}
// synchronize inf-file
- OUString sCfgFile(m_pTable->getConnection()->getURL());
- sCfgFile += OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELIMITER);
- sCfgFile += m_pTable->getName();
- sCfgFile += OUString(".inf");
+ OUString sCfgFile = m_pTable->getConnection()->getURL() +
+ OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELIMITER) +
+ m_pTable->getName() + ".inf";
OUString sPhysicalPath;
OSL_VERIFY_RES( LocalFileHelper::ConvertURLToPhysicalName(sCfgFile, sPhysicalPath),
@@ -433,14 +431,14 @@ sal_Bool ODbaseIndex::DropImpl()
aInfFile.SetGroup(dBASE_III_GROUP);
sal_uInt16 nKeyCnt = aInfFile.GetKeyCount();
OString aKeyName;
- OUString sEntry = m_Name + (".ndx");
+ OUString sEntry = m_Name + ".ndx";
// delete entries from the inf file
for (sal_uInt16 nKey = 0; nKey < nKeyCnt; nKey++)
{
// References the Key to an Index-file?
aKeyName = aInfFile.GetKeyName( nKey );
- if (aKeyName.copy(0,3).equals("NDX"))
+ if (aKeyName.copy(0,3) == "NDX")
{
if(sEntry == OStringToOUString(aInfFile.ReadKey(aKeyName),m_pTable->getConnection()->getTextEncoding()))
{
diff --git a/connectivity/source/drivers/dbase/DIndexes.cxx b/connectivity/source/drivers/dbase/DIndexes.cxx
index f96224e43c86..ef31f7e73e62 100644
--- a/connectivity/source/drivers/dbase/DIndexes.cxx
+++ b/connectivity/source/drivers/dbase/DIndexes.cxx
@@ -39,10 +39,9 @@ using namespace ::com::sun::star::lang;
sdbcx::ObjectType ODbaseIndexes::createObject(const OUString& _rName)
{
- OUString sFile = m_pTable->getConnection()->getURL();
- sFile += OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELIMITER);
- sFile += _rName;
- sFile += OUString(".ndx");
+ OUString sFile = m_pTable->getConnection()->getURL() +
+ OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELIMITER) +
+ _rName + ".ndx";
if ( !UCBContentHelper::Exists(sFile) )
{
const OUString sError( m_pTable->getConnection()->getResources().getResourceStringWithSubstitution(
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index c0f6f75b0156..06e0bccb1cd5 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -2307,7 +2307,7 @@ namespace
{
OUString aIdent = _pConenction->getContent()->getIdentifier()->getContentIdentifier();
if ( aIdent.lastIndexOf('/') != (aIdent.getLength()-1) )
- aIdent += OUString("/");
+ aIdent += "/";
aIdent += oldName;
aName = aIdent;
}
diff --git a/connectivity/source/drivers/firebird/Services.cxx b/connectivity/source/drivers/firebird/Services.cxx
index a60aad05df3a..f5a183026740 100644
--- a/connectivity/source/drivers/firebird/Services.cxx
+++ b/connectivity/source/drivers/firebird/Services.cxx
@@ -52,9 +52,7 @@ void REGISTER_PROVIDER(
const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
- OUString aMainKeyName("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString("/UNO/SERVICES");
+ OUString aMainKeyName = "/" + aServiceImplName + "/UNO/SERVICES";
Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
OSL_ENSURE(xNewKey.is(), "FIREBIRD::component_writeInfo : could not create a registry key !");
diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx
index be5c8aa74ee1..de618dabec89 100644
--- a/connectivity/source/drivers/hsqldb/HTable.cxx
+++ b/connectivity/source/drivers/hsqldb/HTable.cxx
@@ -206,12 +206,11 @@ void SAL_CALL OHSQLTable::alterColumnByName( const OUString& colName, const Refe
{
const OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- OUString sSql = getAlterTableColumnPart();
- sSql += OUString(" ALTER COLUMN ");
- sSql += ::dbtools::quoteName(sQuote,colName);
-
- sSql += OUString(" RENAME TO ");
- sSql += ::dbtools::quoteName(sQuote,sNewColumnName);
+ OUString sSql = getAlterTableColumnPart() +
+ " ALTER COLUMN " +
+ ::dbtools::quoteName(sQuote,colName) +
+ " RENAME TO " +
+ ::dbtools::quoteName(sQuote,sNewColumnName);
executeStatement(sSql);
}
@@ -263,7 +262,7 @@ void OHSQLTable::alterColumnType(sal_Int32 nNewType,const OUString& _rColName, c
{
OUString sSql = getAlterTableColumnPart();
- sSql += OUString(" ALTER COLUMN ");
+ sSql += " ALTER COLUMN ";
#if OSL_DEBUG_LEVEL > 0
try
{
@@ -292,25 +291,22 @@ void OHSQLTable::alterColumnType(sal_Int32 nNewType,const OUString& _rColName, c
// -----------------------------------------------------------------------------
void OHSQLTable::alterDefaultValue(const OUString& _sNewDefault,const OUString& _rColName)
{
- OUString sSql = getAlterTableColumnPart();
- sSql += OUString(" ALTER COLUMN ");
-
const OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- sSql += ::dbtools::quoteName(sQuote,_rColName);
- sSql += OUString(" SET DEFAULT '") + _sNewDefault;
- sSql += OUString("'");
+ OUString sSql = getAlterTableColumnPart() +
+ " ALTER COLUMN " +
+ ::dbtools::quoteName(sQuote,_rColName) +
+ " SET DEFAULT '" + _sNewDefault + "'";
executeStatement(sSql);
}
// -----------------------------------------------------------------------------
void OHSQLTable::dropDefaultValue(const OUString& _rColName)
{
- OUString sSql = getAlterTableColumnPart();
- sSql += OUString(" ALTER COLUMN ");
-
const OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- sSql += ::dbtools::quoteName(sQuote,_rColName);
- sSql += OUString(" DROP DEFAULT");
+ OUString sSql = getAlterTableColumnPart() +
+ " ALTER COLUMN " +
+ ::dbtools::quoteName(sQuote,_rColName) +
+ " DROP DEFAULT";
executeStatement(sSql);
}
@@ -380,20 +376,19 @@ void SAL_CALL OHSQLTable::rename( const OUString& newName ) throw(SQLException,
if(!isNew())
{
- OUString sSql = OUString("ALTER ");
- if ( m_Type == OUString("VIEW") )
- sSql += OUString(" VIEW ");
+ OUString sSql = "ALTER ";
+ if ( m_Type == "VIEW" )
+ sSql += " VIEW ";
else
- sSql += OUString(" TABLE ");
+ sSql += " TABLE ";
OUString sCatalog,sSchema,sTable;
::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
- OUString sComposedName(
- ::dbtools::composeTableName( getMetaData(), m_CatalogName, m_SchemaName, m_Name, sal_True, ::dbtools::eInDataManipulation ) );
- sSql += sComposedName
- + OUString(" RENAME TO ");
- sSql += ::dbtools::composeTableName( getMetaData(), sCatalog, sSchema, sTable, sal_True, ::dbtools::eInDataManipulation );
+ OUString sComposedName =
+ ::dbtools::composeTableName( getMetaData(), m_CatalogName, m_SchemaName, m_Name, sal_True, ::dbtools::eInDataManipulation ) +
+ sComposedName + " RENAME TO " +
+ ::dbtools::composeTableName( getMetaData(), sCatalog, sSchema, sTable, sal_True, ::dbtools::eInDataManipulation );
executeStatement(sSql);
diff --git a/connectivity/source/drivers/hsqldb/HTables.cxx b/connectivity/source/drivers/hsqldb/HTables.cxx
index a68f24a44aa0..0b5d97928660 100644
--- a/connectivity/source/drivers/hsqldb/HTables.cxx
+++ b/connectivity/source/drivers/hsqldb/HTables.cxx
@@ -133,9 +133,9 @@ void OTables::dropObject(sal_Int32 _nPos,const OUString _sElementName)
Reference<XPropertySet> xProp(xObject,UNO_QUERY);
sal_Bool bIsView;
if((bIsView = (xProp.is() && ::comphelper::getString(xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))) == OUString("VIEW")))) // here we have a view
- aSql += OUString("VIEW ");
+ aSql += "VIEW ";
else
- aSql += OUString("TABLE ");
+ aSql += "TABLE ";
OUString sComposedName(
::dbtools::composeTableName( m_xMetaData, sCatalog, sSchema, sTable, sal_True, ::dbtools::eInDataManipulation ) );
diff --git a/connectivity/source/drivers/hsqldb/HUser.cxx b/connectivity/source/drivers/hsqldb/HUser.cxx
index 8d3a7fa0d681..dc6d8d81c6dd 100644
--- a/connectivity/source/drivers/hsqldb/HUser.cxx
+++ b/connectivity/source/drivers/hsqldb/HUser.cxx
@@ -226,14 +226,10 @@ void SAL_CALL OHSQLUser::grantPrivileges( const OUString& objName, sal_Int32 obj
OUString sPrivs = getPrivilegeString(objPrivileges);
if(!sPrivs.isEmpty())
{
- OUString sGrant;
- sGrant += OUString("GRANT ");
- sGrant += sPrivs;
- sGrant += OUString(" ON ");
Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- sGrant += ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation);
- sGrant += OUString(" TO ");
- sGrant += m_Name;
+ OUString sGrant = "GRANT " + sPrivs +
+ " ON " + ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation);
+ " TO " + m_Name;
Reference<XStatement> xStmt = m_xConnection->createStatement();
if(xStmt.is())
@@ -256,14 +252,10 @@ void SAL_CALL OHSQLUser::revokePrivileges( const OUString& objName, sal_Int32 ob
OUString sPrivs = getPrivilegeString(objPrivileges);
if(!sPrivs.isEmpty())
{
- OUString sGrant;
- sGrant += OUString("REVOKE ");
- sGrant += sPrivs;
- sGrant += OUString(" ON ");
Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- sGrant += ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation);
- sGrant += OUString(" FROM ");
- sGrant += m_Name;
+ OUString sGrant = "REVOKE " + sPrivs +
+ " ON " + ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation);
+ " FROM " + m_Name;
Reference<XStatement> xStmt = m_xConnection->createStatement();
if(xStmt.is())
@@ -277,12 +269,8 @@ void SAL_CALL OHSQLUser::changePassword( const OUString& /*oldPassword*/, const
{
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
- OUString sAlterPwd;
- sAlterPwd = OUString("SET PASSWORD FOR ");
- sAlterPwd += m_Name;
- sAlterPwd += OUString("@\"%\" = PASSWORD('") ;
- sAlterPwd += newPassword;
- sAlterPwd += OUString("')") ;
+ OUString sAlterPwd = "SET PASSWORD FOR " +
+ m_Name + "@\"%\" = PASSWORD('" + newPassword + "')";
Reference<XStatement> xStmt = m_xConnection->createStatement();
@@ -297,41 +285,41 @@ OUString OHSQLUser::getPrivilegeString(sal_Int32 nRights) const
{
OUString sPrivs;
if((nRights & Privilege::INSERT) == Privilege::INSERT)
- sPrivs += OUString("INSERT");
+ sPrivs += "INSERT";
if((nRights & Privilege::DELETE) == Privilege::DELETE)
{
if(!sPrivs.isEmpty())
- sPrivs += OUString(",");
- sPrivs += OUString("DELETE");
+ sPrivs += ",";
+ sPrivs += "DELETE";
}
if((nRights & Privilege::UPDATE) == Privilege::UPDATE)
{
if(!sPrivs.isEmpty())
- sPrivs += OUString(",");
- sPrivs += OUString("UPDATE");
+ sPrivs += ",";
+ sPrivs += "UPDATE";
}
if((nRights & Privilege::ALTER) == Privilege::ALTER)
{
if(!sPrivs.isEmpty())
- sPrivs += OUString(",");
- sPrivs += OUString("ALTER");
+ sPrivs += ",";
+ sPrivs += "ALTER";
}
if((nRights & Privilege::SELECT) == Privilege::SELECT)
{
if(!sPrivs.isEmpty())
- sPrivs += OUString(",");
- sPrivs += OUString("SELECT");
+ sPrivs += ",";
+ sPrivs += "SELECT";
}
if((nRights & Privilege::REFERENCE) == Privilege::REFERENCE)
{
if(!sPrivs.isEmpty())
- sPrivs += OUString(",");
- sPrivs += OUString("REFERENCES");
+ sPrivs += ",";
+ sPrivs += "REFERENCES";
}
return sPrivs;
diff --git a/connectivity/source/drivers/hsqldb/HUsers.cxx b/connectivity/source/drivers/hsqldb/HUsers.cxx
index 609b87504cf7..abf698d86333 100644
--- a/connectivity/source/drivers/hsqldb/HUsers.cxx
+++ b/connectivity/source/drivers/hsqldb/HUsers.cxx
@@ -68,18 +68,14 @@ Reference< XPropertySet > OUsers::createDescriptor()
// XAppend
sdbcx::ObjectType OUsers::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
{
- OUString aSql( "GRANT USAGE ON * TO " );
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;
+ OUString aSql = "GRANT USAGE ON * TO " +
+ ::dbtools::quoteName(aQuote,_rForName) + " @\"%\" ";
if ( !sPassword.isEmpty() )
{
- aSql += OUString(" IDENTIFIED BY '");
- aSql += sPassword;
- aSql += OUString("'");
+ aSql += " IDENTIFIED BY '" + sPassword + "'";
}
Reference< XStatement > xStmt = m_xConnection->createStatement( );
diff --git a/connectivity/source/drivers/hsqldb/HViews.cxx b/connectivity/source/drivers/hsqldb/HViews.cxx
index 265981fda0ff..3a91dd8b7289 100644
--- a/connectivity/source/drivers/hsqldb/HViews.cxx
+++ b/connectivity/source/drivers/hsqldb/HViews.cxx
@@ -131,14 +131,12 @@ void HViews::createView( const Reference< XPropertySet >& descriptor )
{
Reference<XConnection> xConnection = static_cast<OHCatalog&>(m_rParent).getConnection();
- OUString aSql( "CREATE VIEW " );
OUString sCommand;
-
- aSql += ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::eInTableDefinitions, false, false, true );
-
- aSql += OUString(" AS ");
descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_COMMAND)) >>= sCommand;
- aSql += sCommand;
+
+ OUString aSql = "CREATE VIEW " +
+ ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::eInTableDefinitions, false, false, true ) +
+ " AS " + sCommand;
Reference< XStatement > xStmt = xConnection->createStatement( );
if ( xStmt.is() )
diff --git a/connectivity/source/drivers/hsqldb/accesslog.cxx b/connectivity/source/drivers/hsqldb/accesslog.cxx
index 075a32d1bd8f..7c3aeef597c9 100644
--- a/connectivity/source/drivers/hsqldb/accesslog.cxx
+++ b/connectivity/source/drivers/hsqldb/accesslog.cxx
@@ -36,9 +36,8 @@ namespace connectivity { namespace hsqldb
//---------------------------------------------------------------------
LogFile::LogFile( JNIEnv* env, jstring streamName, const sal_Char* _pAsciiSuffix )
{
- m_sFileName = StorageContainer::jstring2ustring(env,streamName);
- m_sFileName += OUString(".");
- m_sFileName += OUString::createFromAscii( _pAsciiSuffix );
+ m_sFileName = StorageContainer::jstring2ustring(env,streamName) +
+ "." + OUString::createFromAscii( _pAsciiSuffix );
}
//---------------------------------------------------------------------
diff --git a/connectivity/source/drivers/macab/MacabAddressBook.cxx b/connectivity/source/drivers/macab/MacabAddressBook.cxx
index 1ba152ed6951..3a61df373ab9 100644
--- a/connectivity/source/drivers/macab/MacabAddressBook.cxx
+++ b/connectivity/source/drivers/macab/MacabAddressBook.cxx
@@ -235,10 +235,9 @@ void MacabAddressBook::manageDuplicateGroups(::std::vector<MacabGroup *> _xGroup
// duplicate!
if(count != 1)
{
- OUString sName = (*iter1)->getName();
- sName += OUString(" (") +
+ OUString sName = (*iter1)->getName() + " (" +
OUString::number(count) +
- OUString(")");
+ ")";
(*iter1)->setName(sName);
}
}
diff --git a/connectivity/source/drivers/macab/MacabRecords.cxx b/connectivity/source/drivers/macab/MacabRecords.cxx
index 2efea4ed71c1..364213db7807 100644
--- a/connectivity/source/drivers/macab/MacabRecords.cxx
+++ b/connectivity/source/drivers/macab/MacabRecords.cxx
@@ -836,7 +836,7 @@ void MacabRecords::manageDuplicateHeaders(macabfield **_headerNames, const sal_I
// There is probably a better way to do this...
OUString newName = CFStringToOUString((CFStringRef) _headerNames[i]->value);
CFRelease(_headerNames[i]->value);
- newName += OUString(" (") + OUString::number(count) + OUString(")");
+ newName += " (" + OUString::number(count) + ")";
_headerNames[i]->value = OUStringToCFString(newName);
}
}
diff --git a/connectivity/source/drivers/mork/MNSProfileDiscover.cxx b/connectivity/source/drivers/mork/MNSProfileDiscover.cxx
index 5984677dbb73..579d7ce19f3f 100644
--- a/connectivity/source/drivers/mork/MNSProfileDiscover.cxx
+++ b/connectivity/source/drivers/mork/MNSProfileDiscover.cxx
@@ -68,8 +68,7 @@ namespace connectivity
ProductStruct &m_Product = m_ProductProfileList[index];
OUString regDir = getRegistryDir(product);
- OUString profilesIni( regDir );
- profilesIni += OUString("profiles.ini");
+ OUString profilesIni = regDir + "profiles.ini";
IniParser parser( profilesIni );
IniSectionMap &mAllSection = *(parser.getAllSection());
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
index 6338eff8b4da..7fcd034222a4 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
@@ -146,8 +146,7 @@ namespace connectivity
nsresult rv;
#endif
OUString regDir = getRegistryDir(product);
- OUString profilesIni( regDir );
- profilesIni += OUString("profiles.ini");
+ OUString profilesIni = regDir + "profiles.ini";
IniParser parser( profilesIni );
IniSectionMap &mAllSection = *(parser.getAllSection());
diff --git a/connectivity/source/drivers/mysql/YDriver.cxx b/connectivity/source/drivers/mysql/YDriver.cxx
index 51e5a114fc9a..cb005e9e7363 100644
--- a/connectivity/source/drivers/mysql/YDriver.cxx
+++ b/connectivity/source/drivers/mysql/YDriver.cxx
@@ -290,11 +290,11 @@ namespace connectivity
} // if ( !sCuttedUrl.matchIgnoreAsciiCase(s_sCharSetOp) )
} // if ( RTL_TEXTENCODING_UTF8 == (*aLookup).getEncoding() )
if ( sCuttedUrl.indexOf('?') == -1 )
- sCuttedUrl += OUString("?");
+ sCuttedUrl += "?";
else
- sCuttedUrl += OUString("&");
+ sCuttedUrl += "&";
sCuttedUrl += sAdd;
- sCuttedUrl += OUString("characterEncoding=");
+ sCuttedUrl += "characterEncoding=";
sCuttedUrl += sIanaName;
}
}
diff --git a/connectivity/source/drivers/mysql/YTable.cxx b/connectivity/source/drivers/mysql/YTable.cxx
index 4938b724fc34..decb437b75bb 100644
--- a/connectivity/source/drivers/mysql/YTable.cxx
+++ b/connectivity/source/drivers/mysql/YTable.cxx
@@ -234,7 +234,7 @@ void SAL_CALL OMySQLTable::alterColumnByName( const OUString& colName, const Ref
{
if ( sTypeName.indexOf(s_sAutoIncrement) == -1 )
{
- sTypeName += OUString(" ");
+ sTypeName += " ";
sTypeName += s_sAutoIncrement;
}
}
@@ -271,12 +271,10 @@ void SAL_CALL OMySQLTable::alterColumnByName( const OUString& colName, const Ref
descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_NAME)) >>= sNewColumnName;
if ( !sNewColumnName.equalsIgnoreAsciiCase(colName) && !bColumnNameChanged )
{
- OUString sSql = getAlterTableColumnPart();
- sSql += OUString(" CHANGE ");
const OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- sSql += ::dbtools::quoteName(sQuote,colName);
- sSql += OUString(" ");
- sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(descriptor,getConnection(),static_cast<OTables*>(m_pTables),getTypeCreatePattern()));
+ OUString sSql = getAlterTableColumnPart() +
+ " CHANGE " + ::dbtools::quoteName(sQuote,colName) +
+ " " + OTables::adjustSQL(::dbtools::createStandardColumnPart(descriptor,getConnection(),static_cast<OTables*>(m_pTables),getTypeCreatePattern()));
executeStatement(sSql);
}
m_pColumns->refresh();
@@ -294,11 +292,10 @@ void SAL_CALL OMySQLTable::alterColumnByName( const OUString& colName, const Ref
// -----------------------------------------------------------------------------
void OMySQLTable::alterColumnType(sal_Int32 nNewType,const OUString& _rColName, const Reference<XPropertySet>& _xDescriptor)
{
- OUString sSql = getAlterTableColumnPart();
- sSql += OUString(" CHANGE ");
const OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- sSql += ::dbtools::quoteName(sQuote,_rColName);
- sSql += OUString(" ");
+ OUString sSql = getAlterTableColumnPart() +
+ " CHANGE " + ::dbtools::quoteName(sQuote,_rColName) +
+ " ";
OColumn* pColumn = new OColumn(sal_True);
Reference<XPropertySet> xProp = pColumn;
@@ -317,25 +314,20 @@ OUString OMySQLTable::getTypeCreatePattern() const
// -----------------------------------------------------------------------------
void OMySQLTable::alterDefaultValue(const OUString& _sNewDefault,const OUString& _rColName)
{
- OUString sSql = getAlterTableColumnPart();
- sSql += OUString(" ALTER ");
-
const OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- sSql += ::dbtools::quoteName(sQuote,_rColName);
- sSql += OUString(" SET DEFAULT '") + _sNewDefault;
- sSql += OUString("'");
+ OUString sSql = getAlterTableColumnPart() +
+ " ALTER " + ::dbtools::quoteName(sQuote,_rColName) +
+ " SET DEFAULT '" + _sNewDefault + "'";
executeStatement(sSql);
}
// -----------------------------------------------------------------------------
void OMySQLTable::dropDefaultValue(const OUString& _rColName)
{
- OUString sSql = getAlterTableColumnPart();
- sSql += OUString(" ALTER ");
-
const OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- sSql += ::dbtools::quoteName(sQuote,_rColName);
- sSql += OUString(" DROP DEFAULT");
+ OUString sSql = getAlterTableColumnPart() +
+ " ALTER " + ::dbtools::quoteName(sQuote,_rColName) +
+ " DROP DEFAULT";
executeStatement(sSql);
}
diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx
index 776c260671ef..25fbf73ff712 100644
--- a/connectivity/source/drivers/mysql/YTables.cxx
+++ b/connectivity/source/drivers/mysql/YTables.cxx
@@ -138,9 +138,9 @@ void OTables::dropObject(sal_Int32 _nPos,const OUString _sElementName)
Reference<XPropertySet> xProp(xObject,UNO_QUERY);
sal_Bool bIsView = xProp.is() && ::comphelper::getString(xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))) == OUString("VIEW");
if(bIsView) // here we have a view
- aSql += OUString("VIEW ");
+ aSql += "VIEW ";
else
- aSql += OUString("TABLE ");
+ aSql += "TABLE ";
OUString sComposedName(
::dbtools::composeTableName( m_xMetaData, sCatalog, sSchema, sTable, sal_True, ::dbtools::eInDataManipulation ) );
diff --git a/connectivity/source/drivers/mysql/YUser.cxx b/connectivity/source/drivers/mysql/YUser.cxx
index 5f300a3b0672..d44c34541a8e 100644
--- a/connectivity/source/drivers/mysql/YUser.cxx
+++ b/connectivity/source/drivers/mysql/YUser.cxx
@@ -225,14 +225,10 @@ void SAL_CALL OMySQLUser::grantPrivileges( const OUString& objName, sal_Int32 ob
OUString sPrivs = getPrivilegeString(objPrivileges);
if(!sPrivs.isEmpty())
{
- OUString sGrant;
- sGrant += OUString("GRANT ");
- sGrant += sPrivs;
- sGrant += OUString(" ON ");
Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- sGrant += ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation);
- sGrant += OUString(" TO ");
- sGrant += m_Name;
+ OUString sGrant = "GRANT " + sPrivs +
+ " ON " + ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation) +
+ " TO " + m_Name;
Reference<XStatement> xStmt = m_xConnection->createStatement();
if(xStmt.is())
@@ -255,14 +251,10 @@ void SAL_CALL OMySQLUser::revokePrivileges( const OUString& objName, sal_Int32 o
OUString sPrivs = getPrivilegeString(objPrivileges);
if(!sPrivs.isEmpty())
{
- OUString sGrant;
- sGrant += OUString("REVOKE ");
- sGrant += sPrivs;
- sGrant += OUString(" ON ");
Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- sGrant += ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation);
- sGrant += OUString(" FROM ");
- sGrant += m_Name;
+ OUString sGrant = "REVOKE " + sPrivs +
+ " ON " + ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation) +
+ " FROM " + m_Name;
Reference<XStatement> xStmt = m_xConnection->createStatement();
if(xStmt.is())
@@ -276,12 +268,9 @@ void SAL_CALL OMySQLUser::changePassword( const OUString& /*oldPassword*/, const
{
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
- OUString sAlterPwd;
- sAlterPwd = OUString("SET PASSWORD FOR ");
- sAlterPwd += m_Name;
- sAlterPwd += OUString("@\"%\" = PASSWORD('") ;
- sAlterPwd += newPassword;
- sAlterPwd += OUString("')") ;
+ OUString sAlterPwd = "SET PASSWORD FOR " +
+ m_Name + "@\"%\" = PASSWORD('" +
+ newPassword + "')";
Reference<XStatement> xStmt = m_xConnection->createStatement();
@@ -296,41 +285,41 @@ OUString OMySQLUser::getPrivilegeString(sal_Int32 nRights) const
{
OUString sPrivs;
if((nRights & Privilege::INSERT) == Privilege::INSERT)
- sPrivs += OUString("INSERT");
+ sPrivs += "INSERT";
if((nRights & Privilege::DELETE) == Privilege::DELETE)
{
if(!sPrivs.isEmpty())
- sPrivs += OUString(",");
- sPrivs += OUString("DELETE");
+ sPrivs += ",";
+ sPrivs += "DELETE";
}
if((nRights & Privilege::UPDATE) == Privilege::UPDATE)
{
if(!sPrivs.isEmpty())
- sPrivs += OUString(",");
- sPrivs += OUString("UPDATE");
+ sPrivs += ",";
+ sPrivs += "UPDATE";
}
if((nRights & Privilege::ALTER) == Privilege::ALTER)
{
if(!sPrivs.isEmpty())
- sPrivs += OUString(",");
- sPrivs += OUString("ALTER");
+ sPrivs += ",";
+ sPrivs += "ALTER";
}
if((nRights & Privilege::SELECT) == Privilege::SELECT)
{
if(!sPrivs.isEmpty())
- sPrivs += OUString(",");
- sPrivs += OUString("SELECT");
+ sPrivs += ",";
+ sPrivs += "SELECT";
}
if((nRights & Privilege::REFERENCE) == Privilege::REFERENCE)
{
if(!sPrivs.isEmpty())
- sPrivs += OUString(",");
- sPrivs += OUString("REFERENCES");
+ sPrivs += ",";
+ sPrivs += "REFERENCES";
}
return sPrivs;
diff --git a/connectivity/source/drivers/mysql/YUsers.cxx b/connectivity/source/drivers/mysql/YUsers.cxx
index e2e54e85d0f3..90ee347294dd 100644
--- a/connectivity/source/drivers/mysql/YUsers.cxx
+++ b/connectivity/source/drivers/mysql/YUsers.cxx
@@ -77,9 +77,9 @@ sdbcx::ObjectType OUsers::appendObject( const OUString& _rForName, const Referen
descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD)) >>= sPassword;
if ( !sPassword.isEmpty() )
{
- aSql += OUString(" IDENTIFIED BY '");
+ aSql += " IDENTIFIED BY '";
aSql += sPassword;
- aSql += OUString("'");
+ aSql += "'";
}
Reference< XStatement > xStmt = m_xConnection->createStatement( );
diff --git a/connectivity/source/drivers/mysql/YViews.cxx b/connectivity/source/drivers/mysql/YViews.cxx
index 8ff2a1b971aa..a2378d1382cb 100644
--- a/connectivity/source/drivers/mysql/YViews.cxx
+++ b/connectivity/source/drivers/mysql/YViews.cxx
@@ -130,7 +130,7 @@ void OViews::createView( const Reference< XPropertySet >& descriptor )
aSql += ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::eInTableDefinitions, false, false, true );
- aSql += OUString(" AS ");
+ aSql += " AS ";
descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_COMMAND)) >>= sCommand;
aSql += sCommand;
diff --git a/connectivity/source/drivers/odbcbase/OConnection.cxx b/connectivity/source/drivers/odbcbase/OConnection.cxx
index 9e04bba0428d..cae97e22a356 100644
--- a/connectivity/source/drivers/odbcbase/OConnection.cxx
+++ b/connectivity/source/drivers/odbcbase/OConnection.cxx
@@ -235,12 +235,12 @@ SQLRETURN OConnection::Construct(const OUString& url,const Sequence< PropertyVal
else if(!pBegin->Name.compareToAscii(pUser))
{
OSL_VERIFY( pBegin->Value >>= aUID );
- aDSN = aDSN + OUString(";UID=") + aUID;
+ aDSN = aDSN + ";UID=" + aUID;
}
else if(!pBegin->Name.compareToAscii(pPwd))
{
OSL_VERIFY( pBegin->Value >>= aPWD );
- aDSN = aDSN + OUString(";PWD=") + aPWD;
+ aDSN = aDSN + ";PWD=" + aPWD;
}
else if(!pBegin->Name.compareToAscii(pUseCatalog))
{
@@ -249,7 +249,7 @@ SQLRETURN OConnection::Construct(const OUString& url,const Sequence< PropertyVal
else if(!pBegin->Name.compareToAscii(pSysDrv))
{
OSL_VERIFY( pBegin->Value >>= aSysDrvSettings );
- aDSN += OUString(";");
+ aDSN += ";";
aDSN += aSysDrvSettings;
}
else if(0 == pBegin->Name.compareToAscii(pCharSet))
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index db004873a733..5dca3588ce90 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -738,7 +738,7 @@ void OSQLParseNode::impl_parseTableRangeNodeToString_throw(OUStringBuffer& rStri
SAL_INFO( "connectivity.parse", "parse Ocke.Janssen@sun.com OSQLParseNode::impl_parseTableRangeNodeToString_throw" );
OSL_PRECOND( ( count() == 2 ) || ( count() == 3 ) || ( count() == 5 ) ,"Illegal count");
- // rString += OUString(" ");
+ // rString += " ";
::std::for_each(m_aChildren.begin(),m_aChildren.end(),
boost::bind( &OSQLParseNode::impl_parseNodeToString_throw, _1, boost::ref( rString ), boost::cref( rParam ), false ));
}