summaryrefslogtreecommitdiff
path: root/cppuhelper/source/bootstrap.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cppuhelper/source/bootstrap.cxx')
-rw-r--r--cppuhelper/source/bootstrap.cxx25
1 files changed, 6 insertions, 19 deletions
diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx
index 6522f722ca62..6c90e5516c13 100644
--- a/cppuhelper/source/bootstrap.cxx
+++ b/cppuhelper/source/bootstrap.cxx
@@ -137,18 +137,11 @@ Reference< XComponentContext > SAL_CALL bootstrap()
!= rtl_Random_E_None )
throw BootstrapException( "random pool error!" );
rtl_random_destroyPool( hPool );
- ::rtl::OUStringBuffer buf;
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "uno" ) );
+ ::rtl::OUStringBuffer buf("uno");
for ( sal_uInt32 i = 0; i < ARLEN( bytes ); ++i )
buf.append( static_cast< sal_Int32 >( bytes[ i ] ) );
OUString sPipeName( buf.makeStringAndClear() );
- // accept string
- OSL_ASSERT( buf.isEmpty() );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "--accept=pipe,name=" ) );
- buf.append( sPipeName );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( ";urp;" ) );
-
// arguments
OUString args [] = {
OUString("--nologo"),
@@ -156,7 +149,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
OUString("--norestore"),
OUString("--nocrashreport"),
OUString("--nolockcheck"),
- buf.makeStringAndClear()
+ OUString("--accept=pipe,name=" + sPipeName + ";urp;")
};
rtl_uString * ar_args [] = {
args[ 0 ].pData,
@@ -200,12 +193,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
bridge::UnoUrlResolver::create( xLocalContext ) );
// connection string
- OSL_ASSERT( buf.isEmpty() );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "uno:pipe,name=" ) );
- buf.append( sPipeName );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(
- ";urp;StarOffice.ComponentContext" ) );
- OUString sConnectString( buf.makeStringAndClear() );
+ OUString sConnectString( "uno:pipe,name=" + sPipeName + ";urp;StarOffice.ComponentContext" );
// wait until office is started
for ( ; ; )
@@ -235,12 +223,11 @@ Reference< XComponentContext > SAL_CALL bootstrap()
}
OUString bootstrap_expandUri(OUString const & uri) {
- static char const PREFIX[] = "vnd.sun.star.expand:";
- return uri.matchAsciiL(RTL_CONSTASCII_STRINGPARAM(PREFIX))
+ OUString rest;
+ return uri.startsWith("vnd.sun.star.expand:", &rest)
? cppuhelper::detail::expandMacros(
rtl::Uri::decode(
- uri.copy(RTL_CONSTASCII_LENGTH(PREFIX)),
- rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8))
+ rest, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8))
: uri;
}