diff options
author | Chr. Rossmanith <ChrRossmanith@gmx.de> | 2013-10-22 21:58:03 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-23 10:44:09 +0200 |
commit | 1ed2c24a6e638ad7793c46427e4c49e42d435239 (patch) | |
tree | c1da9eb5d79baea4eb1e3bbf87e11407d8894076 /cpputools | |
parent | cd7c0c6adfff3509630fda21d483c2cf5d76d275 (diff) |
remove RTL_CONSTASCII_(U)STRINGPARAM
Change-Id: I0bce921bfc7102b9a33b1c87eee3ddec0ebaed7b
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, with one little typo fix
Diffstat (limited to 'cpputools')
-rw-r--r-- | cpputools/source/unoexe/unoexe.cxx | 65 |
1 files changed, 24 insertions, 41 deletions
diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index 1a7ace1a5350..fe1d9766941a 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -105,11 +105,9 @@ static sal_Bool readOption( OUString * pValue, const sal_Char * pOpt, rtl_getAppCommandArg(*pnIndex, &pValue->pData); if (*pnIndex >= rtl_getAppCommandArgCount() || pValue->copy(1).equals(dash)) { - OUStringBuffer buf( 32 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("incomplete option \"-") ); - buf.appendAscii( pOpt ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" given!") ); - throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() ); + throw RuntimeException( + "incomplete option \"-" + aOpt + "\" given!", + Reference< XInterface >() ); } else { @@ -172,24 +170,20 @@ void createInstance( if (! x.is()) { - OUStringBuffer buf( 64 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("cannot get service instance \"") ); - buf.append( rServiceName ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") ); - throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() ); + throw RuntimeException( + "cannot get service instance \"" + rServiceName + "\"!", + Reference< XInterface >() ); } rxOut = Reference< T >::query( x ); if (! rxOut.is()) { - OUStringBuffer buf( 64 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("service instance \"") ); - buf.append( rServiceName ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" does not support demanded interface \"") ); const Type & rType = ::getCppuType( (const Reference< T > *)0 ); - buf.append( rType.getTypeName() ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") ); - throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() ); + throw RuntimeException( + "service instance \"" + rServiceName + + "\" does not support demanded interface \"" + + rType.getTypeName() + "\"!", + Reference< XInterface >() ); } } @@ -222,11 +216,9 @@ static Reference< XInterface > loadComponent( } else { - OUStringBuffer buf( 64 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("unknown extension of \"") ); - buf.append( rLocation ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"! No loader available!") ); - throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() ); + throw RuntimeException( + "unknown extension of \"" + rLocation + "\"! No loader available!", + Reference< XInterface >() ); } Reference< XInterface > xInstance; @@ -256,24 +248,18 @@ static Reference< XInterface > loadComponent( if (! xInstance.is()) { - OUStringBuffer buf( 64 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("activating component \"") ); - buf.append( rImplName ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" from location \"") ); - buf.append( rLocation ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" failed!") ); - throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() ); + throw RuntimeException( + "activating component \"" + rImplName + "\" from location \"" + rLocation + "\" failed!", + Reference< XInterface >() ); } return xInstance; } else { - OUStringBuffer buf( 64 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("location \"") ); - buf.append( rLocation ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" has no extension! Cannot determine loader to be used!") ); - throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() ); + throw RuntimeException( + "location \"" + rLocation + "\" has no extension! Cannot determine loader to be used!", + Reference< XInterface >() ); } } @@ -370,11 +356,9 @@ Reference< XInterface > OInstanceProvider::getInstance( const OUString & rName ) out( "\n> error: " ); out( rExc.Message ); } - OUStringBuffer buf( 64 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("no such element \"") ); - buf.append( rName ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") ); - throw NoSuchElementException( buf.makeStringAndClear(), Reference< XInterface >() ); + throw NoSuchElementException( + "no such element \"" + rName + "\"!", + Reference< XInterface >() ); } struct ODisposingListener : public WeakImplHelper1< XEventListener > @@ -462,8 +446,7 @@ SAL_IMPLEMENT_MAIN() throw RuntimeException("give component exOR service name!", Reference< XInterface >() ); if (aImplName.isEmpty() && aServiceName.isEmpty()) { - if (! aUnoUrl.endsWithIgnoreAsciiCaseAsciiL( - RTL_CONSTASCII_STRINGPARAM(";uno.ComponentContext") )) + if (! aUnoUrl.endsWithIgnoreAsciiCase( ";uno.ComponentContext" )) throw RuntimeException( OUString("expected UNO-URL with instance name uno.ComponentContext!" ), Reference<XInterface>() ); |