summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@vdwaa.nl>2013-08-17 22:14:22 +0200
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2013-08-19 06:04:40 +0000
commit9a1aca007fd06f3f8223ee02a79e44099d778b51 (patch)
treed924ea710e268085f54f9bf8d4d637d22a68e45b
parentf4004429d339009bec6babe30becdc9c727940b8 (diff)
fdo#57950: Remove some chained appends in dbaccess
Change-Id: If93b4a11ac15ede2b08ef42bb2fa4670f0d4cd24 Reviewed-on: https://gerrit.libreoffice.org/5481 Reviewed-by: Andrzej J.R. Hunt <andrzej@ahunt.org> Tested-by: Andrzej J.R. Hunt <andrzej@ahunt.org>
-rw-r--r--dbaccess/qa/extras/macros-test.cxx6
-rw-r--r--dbaccess/source/core/recovery/subcomponentrecovery.cxx5
-rw-r--r--dbaccess/source/ext/macromigration/migrationengine.cxx19
-rw-r--r--dbaccess/source/ext/macromigration/migrationlog.cxx14
-rw-r--r--dbaccess/source/sdbtools/connection/objectnames.cxx6
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx3
6 files changed, 11 insertions, 42 deletions
diff --git a/dbaccess/qa/extras/macros-test.cxx b/dbaccess/qa/extras/macros-test.cxx
index cc0a437af2da..bcff5342f3d1 100644
--- a/dbaccess/qa/extras/macros-test.cxx
+++ b/dbaccess/qa/extras/macros-test.cxx
@@ -51,11 +51,7 @@ private:
void DBAccessTest::createFileURL(const OUString& aFileBase, const OUString& aFileExtension, OUString& rFilePath)
{
- OUString aSep("/");
- OUStringBuffer aBuffer( getSrcRootURL() );
- aBuffer.append(m_aBaseString);
- aBuffer.append(aSep).append(aFileBase).append(aFileExtension);
- rFilePath = aBuffer.makeStringAndClear();
+ rFilePath = getSrcRootURL() + m_aBaseString + "/" + aFileBase + aFileExtension;
}
DBAccessTest::DBAccessTest()
diff --git a/dbaccess/source/core/recovery/subcomponentrecovery.cxx b/dbaccess/source/core/recovery/subcomponentrecovery.cxx
index af11780ea5fc..09817873241a 100644
--- a/dbaccess/source/core/recovery/subcomponentrecovery.cxx
+++ b/dbaccess/source/core/recovery/subcomponentrecovery.cxx
@@ -218,10 +218,7 @@ namespace dbaccess
private:
OUString impl_prefix( const ::xmloff::token::XMLTokenEnum i_eToken )
{
- OUStringBuffer aQualifiedName( m_aNamespace );
- aQualifiedName.append( sal_Unicode( ':' ) );
- aQualifiedName.append( ::xmloff::token::GetXMLToken( i_eToken ) );
- return aQualifiedName.makeStringAndClear();
+ return m_aNamespace + ":" + ::xmloff::token::GetXMLToken( i_eToken );
}
private:
diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx
index c0ec4352fdda..8d0b5f1ce63d 100644
--- a/dbaccess/source/ext/macromigration/migrationengine.cxx
+++ b/dbaccess/source/ext/macromigration/migrationengine.cxx
@@ -1253,12 +1253,7 @@ namespace dbmm
}
sBaseName = aReplacement.makeStringAndClear();
- OUStringBuffer aNewLibNameAttempt;
- aNewLibNameAttempt.append( sPrefix );
- aNewLibNameAttempt.append( sBaseName );
- aNewLibNameAttempt.appendAscii( "_" );
- aNewLibNameAttempt.append( _rSourceLibName );
- OUString sTargetName( aNewLibNameAttempt.makeStringAndClear() );
+ OUString sTargetName( sPrefix + sBaseName + "_" + _rSourceLibName );
if ( !_rxTargetContainer->hasByName( sTargetName ) )
return sTargetName;
}
@@ -1267,12 +1262,7 @@ namespace dbmm
// (The latter is valid, since there can be multiple sub documents with the same base name,
// in different levels in the hierarchy.)
// In this case, just use the umambiguous sub document number.
- OUStringBuffer aNewLibName;
- aNewLibName.append( sPrefix );
- aNewLibName.append( OUString::valueOf( sal_Int64( _rDocument.nNumber ) ) );
- aNewLibName.appendAscii( "_" );
- aNewLibName.append( _rSourceLibName );
- return aNewLibName.makeStringAndClear();
+ return sPrefix + OUString::valueOf( sal_Int64( _rDocument.nNumber ) ) + "_" + _rSourceLibName;
}
}
@@ -1680,10 +1670,7 @@ namespace dbmm
OSL_ENSURE( sLibrary != sNewLibName,
"MigrationEngine_Impl::impl_adjustScriptLibrary_nothrow: a library which has not been migrated?" );
- OUStringBuffer aNewLocation;
- aNewLocation.append( sNewLibName );
- aNewLocation.append( sScriptName.copy( nLibModuleSeparator ) );
- xUri->setName( aNewLocation.makeStringAndClear() );
+ xUri->setName( sNewLibName + sScriptName.copy( nLibModuleSeparator ) );
// update the new script URL
_inout_rScriptCode = xUri->getUriReference();
diff --git a/dbaccess/source/ext/macromigration/migrationlog.cxx b/dbaccess/source/ext/macromigration/migrationlog.cxx
index cee60652defb..f4c1ac9068f5 100644
--- a/dbaccess/source/ext/macromigration/migrationlog.cxx
+++ b/dbaccess/source/ext/macromigration/migrationlog.cxx
@@ -430,11 +430,8 @@ namespace dbmm
OUString sBackedUp( MacroMigrationResId( STR_SAVED_COPY_TO ) );
sBackedUp = sBackedUp.replaceAll( "$location$", m_pData->sBackupLocation );
- aBuffer.appendAscii( "=== " );
- aBuffer.append ( OUString( MacroMigrationResId( STR_DATABASE_DOCUMENT ) ) );
- aBuffer.appendAscii( " ===\n" );
- aBuffer.append ( sBackedUp );
- aBuffer.appendAscii( "\n\n" );
+ aBuffer.append( "=== " + OUString( MacroMigrationResId( STR_DATABASE_DOCUMENT ) )
+ + " ===\n" + sBackedUp + "\n\n");
}
if ( !m_pData->aFailures.empty() )
@@ -459,9 +456,7 @@ namespace dbmm
OUString sDocTitle( MacroMigrationResId( rDoc.eType == eForm ? STR_FORM : STR_REPORT ) );
sDocTitle = sDocTitle.replaceAll( "$name$", rDoc.sName );
- aBuffer.appendAscii( "=== " );
- aBuffer.append ( sDocTitle );
- aBuffer.appendAscii( " ===\n" );
+ aBuffer.append( "=== " + sDocTitle + " ===\n" );
for ( ::std::vector< LibraryEntry >::const_iterator lib = rDoc.aMovedLibraries.begin();
lib != rDoc.aMovedLibraries.end();
@@ -473,8 +468,7 @@ namespace dbmm
sMovedLib = sMovedLib.replaceAll( "$old$", lib->sOldName );
sMovedLib = sMovedLib.replaceAll( "$new$", lib->sNewName );
- aBuffer.append( sMovedLib );
- aBuffer.append( sal_Unicode( '\n' ) );
+ aBuffer.append( sMovedLib + "\n" );
}
aBuffer.append( sal_Unicode( '\n' ) );
diff --git a/dbaccess/source/sdbtools/connection/objectnames.cxx b/dbaccess/source/sdbtools/connection/objectnames.cxx
index add350929508..2f3318c3903d 100644
--- a/dbaccess/source/sdbtools/connection/objectnames.cxx
+++ b/dbaccess/source/sdbtools/connection/objectnames.cxx
@@ -428,11 +428,7 @@ namespace sdbtools
sal_Int32 i = 1;
while ( !pNameCheck->validateName( sName ) )
{
- OUStringBuffer aNameBuffer;
- aNameBuffer.append( sBaseName );
- aNameBuffer.appendAscii( " " );
- aNameBuffer.append( (sal_Int32)++i );
- sName = aNameBuffer.makeStringAndClear();
+ sName = sBaseName + " " + OUString::number(++i);
}
return sName;
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index c00dc88bedb5..f27844576089 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -261,8 +261,7 @@ OUString ObjectCopySource::getSelectStatement() const
aSQL.appendAscii( ", " );
}
- aSQL.appendAscii( "FROM " );
- aSQL.append( ::dbtools::composeTableNameForSelect( m_xConnection, m_xObject ) );
+ aSQL.append( "FROM " + ::dbtools::composeTableNameForSelect( m_xConnection, m_xObject ) );
sSelectStatement = aSQL.makeStringAndClear();
}