summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2012-12-30 13:47:18 -0200
committerLuboš Luňák <l.lunak@suse.cz>2013-01-03 17:07:41 +0000
commit695f4a18e6e538f8d6080f486695e4f58f8bd574 (patch)
treef07bc6fab9e915cc4b50d2e5c94bcebf4ca4ac33 /basic
parent87f2e713ea819d1e36084ba7813ee6671237206c (diff)
fdo#57950: Fix some chained appends in basic
Change-Id: Icac8ec992d993748a063aa95cc6f58c24fa87444 Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/1515 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/basmgr/basicmanagerrepository.cxx8
-rw-r--r--basic/source/classes/sb.cxx13
-rw-r--r--basic/source/uno/namecont.cxx4
-rw-r--r--basic/source/uno/scriptcont.cxx18
4 files changed, 18 insertions, 25 deletions
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx
index 2d281dc3ab64..8b86596e5e2e 100644
--- a/basic/source/basmgr/basicmanagerrepository.cxx
+++ b/basic/source/basmgr/basicmanagerrepository.cxx
@@ -308,11 +308,9 @@ namespace basic
OUString aFileName( aAppBasic.getName() );
aAppBasic = INetURLObject( aAppBasicDir.getToken(1, ';') );
DBG_ASSERT(aAppBasic.GetProtocol() != INET_PROT_NOT_VALID,
- OStringBuffer("Invalid URL: \"").
- append(OUStringToOString(aAppBasicDir,
- osl_getThreadTextEncoding())).
- append('"').getStr()
- );
+ OString("Invalid URL: \"" +
+ OUStringToOString(aAppBasicDir, osl_getThreadTextEncoding()) +
+ "\""));
aAppBasic.insertName( aFileName );
pBasicManager->SetStorageName( aAppBasic.PathToFileName() );
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 48a2c6612780..12cb5da4e92b 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1663,9 +1663,9 @@ void StarBASIC::MakeErrorText( SbError nId, const OUString& aMsg )
}
else if( nOldID != 0 )
{
- OUStringBuffer aStdMsg;
- aStdMsg.append("Fehler ").append(static_cast<sal_Int32>(nOldID)).append(": Kein Fehlertext verfuegbar!");
- GetSbData()->aErrMsg = aStdMsg.makeStringAndClear();
+ OUString aStdMsg = "Fehler " + OUString::valueOf(static_cast<sal_Int32>(nOldID)) +
+ ": Kein Fehlertext verfuegbar!";
+ GetSbData()->aErrMsg = aStdMsg;
}
else
{
@@ -1741,10 +1741,9 @@ sal_Bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sa
// like vba ( adds an error number etc )
if ( SbiRuntime::isVBAEnabled() && ( code == SbERR_BASIC_COMPAT ) )
{
- OUStringBuffer aTmp;
- aTmp.append('\'').append(SbxErrObject::getUnoErrObject()->getNumber())
- .append("\'\n").append(!GetSbData()->aErrMsg.isEmpty() ? GetSbData()->aErrMsg : rMsg);
- code = (sal_uIntPtr)*new StringErrorInfo( code, aTmp.makeStringAndClear() );
+ OUString aTmp = "\'" + OUString::valueOf(SbxErrObject::getUnoErrObject()->getNumber()) +
+ "\'\n" + OUString(!GetSbData()->aErrMsg.isEmpty() ? GetSbData()->aErrMsg : rMsg);
+ code = (sal_uIntPtr)*new StringErrorInfo( code, aTmp );
}
else
{
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 92b38c6f3836..2a61123290e3 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -237,9 +237,7 @@ void NameContainer::removeByName( const OUString& aName )
NameContainerNameMap::iterator aIt = mHashMap.find( aName );
if( aIt == mHashMap.end() )
{
- OUString sMessage = OUStringBuffer().append('"')
- .append(aName).append("\" not found")
- .makeStringAndClear();
+ OUString sMessage = "\"" + aName + "\" not found";
throw NoSuchElementException(sMessage, uno::Reference< uno::XInterface >());
}
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index ad5849923fd1..a7f870c240ec 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -678,11 +678,10 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
if( !isLibraryElementValid( pLib->getByName( aElementName ) ) )
{
#if OSL_DEBUG_LEVEL > 0
- OStringBuffer aMessage;
- aMessage.append( "invalid library element '" );
- aMessage.append( OUStringToOString( aElementName, osl_getThreadTextEncoding() ) );
- aMessage.append( "'." );
- OSL_FAIL( aMessage.makeStringAndClear().getStr() );
+ OString aMessage = "invalid library element '" +
+ OUStringToOString( aElementName, osl_getThreadTextEncoding() ) +
+ "'.";
+ OSL_FAIL( aMessage );
#endif
continue;
}
@@ -767,11 +766,10 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
if( !isLibraryElementValid( pLib->getByName( aElementName ) ) )
{
#if OSL_DEBUG_LEVEL > 0
- OStringBuffer aMessage;
- aMessage.append( "invalid library element '" );
- aMessage.append( OUStringToOString( aElementName, osl_getThreadTextEncoding() ) );
- aMessage.append( "'." );
- OSL_FAIL( aMessage.makeStringAndClear().getStr() );
+ OString aMessage = "invalid library element '" +
+ OUStringToOString( aElementName, osl_getThreadTextEncoding() ) +
+ "'.";
+ OSL_FAIL( aMessage );
#endif
continue;
}