From 909b27df488f3c84ab8e5be9a7513a83b7c4b0c1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 13 Dec 2013 10:54:12 +0200 Subject: remove unnecessary double calls to OUString constructor Change-Id: Ib2690e3ec9987b97363687b61fe8ddae4ace9058 --- connectivity/source/commontools/dbtools2.cxx | 3 +-- connectivity/source/commontools/formattedcolumnvalue.cxx | 2 +- connectivity/source/commontools/statementcomposer.cxx | 2 +- .../source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx | 4 ++-- connectivity/source/parse/sqlnode.cxx | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) (limited to 'connectivity/source') diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index ca012d109b0b..e208813c8d66 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -248,7 +248,6 @@ namespace OUString generateColumnNames(const Reference& _xColumns,const Reference& _xMetaData) { ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap(); - static const OUString sComma(OUString(",")); const OUString sQuote(_xMetaData->getIdentifierQuoteString()); OUString sSql( " (" ); @@ -259,7 +258,7 @@ namespace { if ( (_xColumns->getByIndex(i) >>= xColProp) && xColProp.is() ) sSql += ::dbtools::quoteName(sQuote,::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))) - + sComma; + + ","; } if ( nColCount ) diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx index 820c57ee1d14..5c89a7117a7f 100644 --- a/connectivity/source/commontools/formattedcolumnvalue.cxx +++ b/connectivity/source/commontools/formattedcolumnvalue.cxx @@ -156,7 +156,7 @@ namespace dbtools // get the format key of our bound field Reference< XPropertySetInfo > xPSI( _rxColumn->getPropertySetInfo(), UNO_QUERY_THROW ); bool bHaveFieldFormat = false; - const OUString sFormatKeyProperty( OUString( "FormatKey" ) ); + const OUString sFormatKeyProperty( "FormatKey" ); if ( xPSI->hasPropertyByName( sFormatKeyProperty ) ) { bHaveFieldFormat = ( _rxColumn->getPropertyValue( sFormatKeyProperty ) >>= _rData.m_nFormatKey ); diff --git a/connectivity/source/commontools/statementcomposer.cxx b/connectivity/source/commontools/statementcomposer.cxx index 791a06b23631..f80bc1e03b02 100644 --- a/connectivity/source/commontools/statementcomposer.cxx +++ b/connectivity/source/commontools/statementcomposer.cxx @@ -169,7 +169,7 @@ namespace dbtools xComposer->setElementaryQuery( sStatement ); // the sort order - const OUString sPropOrder( OUString( "Order" ) ); + const OUString sPropOrder( "Order" ); if ( ::comphelper::hasProperty( sPropOrder, xQuery ) ) { OUString sOrder; diff --git a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx b/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx index c4790a5e7eb9..77a9020a7207 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx @@ -454,12 +454,12 @@ nsresult getTableStringsProxied(const sal_Char* sAbURI, sal_Int32 *nDirectoryTyp //map mailing lists as views _rStrings->push_back( aTableName ); // Table name if (!bIsMailList) { - OUString aTableType(OUString("TABLE")); + OUString aTableType("TABLE"); _rTypes->push_back( aTableType ); // Table type } else { - OUString aTableType(OUString("VIEW")); + OUString aTableType("VIEW"); _rTypes->push_back( aTableType ); // Table type } } diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 6f13f4a66230..c99585bd5e1e 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1747,7 +1747,7 @@ sal_Bool OSQLParseNode::addDateValue(OUStringBuffer& rString, const SQLParseNode SQL_ISTOKEN(pODBCNodeChild, T) || SQL_ISTOKEN(pODBCNodeChild, TS) )) { - OUString suQuote(OUString("'")); + OUString suQuote("'"); if (rParam.bPredicate) { if (rParam.aMetaData.shouldEscapeDateTime()) -- cgit