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>
This commit is contained in:
Jelle van der Waa
2013-08-17 22:14:22 +02:00
committed by Andrzej J.R. Hunt
parent f4004429d3
commit 9a1aca007f
6 changed files with 11 additions and 42 deletions

View File

@@ -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()

View File

@@ -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:

View File

@@ -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();

View File

@@ -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' ) );

View File

@@ -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;

View File

@@ -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();
}