From 8548abbac5139569818516ca198c8086f4d1fd1f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 13 Dec 2013 11:10:10 +0200 Subject: Remove unnecessary use of OUString constructor in OUStringBuffer::append calls Convert code like aStrBuffer.append(OUString(" AS ")); to aStrBuffer.append(" AS "); Change-Id: I8c1884b5a875f40f0b5e511b6ef38c6c8eeee656 --- connectivity/source/commontools/dbtools2.cxx | 20 ++++++++++---------- connectivity/source/parse/sqlnode.cxx | 2 +- dbaccess/source/ui/querydesign/QueryDesignView.cxx | 8 ++++---- reportdesign/source/ui/dlg/Navigator.cxx | 4 ++-- sc/qa/unit/helper/qahelper.cxx | 4 ++-- sc/source/filter/xml/xmlexprt.cxx | 4 ++-- sc/source/ui/app/inputwin.cxx | 4 ++-- sc/source/ui/condformat/condformatdlg.cxx | 2 +- sc/source/ui/condformat/condformathelper.cxx | 8 ++++---- sc/source/ui/navipi/content.cxx | 4 ++-- sc/source/ui/vba/vbahelper.cxx | 4 ++-- scripting/source/provider/URIHelper.cxx | 2 +- sdext/source/minimizer/optimizerdialogcontrols.cxx | 2 +- sdext/source/minimizer/pppoptimizerdialog.cxx | 4 ++-- sdext/source/pdfimport/test/tests.cxx | 2 +- starmath/source/mathmlexport.cxx | 2 +- 16 files changed, 38 insertions(+), 38 deletions(-) diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index e208813c8d66..59f73496107f 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -156,7 +156,7 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const OUString aDefault = ::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DEFAULTVALUE))); if ( !aDefault.isEmpty() ) { - aSql.append(OUString(" DEFAULT ")); + aSql.append(" DEFAULT "); aSql.append(sPreFix); aSql.append(aDefault); aSql.append(sPostFix); @@ -188,7 +188,7 @@ OUString createStandardColumnPart(const Reference< XPropertySet >& xColProp,cons aSql.append(createStandardTypePart(xColProp, _xConnection, _sCreatePattern)); if(::comphelper::getINT32(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISNULLABLE))) == ColumnValue::NO_NULLS) - aSql.append(OUString(" NOT NULL")); + aSql.append(" NOT NULL"); if ( bIsAutoIncrement && !sAutoIncrementValue.isEmpty()) { @@ -221,7 +221,7 @@ OUString createStandardCreateStatement(const Reference< XPropertySet >& descript ::dbtools::throwFunctionSequenceException(_xConnection); aSql.append(sComposedName); - aSql.append(OUString(" (")); + aSql.append(" ("); // columns Reference xColumnSup(descriptor,UNO_QUERY); @@ -301,7 +301,7 @@ OUString createStandardKeyStatement(const Reference< XPropertySet >& descriptor, if(!xColumns.is() || !xColumns->getCount()) ::dbtools::throwFunctionSequenceException(_xConnection); - aSql.append(OUString(" PRIMARY KEY ")); + aSql.append(" PRIMARY KEY "); aSql.append(generateColumnNames(xColumns,xMetaData)); } else if(nKeyType == KeyType::UNIQUE) @@ -311,7 +311,7 @@ OUString createStandardKeyStatement(const Reference< XPropertySet >& descriptor, if(!xColumns.is() || !xColumns->getCount()) ::dbtools::throwFunctionSequenceException(_xConnection); - aSql.append(OUString(" UNIQUE ")); + aSql.append(" UNIQUE "); aSql.append(generateColumnNames(xColumns,xMetaData)); } else if(nKeyType == KeyType::FOREIGN) @@ -323,7 +323,7 @@ OUString createStandardKeyStatement(const Reference< XPropertySet >& descriptor, if(!xColumns.is() || !xColumns->getCount()) ::dbtools::throwFunctionSequenceException(_xConnection); - aSql.append(OUString(" FOREIGN KEY ")); + aSql.append(" FOREIGN KEY "); OUString sRefTable = getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_REFERENCEDTABLE))); ::dbtools::qualifiedNameComponents(xMetaData, sRefTable, @@ -342,16 +342,16 @@ OUString createStandardKeyStatement(const Reference< XPropertySet >& descriptor, switch(nDeleteRule) { case KeyRule::CASCADE: - aSql.append(OUString(" ON DELETE CASCADE ")); + aSql.append(" ON DELETE CASCADE "); break; case KeyRule::RESTRICT: - aSql.append(OUString(" ON DELETE RESTRICT ")); + aSql.append(" ON DELETE RESTRICT "); break; case KeyRule::SET_NULL: - aSql.append(OUString(" ON DELETE SET NULL ")); + aSql.append(" ON DELETE SET NULL "); break; case KeyRule::SET_DEFAULT: - aSql.append(OUString(" ON DELETE SET DEFAULT ")); + aSql.append(" ON DELETE SET DEFAULT "); break; default: ; diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index c99585bd5e1e..4f56f30c1392 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -459,7 +459,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(OUStringBuffer& rString, const if (nCount == 2) { if ( rParam.aMetaData.generateASBeforeCorrelationName() ) - rString.append(OUString(" AS ")); + rString.append(" AS "); m_aChildren[1]->impl_parseNodeToString_throw( rString, rParam, false ); } bHandled = true; diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index d5e87567cea7..b0c984ee86ae 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -2882,14 +2882,14 @@ OUString OQueryDesignView::getStatement() // ----------------- construct statement ---------------------- OUStringBuffer aSqlCmd(OUString("SELECT ")); if(rController.isDistinct()) - aSqlCmd.append(OUString(" DISTINCT ")); + aSqlCmd.append(" DISTINCT "); aSqlCmd.append(aFieldListStr); - aSqlCmd.append(OUString(" FROM ")); + aSqlCmd.append(" FROM "); aSqlCmd.append(aTableListStr); if (!aCriteriaListStr.isEmpty()) { - aSqlCmd.append(OUString(" WHERE ")); + aSqlCmd.append(" WHERE "); aSqlCmd.append(aCriteriaListStr.makeStringAndClear()); } Reference xMeta; @@ -2903,7 +2903,7 @@ OUString OQueryDesignView::getStatement() // ----------------- construct GroupBy and attachen ------------ if(!aHavingStr.isEmpty()) { - aSqlCmd.append(OUString(" HAVING ")); + aSqlCmd.append(" HAVING "); aSqlCmd.append(aHavingStr.makeStringAndClear()); } // ----------------- construct sorting and attach ------------ diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index 3be8f7ab9f32..9e5b9d67e099 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -89,7 +89,7 @@ OUString lcl_getName(const uno::Reference< beans::XPropertySet>& _xElement) uno::Reference< report::XReportControlModel> xReportModel(_xElement,uno::UNO_QUERY); if ( xFixedText.is() ) { - sName.append(OUString(" : ")); + sName.append(" : "); sName.append(xFixedText->getLabel()); } else if ( xReportModel.is() && _xElement->getPropertySetInfo()->hasPropertyByName(PROPERTY_DATAFIELD) ) @@ -97,7 +97,7 @@ OUString lcl_getName(const uno::Reference< beans::XPropertySet>& _xElement) ReportFormula aFormula( xReportModel->getDataField() ); if ( aFormula.isValid() ) { - sName.append(OUString(" : ")); + sName.append(" : "); sName.append( aFormula.getUndecoratedContent() ); } } diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index 1378e726a7ea..7666c34db042 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -524,8 +524,8 @@ void ScBootstrapFixture::createFileURL( void ScBootstrapFixture::createCSVPath(const OUString& aFileBase, OUString& rCSVPath) { OUStringBuffer aBuffer( getSrcRootPath()); - aBuffer.append(m_aBaseString).append(OUString("/contentCSV/")); - aBuffer.append(aFileBase).append(OUString("csv")); + aBuffer.append(m_aBaseString).append("/contentCSV/"); + aBuffer.append(aFileBase).append("csv"); rCSVPath = aBuffer.makeStringAndClear(); } diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index eadcd3b97042..d1b5af3799f2 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -4248,14 +4248,14 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab) aCond.append(pEntry->GetExpression(aPos, 0, 0, formula::FormulaGrammar::GRAM_ODFF)); break; case SC_COND_BETWEEN: - aCond.append(OUString("between(")); + aCond.append("between("); aCond.append(pEntry->GetExpression(aPos, 0, 0, formula::FormulaGrammar::GRAM_ODFF)); aCond.append(','); aCond.append(pEntry->GetExpression(aPos, 1, 0, formula::FormulaGrammar::GRAM_ODFF)); aCond.append(')'); break; case SC_COND_NOTBETWEEN: - aCond.append(OUString("not-between(")); + aCond.append("not-between("); aCond.append(pEntry->GetExpression(aPos, 0, 0, formula::FormulaGrammar::GRAM_ODFF)); aCond.append(','); aCond.append(pEntry->GetExpression(aPos, 1, 0, formula::FormulaGrammar::GRAM_ODFF)); diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index b32fb5d7506e..040727636070 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -2107,9 +2107,9 @@ namespace { OUString createLocalRangeName(const OUString& rName, const OUString& rTableName) { OUStringBuffer aString (rName); - aString.append(OUString(" (")); + aString.append(" ("); aString.append(rTableName); - aString.append(OUString(")")); + aString.append(")"); return aString.makeStringAndClear(); } diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 907c1b629472..80c51b74c2f2 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -369,7 +369,7 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScCond mpLastEdit(NULL) { OUStringBuffer aTitle( GetText() ); - aTitle.append(OUString(" ")); + aTitle.append(" "); OUString aRangeString; rRange.Format(aRangeString, SCA_VALID, pDoc, pDoc->GetAddressConvention()); aTitle.append(aRangeString); diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx index ad1c1cb50cb3..3d5f0f83af58 100644 --- a/sc/source/ui/condformat/condformathelper.cxx +++ b/sc/source/ui/condformat/condformathelper.cxx @@ -126,13 +126,13 @@ OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rFormat, c else { aBuffer.append(getTextForType(CONDITION)); - aBuffer.append(OUString(" ")); + aBuffer.append(" "); aBuffer.append(getExpression(static_cast(eMode))); - aBuffer.append(OUString(" ")); + aBuffer.append(" "); if(eMode == SC_COND_BETWEEN || eMode == SC_COND_NOTBETWEEN) { aBuffer.append(pEntry->GetExpression(rPos, 0)); - aBuffer.append(OUString(" and ")); + aBuffer.append(" and "); aBuffer.append(pEntry->GetExpression(rPos, 1)); } else if(eMode <= SC_COND_NOTEQUAL || eMode >= SC_COND_BEGINS_WITH) @@ -169,7 +169,7 @@ OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sal_Int OUString aStr1, OUString aStr2 ) { OUStringBuffer aBuffer(getTextForType(eType)); - aBuffer.append(OUString(" ")); + aBuffer.append(" "); if(eType == CONDITION) { // workaround missing FORMULA option in the conditions case diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index e8c11f5abdc1..b305e560a1ab 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -830,9 +830,9 @@ namespace { OUString createLocalRangeName(const OUString& rName, const OUString& rTableName) { OUStringBuffer aString (rName); - aString.append(OUString(" (")); + aString.append(" ("); aString.append(rTableName); - aString.append(OUString(")")); + aString.append(")"); return aString.makeStringAndClear(); } } diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx index cc94e5aae872..fbe95423d954 100644 --- a/sc/source/ui/vba/vbahelper.cxx +++ b/sc/source/ui/vba/vbahelper.cxx @@ -597,11 +597,11 @@ OUString VBAToRegexp(const OUString &rIn, bool bForLike ) start++; break; case '*': - sResult.append(OUString(".*")); + sResult.append(".*"); start++; break; case '#': - sResult.append(OUString("[0-9]")); + sResult.append("[0-9]"); start++; break; case '~': diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx index 4d5a7a54a9a3..6b49525b9575 100644 --- a/scripting/source/provider/URIHelper.cxx +++ b/scripting/source/provider/URIHelper.cxx @@ -246,7 +246,7 @@ ScriptingFrameworkURIHelper::getStorageURI(const OUString& rScriptURI) OUStringBuffer buf(120); buf.append(m_sBaseURI); - buf.append(OUString("/")); + buf.append("/"); buf.append(getLanguagePath(sLanguagePart)); OUString result = buf.makeStringAndClear(); diff --git a/sdext/source/minimizer/optimizerdialogcontrols.cxx b/sdext/source/minimizer/optimizerdialogcontrols.cxx index 3e5d95e50c71..86aae05b244f 100644 --- a/sdext/source/minimizer/optimizerdialogcontrols.cxx +++ b/sdext/source/minimizer/optimizerdialogcontrols.cxx @@ -597,7 +597,7 @@ static OUString ImpValueOfInMB( const sal_Int64& rVal, sal_Unicode nSeparator = aVal.setLength( nX + 2 ); aVal[nX] = nSeparator; } - aVal.append( OUString(" MB") ); + aVal.append( " MB" ); return aVal.makeStringAndClear(); } diff --git a/sdext/source/minimizer/pppoptimizerdialog.cxx b/sdext/source/minimizer/pppoptimizerdialog.cxx index 1cfc874a88fa..64aac3e0211e 100644 --- a/sdext/source/minimizer/pppoptimizerdialog.cxx +++ b/sdext/source/minimizer/pppoptimizerdialog.cxx @@ -144,9 +144,9 @@ void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL, { OUStringBuffer sBuf( OUString("Your Presentation has been minimized from:") ); sBuf.append( OUString::number( nFileSizeSource >> 10 ) ); - sBuf.append( OUString("KB to ") ); + sBuf.append( "KB to " ); sBuf.append( OUString::number( nFileSizeDest >> 10 ) ); - sBuf.append( OUString("KB.") ); + sBuf.append( "KB." ); OUString sResult( sBuf.makeStringAndClear() ); SAL_INFO("sdext.minimizer", sResult ); } diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx index a1cb3176507e..93c3a53c8b71 100644 --- a/sdext/source/pdfimport/test/tests.cxx +++ b/sdext/source/pdfimport/test/tests.cxx @@ -353,7 +353,7 @@ namespace virtual void endText() { - m_aTextOut.append( OUString("\n") ); + m_aTextOut.append( "\n" ); } virtual void drawMask(const uno::Sequence& xBitmap, diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index 6531d8d84ad3..7fb713d4f589 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -993,7 +993,7 @@ void SmXMLExport::ExportBlank(const SmNode *pNode, int /*nLevel*/) // (see SmBlankNode::IncreaseBy for how pTemp->nNum is set). OUStringBuffer sStrBuf; ::sax::Converter::convertDouble(sStrBuf, pTemp->GetBlankNum() * .5); - sStrBuf.append(OUString("em")); + sStrBuf.append("em"); AddAttribute(XML_NAMESPACE_MATH, XML_WIDTH, sStrBuf.getStr()); } -- cgit