Kaydet (Commit) 1ed2c24a authored tarafından Chr. Rossmanith's avatar Chr. Rossmanith Kaydeden (comit) Stephan Bergmann

remove RTL_CONSTASCII_(U)STRINGPARAM

Change-Id: I0bce921bfc7102b9a33b1c87eee3ddec0ebaed7b
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, with one little typo fix
üst cd7c0c6a
...@@ -137,18 +137,11 @@ Reference< XComponentContext > SAL_CALL bootstrap() ...@@ -137,18 +137,11 @@ Reference< XComponentContext > SAL_CALL bootstrap()
!= rtl_Random_E_None ) != rtl_Random_E_None )
throw BootstrapException( "random pool error!" ); throw BootstrapException( "random pool error!" );
rtl_random_destroyPool( hPool ); rtl_random_destroyPool( hPool );
::rtl::OUStringBuffer buf; ::rtl::OUStringBuffer buf("uno");
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "uno" ) );
for ( sal_uInt32 i = 0; i < ARLEN( bytes ); ++i ) for ( sal_uInt32 i = 0; i < ARLEN( bytes ); ++i )
buf.append( static_cast< sal_Int32 >( bytes[ i ] ) ); buf.append( static_cast< sal_Int32 >( bytes[ i ] ) );
OUString sPipeName( buf.makeStringAndClear() ); 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 // arguments
OUString args [] = { OUString args [] = {
OUString("--nologo"), OUString("--nologo"),
...@@ -156,7 +149,7 @@ Reference< XComponentContext > SAL_CALL bootstrap() ...@@ -156,7 +149,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
OUString("--norestore"), OUString("--norestore"),
OUString("--nocrashreport"), OUString("--nocrashreport"),
OUString("--nolockcheck"), OUString("--nolockcheck"),
buf.makeStringAndClear() OUString("--accept=pipe,name=" + sPipeName + ";urp;")
}; };
rtl_uString * ar_args [] = { rtl_uString * ar_args [] = {
args[ 0 ].pData, args[ 0 ].pData,
...@@ -200,12 +193,7 @@ Reference< XComponentContext > SAL_CALL bootstrap() ...@@ -200,12 +193,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
bridge::UnoUrlResolver::create( xLocalContext ) ); bridge::UnoUrlResolver::create( xLocalContext ) );
// connection string // connection string
OSL_ASSERT( buf.isEmpty() ); OUString sConnectString( "uno:pipe,name=" + sPipeName + ";urp;StarOffice.ComponentContext" );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "uno:pipe,name=" ) );
buf.append( sPipeName );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(
";urp;StarOffice.ComponentContext" ) );
OUString sConnectString( buf.makeStringAndClear() );
// wait until office is started // wait until office is started
for ( ; ; ) for ( ; ; )
...@@ -235,12 +223,11 @@ Reference< XComponentContext > SAL_CALL bootstrap() ...@@ -235,12 +223,11 @@ Reference< XComponentContext > SAL_CALL bootstrap()
} }
OUString bootstrap_expandUri(OUString const & uri) { OUString bootstrap_expandUri(OUString const & uri) {
static char const PREFIX[] = "vnd.sun.star.expand:"; OUString rest;
return uri.matchAsciiL(RTL_CONSTASCII_STRINGPARAM(PREFIX)) return uri.startsWith("vnd.sun.star.expand:", &rest)
? cppuhelper::detail::expandMacros( ? cppuhelper::detail::expandMacros(
rtl::Uri::decode( rtl::Uri::decode(
uri.copy(RTL_CONSTASCII_LENGTH(PREFIX)), rest, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8))
rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8))
: uri; : uri;
} }
......
...@@ -80,20 +80,18 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p ...@@ -80,20 +80,18 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p
return "void"; return "void";
OUStringBuffer buf( 64 ); OUStringBuffer buf( 64 );
buf.append( (sal_Unicode)'(' ); buf.append( "(" + pTypeRef->pTypeName + ")" );
buf.append( pTypeRef->pTypeName );
buf.append( (sal_Unicode)')' );
switch (pTypeRef->eTypeClass) switch (pTypeRef->eTypeClass)
{ {
case typelib_TypeClass_INTERFACE: case typelib_TypeClass_INTERFACE:
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); buf.append( "0x" );
buf.append( (sal_Int64)*(void **)pVal, 16 ); buf.append( (sal_Int64)*(void **)pVal, 16 );
break; break;
case typelib_TypeClass_STRUCT: case typelib_TypeClass_STRUCT:
case typelib_TypeClass_EXCEPTION: case typelib_TypeClass_EXCEPTION:
{ {
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("{ ") ); buf.append( "{ " );
typelib_TypeDescription * pTypeDescr = 0; typelib_TypeDescription * pTypeDescr = 0;
::typelib_typedescriptionreference_getDescription( &pTypeDescr, pTypeRef ); ::typelib_typedescriptionreference_getDescription( &pTypeDescr, pTypeRef );
OSL_ASSERT( pTypeDescr ); OSL_ASSERT( pTypeDescr );
...@@ -107,7 +105,7 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p ...@@ -107,7 +105,7 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p
{ {
buf.append( val2str( pVal, ((typelib_TypeDescription *)pCompType->pBaseTypeDescription)->pWeakRef ) ); buf.append( val2str( pVal, ((typelib_TypeDescription *)pCompType->pBaseTypeDescription)->pWeakRef ) );
if (nDescr) if (nDescr)
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(", ") ); buf.append( ", " );
} }
typelib_TypeDescriptionReference ** ppTypeRefs = pCompType->ppTypeRefs; typelib_TypeDescriptionReference ** ppTypeRefs = pCompType->ppTypeRefs;
...@@ -117,18 +115,18 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p ...@@ -117,18 +115,18 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p
for ( sal_Int32 nPos = 0; nPos < nDescr; ++nPos ) for ( sal_Int32 nPos = 0; nPos < nDescr; ++nPos )
{ {
buf.append( ppMemberNames[ nPos ] ); buf.append( ppMemberNames[ nPos ] );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(" = ") ); buf.append( " = " );
typelib_TypeDescription * pMemberType = 0; typelib_TypeDescription * pMemberType = 0;
TYPELIB_DANGER_GET( &pMemberType, ppTypeRefs[ nPos ] ); TYPELIB_DANGER_GET( &pMemberType, ppTypeRefs[ nPos ] );
buf.append( val2str( (char *)pVal + pMemberOffsets[ nPos ], pMemberType->pWeakRef ) ); buf.append( val2str( (char *)pVal + pMemberOffsets[ nPos ], pMemberType->pWeakRef ) );
TYPELIB_DANGER_RELEASE( pMemberType ); TYPELIB_DANGER_RELEASE( pMemberType );
if (nPos < (nDescr -1)) if (nPos < (nDescr -1))
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(", ") ); buf.append( ", " );
} }
::typelib_typedescription_release( pTypeDescr ); ::typelib_typedescription_release( pTypeDescr );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(" }") ); buf.append( " }" );
break; break;
} }
case typelib_TypeClass_SEQUENCE: case typelib_TypeClass_SEQUENCE:
...@@ -145,29 +143,29 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p ...@@ -145,29 +143,29 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p
if (nElements) if (nElements)
{ {
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("{ ") ); buf.append( "{ " );
char * pElements = pSequence->elements; char * pElements = pSequence->elements;
for ( sal_Int32 nPos = 0; nPos < nElements; ++nPos ) for ( sal_Int32 nPos = 0; nPos < nElements; ++nPos )
{ {
buf.append( val2str( pElements + (nElementSize * nPos), pElementTypeDescr->pWeakRef ) ); buf.append( val2str( pElements + (nElementSize * nPos), pElementTypeDescr->pWeakRef ) );
if (nPos < (nElements -1)) if (nPos < (nElements -1))
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(", ") ); buf.append( ", " );
} }
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(" }") ); buf.append( " }" );
} }
else else
{ {
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("{}") ); buf.append( "{}" );
} }
TYPELIB_DANGER_RELEASE( pElementTypeDescr ); TYPELIB_DANGER_RELEASE( pElementTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr ); TYPELIB_DANGER_RELEASE( pTypeDescr );
break; break;
} }
case typelib_TypeClass_ANY: case typelib_TypeClass_ANY:
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("{ ") ); buf.append( "{ " );
buf.append( val2str( ((uno_Any *)pVal)->pData, buf.append( val2str( ((uno_Any *)pVal)->pData,
((uno_Any *)pVal)->pType ) ); ((uno_Any *)pVal)->pType ) );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(" }") ); buf.append( " }" );
break; break;
case typelib_TypeClass_TYPE: case typelib_TypeClass_TYPE:
buf.append( (*(typelib_TypeDescriptionReference **)pVal)->pTypeName ); buf.append( (*(typelib_TypeDescriptionReference **)pVal)->pTypeName );
...@@ -202,9 +200,9 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p ...@@ -202,9 +200,9 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p
} }
case typelib_TypeClass_BOOLEAN: case typelib_TypeClass_BOOLEAN:
if (*(sal_Bool *)pVal) if (*(sal_Bool *)pVal)
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("true") ); buf.append( "true" );
else else
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("false") ); buf.append( "false" );
break; break;
case typelib_TypeClass_CHAR: case typelib_TypeClass_CHAR:
buf.append( (sal_Unicode)'\'' ); buf.append( (sal_Unicode)'\'' );
...@@ -218,28 +216,28 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p ...@@ -218,28 +216,28 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p
buf.append( *(double *)pVal ); buf.append( *(double *)pVal );
break; break;
case typelib_TypeClass_BYTE: case typelib_TypeClass_BYTE:
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); buf.append( "0x" );
buf.append( (sal_Int32)*(sal_Int8 *)pVal, 16 ); buf.append( (sal_Int32)*(sal_Int8 *)pVal, 16 );
break; break;
case typelib_TypeClass_SHORT: case typelib_TypeClass_SHORT:
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); buf.append( "0x" );
buf.append( (sal_Int32)*(sal_Int16 *)pVal, 16 ); buf.append( (sal_Int32)*(sal_Int16 *)pVal, 16 );
break; break;
case typelib_TypeClass_UNSIGNED_SHORT: case typelib_TypeClass_UNSIGNED_SHORT:
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); buf.append( "0x" );
buf.append( (sal_Int32)*(sal_uInt16 *)pVal, 16 ); buf.append( (sal_Int32)*(sal_uInt16 *)pVal, 16 );
break; break;
case typelib_TypeClass_LONG: case typelib_TypeClass_LONG:
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); buf.append( "0x" );
buf.append( *(sal_Int32 *)pVal, 16 ); buf.append( *(sal_Int32 *)pVal, 16 );
break; break;
case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_UNSIGNED_LONG:
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); buf.append( "0x" );
buf.append( (sal_Int64)*(sal_uInt32 *)pVal, 16 ); buf.append( (sal_Int64)*(sal_uInt32 *)pVal, 16 );
break; break;
case typelib_TypeClass_HYPER: case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER: case typelib_TypeClass_UNSIGNED_HYPER:
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); buf.append( "0x" );
#if defined(__GNUC__) && defined(SPARC) #if defined(__GNUC__) && defined(SPARC)
// I guess this really should check if there are strict alignment // I guess this really should check if there are strict alignment
// requirements, not just "GCC on SPARC". // requirements, not just "GCC on SPARC".
...@@ -414,7 +412,7 @@ void ComponentContext::insertByName( ...@@ -414,7 +412,7 @@ void ComponentContext::insertByName(
new ContextEntry( new ContextEntry(
element, element,
/* lateInit_: */ /* lateInit_: */
name.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("/singletons/") ) && name.startsWith( "/singletons/" ) &&
!element.hasValue() ) ); !element.hasValue() ) );
MutexGuard guard( m_mutex ); MutexGuard guard( m_mutex );
::std::pair<t_map::iterator, bool> insertion( m_map.insert( ::std::pair<t_map::iterator, bool> insertion( m_map.insert(
...@@ -454,7 +452,7 @@ void ComponentContext::replaceByName( ...@@ -454,7 +452,7 @@ void ComponentContext::replaceByName(
throw container::NoSuchElementException( throw container::NoSuchElementException(
"no such element: " + name, "no such element: " + name,
static_cast<OWeakObject *>(this) ); static_cast<OWeakObject *>(this) );
if (name.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("/singletons/") ) && if (name.startsWith( "/singletons/" ) &&
!element.hasValue()) !element.hasValue())
{ {
iFind->second->value.clear(); iFind->second->value.clear();
...@@ -606,10 +604,9 @@ Any ComponentContext::lookupMap( OUString const & rName ) ...@@ -606,10 +604,9 @@ Any ComponentContext::lookupMap( OUString const & rName )
{ {
Any caught( getCaughtException() ); Any caught( getCaughtException() );
OUStringBuffer buf; OUStringBuffer buf;
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( buf.append( "exception occurred raising singleton \"" );
"exception occurred raising singleton \"") );
buf.append( rName ); buf.append( rName );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\": ") ); buf.append( "\": " );
buf.append( exc.Message ); buf.append( exc.Message );
throw lang::WrappedTargetRuntimeException( throw lang::WrappedTargetRuntimeException(
buf.makeStringAndClear(), static_cast<OWeakObject *>(this),caught ); buf.makeStringAndClear(), static_cast<OWeakObject *>(this),caught );
...@@ -705,7 +702,7 @@ void ComponentContext::disposing() ...@@ -705,7 +702,7 @@ void ComponentContext::disposing()
// service manager disposed separately // service manager disposed separately
if (!m_xSMgr.is() || if (!m_xSMgr.is() ||
!iPos->first.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(SMGR_SINGLETON) )) !iPos->first.startsWith( SMGR_SINGLETON ))
{ {
if (pEntry->lateInit) if (pEntry->lateInit)
{ {
......
...@@ -51,15 +51,8 @@ static inline void checkInterface( Type const & rType ) ...@@ -51,15 +51,8 @@ static inline void checkInterface( Type const & rType )
{ {
if (TypeClass_INTERFACE != rType.getTypeClass()) if (TypeClass_INTERFACE != rType.getTypeClass())
{ {
OUStringBuffer buf( 64 ); OUString msg( "querying for interface \"" + rType.getTypeName() + "\": no interface type!" );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("querying for interface \"") ); SAL_WARN( "cppuhelper", msg );
buf.append( rType.getTypeName() );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\": no interface type!") );
OUString msg( buf.makeStringAndClear() );
#if OSL_DEBUG_LEVEL > 0
OString str( OUStringToOString( msg, RTL_TEXTENCODING_ASCII_US ) );
OSL_FAIL( str.getStr() );
#endif
throw RuntimeException( msg, Reference< XInterface >() ); throw RuntimeException( msg, Reference< XInterface >() );
} }
} }
...@@ -101,15 +94,8 @@ static inline type_entry * __getTypeEntries( class_data * cd ) ...@@ -101,15 +94,8 @@ static inline type_entry * __getTypeEntries( class_data * cd )
OSL_ENSURE( ! isXInterface( rType.getTypeLibType()->pTypeName ), "### want to implement XInterface: template argument is XInterface?!?!?!" ); OSL_ENSURE( ! isXInterface( rType.getTypeLibType()->pTypeName ), "### want to implement XInterface: template argument is XInterface?!?!?!" );
if (rType.getTypeClass() != TypeClass_INTERFACE) if (rType.getTypeClass() != TypeClass_INTERFACE)
{ {
OUStringBuffer buf( 48 ); OUString msg( "type \"" + rType.getTypeName() + "\" is no interface type!" );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("type \"") ); SAL_WARN( "cppuhelper", msg );
buf.append( rType.getTypeName() );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" is no interface type!") );
OUString msg( buf.makeStringAndClear() );
#if OSL_DEBUG_LEVEL > 0
OString str( OUStringToOString( msg, RTL_TEXTENCODING_ASCII_US ) );
OSL_FAIL( str.getStr() );
#endif
throw RuntimeException( msg, Reference< XInterface >() ); throw RuntimeException( msg, Reference< XInterface >() );
} }
// ref is statically held by getCppuType() // ref is statically held by getCppuType()
...@@ -214,15 +200,8 @@ static inline void * __queryDeepNoXInterface( ...@@ -214,15 +200,8 @@ static inline void * __queryDeepNoXInterface(
} }
else else
{ {
OUStringBuffer buf( 64 ); OUString msg( "cannot get type description for type \"" + OUString(pEntries[ n ].m_type.typeRef->pTypeName) + "\"!" );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("cannot get type description for type \"") ); SAL_WARN( "cppuhelper", msg );
buf.append( pEntries[ n ].m_type.typeRef->pTypeName );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") );
OUString msg( buf.makeStringAndClear() );
#if OSL_DEBUG_LEVEL > 0
OString str( OUStringToOString( msg, RTL_TEXTENCODING_ASCII_US ) );
OSL_FAIL( str.getStr() );
#endif
throw RuntimeException( msg, Reference< XInterface >() ); throw RuntimeException( msg, Reference< XInterface >() );
} }
} }
......
...@@ -18,14 +18,12 @@ ...@@ -18,14 +18,12 @@
*/ */
#include <cppuhelper/implementationentry.hxx> #include <cppuhelper/implementationentry.hxx>
#include <rtl/ustrbuf.hxx>
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang; using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::registry; using namespace ::com::sun::star::registry;
using rtl::OUString; using rtl::OUString;
using rtl::OUStringBuffer;
namespace cppu { namespace cppu {
...@@ -40,12 +38,9 @@ sal_Bool component_writeInfoHelper( ...@@ -40,12 +38,9 @@ sal_Bool component_writeInfoHelper(
{ {
for( sal_Int32 i = 0; entries[i].create ; i ++ ) for( sal_Int32 i = 0; entries[i].create ; i ++ )
{ {
OUStringBuffer buf( 124 ); OUString sKey = "/" + entries[i].getImplementationName() + "/UNO/SERVICES";
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("/") );
buf.append( entries[i].getImplementationName() );
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM( "/UNO/SERVICES" ) );
Reference< XRegistryKey > xNewKey( Reference< XRegistryKey > xNewKey(
reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( buf.makeStringAndClear() ) ); reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( sKey ) );
Sequence< OUString > seq = entries[i].getSupportedServiceNames(); Sequence< OUString > seq = entries[i].getSupportedServiceNames();
const OUString *pArray = seq.getConstArray(); const OUString *pArray = seq.getConstArray();
......
...@@ -34,7 +34,6 @@ using namespace com::sun::star::lang; ...@@ -34,7 +34,6 @@ using namespace com::sun::star::lang;
using namespace cppu; using namespace cppu;
using ::rtl::OUString; using ::rtl::OUString;
using ::rtl::OUStringToOString;
namespace cppu { namespace cppu {
...@@ -725,12 +724,7 @@ void OPropertySetHelper::fire ...@@ -725,12 +724,7 @@ void OPropertySetHelper::fire
} }
catch (RuntimeException & exc) catch (RuntimeException & exc)
{ {
OSL_TRACE( SAL_INFO("cppuhelper", "caught RuntimeException while firing listeners: " << exc.Message);
OUStringToOString(
OUString( RTL_CONSTASCII_USTRINGPARAM(
"caught RuntimeException while "
"firing listeners: ") ) +
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
if (! bIgnoreRuntimeExceptionsWhileFiring) if (! bIgnoreRuntimeExceptionsWhileFiring)
throw; throw;
} }
...@@ -782,12 +776,7 @@ void OPropertySetHelper::fire ...@@ -782,12 +776,7 @@ void OPropertySetHelper::fire
} }
catch (RuntimeException & exc) catch (RuntimeException & exc)
{ {
OSL_TRACE( SAL_INFO("cppuhelper", "caught RuntimeException while firing listeners: " << exc.Message);
OUStringToOString(
OUString( RTL_CONSTASCII_USTRINGPARAM(
"caught RuntimeException while "
"firing listeners: ") ) +
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
if (! bIgnoreRuntimeExceptionsWhileFiring) if (! bIgnoreRuntimeExceptionsWhileFiring)
throw; throw;
} }
...@@ -832,12 +821,7 @@ void OPropertySetHelper::fire ...@@ -832,12 +821,7 @@ void OPropertySetHelper::fire
} }
catch (RuntimeException & exc) catch (RuntimeException & exc)
{ {
OSL_TRACE( SAL_INFO("cppuhelper", "caught RuntimeException while firing listeners: " << exc.Message);
OUStringToOString(
OUString( RTL_CONSTASCII_USTRINGPARAM(
"caught RuntimeException while "
"firing listeners: ") ) +
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
if (! bIgnoreRuntimeExceptionsWhileFiring) if (! bIgnoreRuntimeExceptionsWhileFiring)
throw; throw;
} }
......
...@@ -209,7 +209,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP ...@@ -209,7 +209,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
inline UnoUrl::Impl * UnoUrl::Impl::create(rtl::OUString const & rUrl) inline UnoUrl::Impl * UnoUrl::Impl::create(rtl::OUString const & rUrl)
{ {
if (!rUrl.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("uno:"), 0)) if (!rUrl.startsWithIgnoreAsciiCase("uno:"))
throw rtl::MalformedUriException( throw rtl::MalformedUriException(
rtl::OUString("UNO URL does not start with \"uno:\"")); rtl::OUString("UNO URL does not start with \"uno:\""));
sal_Int32 i = RTL_CONSTASCII_LENGTH("uno:"); sal_Int32 i = RTL_CONSTASCII_LENGTH("uno:");
......
...@@ -75,14 +75,10 @@ static bool s_check_object_is_in(void * pObject) ...@@ -75,14 +75,10 @@ static bool s_check_object_is_in(void * pObject)
static void s_test__loadSharedLibComponentFactory(rtl::OUString const & clientPurpose, static void s_test__loadSharedLibComponentFactory(rtl::OUString const & clientPurpose,
rtl::OUString const & servicePurpose) rtl::OUString const & servicePurpose)
{ {
cppu::EnvGuard envGuard(uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)) cppu::EnvGuard envGuard(uno::Environment(UNO_LB_UNO + clientPurpose, NULL));
+ clientPurpose, NULL)); if (!clientPurpose.isEmpty() && !envGuard.is())
if (clientPurpose.getLength() && !envGuard.is())
{ {
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tcouldn't get purpose env: \"")); s_comment += "\t\tcouldn't get purpose env: \"" + clientPurpose + "\" - FAILURE\n";
s_comment += clientPurpose;
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" - FAILURE\n"));
return; return;
} }
...@@ -90,13 +86,13 @@ static void s_test__loadSharedLibComponentFactory(rtl::OUString const & clientPu ...@@ -90,13 +86,13 @@ static void s_test__loadSharedLibComponentFactory(rtl::OUString const & clientPu
uno::Reference<uno::XInterface> xItf( uno::Reference<uno::XInterface> xItf(
cppu::loadSharedLibComponentFactory( cppu::loadSharedLibComponentFactory(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SAL_DLLPREFIX "TestComponent.uno" SAL_DLLEXTENSION)), rtl::OUString(SAL_DLLPREFIX "TestComponent.uno" SAL_DLLEXTENSION),
#ifdef WIN32 #ifdef WIN32
rtl::OUString(""), "",
#else #else
rtl::OUString("file://../lib/"), "file://../lib/",
#endif #endif
rtl::OUString("impl.test.TestComponent") + servicePurpose, "impl.test.TestComponent" + servicePurpose,
uno::Reference<lang::XMultiServiceFactory>(), uno::Reference<lang::XMultiServiceFactory>(),
uno::Reference<registry::XRegistryKey>() uno::Reference<registry::XRegistryKey>()
) )
...@@ -110,48 +106,41 @@ static void s_test__loadSharedLibComponentFactory(rtl::OUString const & clientPu ...@@ -110,48 +106,41 @@ static void s_test__loadSharedLibComponentFactory(rtl::OUString const & clientPu
if (!clientPurpose.equals(servicePurpose) && !s_check_object_is_in(xItf.get())) if (!clientPurpose.equals(servicePurpose) && !s_check_object_is_in(xItf.get()))
{ {
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tcouldn't find object in current purpose \"")); s_comment += "\t\tcouldn't find object in current purpose \"" + clientPurpose + "\" - FAILURE\n";
s_comment += clientPurpose;
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" - FAILURE\n"));
} }
if (!cppu::EnvDcp::getPurpose(uno::Environment::getCurrent().getTypeName()).equals(clientPurpose)) if (!cppu::EnvDcp::getPurpose(uno::Environment::getCurrent().getTypeName()).equals(clientPurpose))
{ {
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tdid not enter client purpose \"")); s_comment += "\t\tdid not enter client purpose \"" + clientPurpose + "\" - FAILURE\n";
s_comment += clientPurpose;
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" - FAILURE\n"));
} }
} }
static void s_test__loadSharedLibComponentFactory__free_free() static void s_test__loadSharedLibComponentFactory__free_free()
{ {
s_comment += rtl::OUString("\ts_test__loadSharedLibComponentFactory__free_free\n"); s_comment += "\ts_test__loadSharedLibComponentFactory__free_free\n";
s_test__loadSharedLibComponentFactory(rtl::OUString(), rtl::OUString()); s_test__loadSharedLibComponentFactory("", "");
} }
static void s_test__loadSharedLibComponentFactory__free_purpose() static void s_test__loadSharedLibComponentFactory__free_purpose()
{ {
s_comment += rtl::OUString("\ts_test__loadSharedLibComponentFactory__free_purpose\n"); s_comment += "\ts_test__loadSharedLibComponentFactory__free_purpose\n";
s_test__loadSharedLibComponentFactory(rtl::OUString(), s_test__loadSharedLibComponentFactory("", ":testenv");
rtl::OUString(":testenv"));
} }
static void s_test__loadSharedLibComponentFactory__purpose_free() static void s_test__loadSharedLibComponentFactory__purpose_free()
{ {
s_comment += rtl::OUString("\ts_test__loadSharedLibComponentFactory__purpose_free\n"); s_comment += "\ts_test__loadSharedLibComponentFactory__purpose_free\n";
s_test__loadSharedLibComponentFactory(rtl::OUString(":testenv"), s_test__loadSharedLibComponentFactory(":testenv", "");
rtl::OUString());
} }
static void s_test__loadSharedLibComponentFactory__purpose_purpose() static void s_test__loadSharedLibComponentFactory__purpose_purpose()
{ {
s_comment += rtl::OUString("\ts_test__loadSharedLibComponentFactory__purpose_purpose\n"); s_comment += "\ts_test__loadSharedLibComponentFactory__purpose_purpose\n";
s_test__loadSharedLibComponentFactory(rtl::OUString(":testenv"), s_test__loadSharedLibComponentFactory(":testenv", ":testenv");
rtl::OUString(":testenv"));
} }
static rtl::OUString s_getSDrive(void) static rtl::OUString s_getSDrive(void)
...@@ -166,10 +155,9 @@ static rtl::OUString s_getSDrive(void) ...@@ -166,10 +155,9 @@ static rtl::OUString s_getSDrive(void)
path += rtl::OUString(tmp, rtl_str_getLength(tmp), RTL_TEXTENCODING_ASCII_US); path += rtl::OUString(tmp, rtl_str_getLength(tmp), RTL_TEXTENCODING_ASCII_US);
path += rtl::OUString(SAL_PATHDELIMITER); path += rtl::OUString(SAL_PATHDELIMITER);
#ifdef WIN32 #ifdef WIN32
path += rtl::OUString("bin"); path += "bin";
#else #else
path += rtl::OUString("lib"); path += "lib";
#endif #endif
tmp = getenv("UPDMINOREXT"); tmp = getenv("UPDMINOREXT");
...@@ -183,14 +171,11 @@ static rtl::OUString s_getSDrive(void) ...@@ -183,14 +171,11 @@ static rtl::OUString s_getSDrive(void)
static void s_test__createSimpleRegistry(rtl::OUString const & clientPurpose) static void s_test__createSimpleRegistry(rtl::OUString const & clientPurpose)
{ {
cppu::EnvGuard envGuard(uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)) cppu::EnvGuard envGuard(uno::Environment(rtl::OUString(UNO_LB_UNO)
+ clientPurpose, NULL)); + clientPurpose, NULL));
if (clientPurpose.getLength() && !envGuard.is()) if (!clientPurpose.isEmpty() && !envGuard.is())
{ {
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tcouldn't get purpose env: \"")); s_comment += "\t\tcouldn't get purpose env: \"" + clientPurpose + "\" - FAILURE\n";
s_comment += clientPurpose;
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" - FAILURE\n"));
return; return;
} }
...@@ -199,43 +184,38 @@ static void s_test__createSimpleRegistry(rtl::OUString const & clientPurpose) ...@@ -199,43 +184,38 @@ static void s_test__createSimpleRegistry(rtl::OUString const & clientPurpose)
if (!registry.is()) if (!registry.is())
{ {
s_comment += rtl::OUString("\t\tgot no object - FAILURE\n"); s_comment += "\t\tgot no object - FAILURE\n";
return; return;
} }
if (clientPurpose.getLength() != 0 && !s_check_object_is_in(registry.get())) if (!clientPurpose.isEmpty() && !s_check_object_is_in(registry.get()))
{ {
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tcouldn't find object in current purpose \"")); s_comment += "\t\tcouldn't find object in current purpose \"" + clientPurpose + "\" - FAILURE\n";
s_comment += clientPurpose;
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" - FAILURE\n"));
} }
} }
static void s_test__createSimpleRegistry__free(void) static void s_test__createSimpleRegistry__free(void)
{ {
s_comment += rtl::OUString("\ts_test__createSimpleRegistry__free\n"); s_comment += "\ts_test__createSimpleRegistry__free\n";
s_test__createSimpleRegistry(rtl::OUString()); s_test__createSimpleRegistry(rtl::OUString());
} }
static void s_test__createSimpleRegistry__purpose(void) static void s_test__createSimpleRegistry__purpose(void)
{ {
s_comment += rtl::OUString("\ts_test__createSimpleRegistry__purpose\n"); s_comment += "\ts_test__createSimpleRegistry__purpose\n";
s_test__createSimpleRegistry(rtl::OUString(":testenv")); s_test__createSimpleRegistry(":testenv");
} }
static void s_test__bootstrap_InitialComponentContext(rtl::OUString const & clientPurpose) static void s_test__bootstrap_InitialComponentContext(rtl::OUString const & clientPurpose)
{ {
cppu::EnvGuard envGuard(uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)) cppu::EnvGuard envGuard(uno::Environment(rtl::OUString(UNO_LB_UNO)
+ clientPurpose, NULL)); + clientPurpose, NULL));
if (clientPurpose.getLength() && !envGuard.is()) if (!clientPurpose.isEmpty() && !envGuard.is())
{ {
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tcouldn't get purpose env: \"")); s_comment += "\t\tcouldn't get purpose env: \"" + clientPurpose + "\" - FAILURE\n";
s_comment += clientPurpose;
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" - FAILURE\n"));
return; return;
} }
...@@ -247,15 +227,13 @@ static void s_test__bootstrap_InitialComponentContext(rtl::OUString const & clie ...@@ -247,15 +227,13 @@ static void s_test__bootstrap_InitialComponentContext(rtl::OUString const & clie
if (!xContext.is()) if (!xContext.is())
{ {
s_comment += rtl::OUString("\t\tgot no object - FAILURE\n"); s_comment += "\t\tgot no object - FAILURE\n";
return; return;
} }
if (clientPurpose.getLength() != 0 && !s_check_object_is_in(xContext.get())) if (!clientPurpose.isEmpty() && !s_check_object_is_in(xContext.get()))
{ {
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tcouldn't find object in current purpose \"")); s_comment += "\t\tcouldn't find object in current purpose \"" + clientPurpose + "\" - FAILURE\n";
s_comment += clientPurpose;
s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" - FAILURE\n"));
} }
uno::Reference<lang::XComponent> xComponent(xContext, uno::UNO_QUERY_THROW); uno::Reference<lang::XComponent> xComponent(xContext, uno::UNO_QUERY_THROW);
...@@ -264,16 +242,16 @@ static void s_test__bootstrap_InitialComponentContext(rtl::OUString const & clie ...@@ -264,16 +242,16 @@ static void s_test__bootstrap_InitialComponentContext(rtl::OUString const & clie
static void s_test__bootstrap_InitialComponentContext__free(void) static void s_test__bootstrap_InitialComponentContext__free(void)
{ {
s_comment += rtl::OUString("\ts_test__bootstrap_InitialComponentContext__free\n"); s_comment += "\ts_test__bootstrap_InitialComponentContext__free\n";
s_test__bootstrap_InitialComponentContext(rtl::OUString()); s_test__bootstrap_InitialComponentContext(rtl::OUString());
} }
static void s_test__bootstrap_InitialComponentContext__purpose(void) static void s_test__bootstrap_InitialComponentContext__purpose(void)
{ {
s_comment += rtl::OUString("\ts_test__bootstrap_InitialComponentContext__purpose\n"); s_comment += "\ts_test__bootstrap_InitialComponentContext__purpose\n";
s_test__bootstrap_InitialComponentContext(rtl::OUString(":testenv")); s_test__bootstrap_InitialComponentContext(":testenv");
} }
...@@ -293,12 +271,12 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) ...@@ -293,12 +271,12 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv)
int ret; int ret;
if (s_comment.indexOf("FAILURE") == -1) if (s_comment.indexOf("FAILURE") == -1)
{ {
s_comment += rtl::OUString("TESTS PASSED\n"); s_comment += "TESTS PASSED\n";
ret = 0; ret = 0;
} }
else else
{ {
s_comment += rtl::OUString("TESTS _NOT_ PASSED\n"); s_comment += "TESTS _NOT_ PASSED\n";
ret = -1; ret = -1;
} }
......
...@@ -83,14 +83,14 @@ static rtl::OUString s_test__cppu_loadSharedLibComponentFactory(char const * pSe ...@@ -83,14 +83,14 @@ static rtl::OUString s_test__cppu_loadSharedLibComponentFactory(char const * pSe
RTL_TEXTENCODING_ASCII_US); RTL_TEXTENCODING_ASCII_US);
result += rtl::OUString("\ts_test__cppu_loadSharedLibComponentFactory "); result += rtl::OUString("\ts_test__cppu_loadSharedLibComponentFactory ");
result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(\"")); result += rtl::OUString("(\"");
result += servicePurpose; result += servicePurpose;
result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\") - ")); result += rtl::OUString("\") - ");
try { try {
uno::Reference<uno::XInterface> xObject( uno::Reference<uno::XInterface> xObject(
cppu::loadSharedLibComponentFactory( cppu::loadSharedLibComponentFactory(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SAL_DLLPREFIX "TestComponent.uno" SAL_DLLEXTENSION)), rtl::OUString(SAL_DLLPREFIX "TestComponent.uno" SAL_DLLEXTENSION),
rtl::OUString(), rtl::OUString(),
rtl::OUString("impl.test.TestComponent") + servicePurpose, rtl::OUString("impl.test.TestComponent") + servicePurpose,
uno::Reference<lang::XMultiServiceFactory>(), uno::Reference<lang::XMultiServiceFactory>(),
...@@ -103,15 +103,15 @@ static rtl::OUString s_test__cppu_loadSharedLibComponentFactory(char const * pSe ...@@ -103,15 +103,15 @@ static rtl::OUString s_test__cppu_loadSharedLibComponentFactory(char const * pSe
else else
{ {
result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILED - got: \"")); result += rtl::OUString("FAILED - got: \"");
result += envDcp_purpose; result += envDcp_purpose;
result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); result += rtl::OUString("\"\n");
} }
} }
catch(uno::Exception & exception) { catch(uno::Exception & exception) {
result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILED - got: \"")); result += rtl::OUString("FAILED - got: \"");
result += exception.Message; result += exception.Message;
result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); result += rtl::OUString("\"\n");
} }
return result; return result;
...@@ -126,9 +126,9 @@ static rtl::OUString s_test__cppu_writeSharedLibComponentInfo(char const * pServ ...@@ -126,9 +126,9 @@ static rtl::OUString s_test__cppu_writeSharedLibComponentInfo(char const * pServ
RTL_TEXTENCODING_ASCII_US); RTL_TEXTENCODING_ASCII_US);
result += rtl::OUString("\ts_test__cppu_writeSharedLibComponentInfo "); result += rtl::OUString("\ts_test__cppu_writeSharedLibComponentInfo ");
result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(\"")); result += rtl::OUString("(\"");
result += servicePurpose; result += servicePurpose;
result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\") - ")); result += rtl::OUString("\") - ");
char buff[256]; char buff[256];
strcpy(buff, "TestComponent.uno="); strcpy(buff, "TestComponent.uno=");
...@@ -138,7 +138,7 @@ static rtl::OUString s_test__cppu_writeSharedLibComponentInfo(char const * pServ ...@@ -138,7 +138,7 @@ static rtl::OUString s_test__cppu_writeSharedLibComponentInfo(char const * pServ
try { try {
cppu::writeSharedLibComponentInfo( cppu::writeSharedLibComponentInfo(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SAL_DLLPREFIX "TestComponent.uno" SAL_DLLEXTENSION)), rtl::OUString(SAL_DLLPREFIX "TestComponent.uno" SAL_DLLEXTENSION),
rtl::OUString(), rtl::OUString(),
uno::Reference<lang::XMultiServiceFactory>(), uno::Reference<lang::XMultiServiceFactory>(),
uno::Reference<registry::XRegistryKey>(new MyKey) uno::Reference<registry::XRegistryKey>(new MyKey)
...@@ -150,15 +150,15 @@ static rtl::OUString s_test__cppu_writeSharedLibComponentInfo(char const * pServ ...@@ -150,15 +150,15 @@ static rtl::OUString s_test__cppu_writeSharedLibComponentInfo(char const * pServ
else else
{ {
result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILED - got: \"")); result += rtl::OUString("FAILED - got: \"");
result += envDcp_purpose; result += envDcp_purpose;
result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); result += rtl::OUString("\"\n");
} }
} }
catch(uno::Exception & exception) { catch(uno::Exception & exception) {
result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILED - got: \"")); result += rtl::OUString("FAILED - got: \"");
result += exception.Message; result += exception.Message;
result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); result += rtl::OUString("\"\n");
} }
return result; return result;
......
...@@ -42,7 +42,7 @@ static sal_Bool tryService(const char * serviceName) ...@@ -42,7 +42,7 @@ static sal_Bool tryService(const char * serviceName)
::osl::Module::getUrlFromAddress((void *)tryService, libraryFileUrl); ::osl::Module::getUrlFromAddress((void *)tryService, libraryFileUrl);
OUString iniName = libraryFileUrl.copy(0, libraryFileUrl.lastIndexOf((sal_Unicode)'.')); // cut the library extension OUString iniName = libraryFileUrl.copy(0, libraryFileUrl.lastIndexOf((sal_Unicode)'.')); // cut the library extension
iniName += OUString(RTL_CONSTASCII_USTRINGPARAM(SAL_CONFIGFILE(""))); // add the rc file extension iniName += OUString(SAL_CONFIGFILE("")); // add the rc file extension
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 1
OString sIniName = OUStringToOString(iniName, RTL_TEXTENCODING_ASCII_US); OString sIniName = OUStringToOString(iniName, RTL_TEXTENCODING_ASCII_US);
......
...@@ -105,11 +105,9 @@ static sal_Bool readOption( OUString * pValue, const sal_Char * pOpt, ...@@ -105,11 +105,9 @@ static sal_Bool readOption( OUString * pValue, const sal_Char * pOpt,
rtl_getAppCommandArg(*pnIndex, &pValue->pData); rtl_getAppCommandArg(*pnIndex, &pValue->pData);
if (*pnIndex >= rtl_getAppCommandArgCount() || pValue->copy(1).equals(dash)) if (*pnIndex >= rtl_getAppCommandArgCount() || pValue->copy(1).equals(dash))
{ {
OUStringBuffer buf( 32 ); throw RuntimeException(
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("incomplete option \"-") ); "incomplete option \"-" + aOpt + "\" given!",
buf.appendAscii( pOpt ); Reference< XInterface >() );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" given!") );
throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() );
} }
else else
{ {
...@@ -172,24 +170,20 @@ void createInstance( ...@@ -172,24 +170,20 @@ void createInstance(
if (! x.is()) if (! x.is())
{ {
OUStringBuffer buf( 64 ); throw RuntimeException(
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("cannot get service instance \"") ); "cannot get service instance \"" + rServiceName + "\"!",
buf.append( rServiceName ); Reference< XInterface >() );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") );
throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() );
} }
rxOut = Reference< T >::query( x ); rxOut = Reference< T >::query( x );
if (! rxOut.is()) 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 ); const Type & rType = ::getCppuType( (const Reference< T > *)0 );
buf.append( rType.getTypeName() ); throw RuntimeException(
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") ); "service instance \"" + rServiceName +
throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() ); "\" does not support demanded interface \"" +
rType.getTypeName() + "\"!",
Reference< XInterface >() );
} }
} }
...@@ -222,11 +216,9 @@ static Reference< XInterface > loadComponent( ...@@ -222,11 +216,9 @@ static Reference< XInterface > loadComponent(
} }
else else
{ {
OUStringBuffer buf( 64 ); throw RuntimeException(
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("unknown extension of \"") ); "unknown extension of \"" + rLocation + "\"! No loader available!",
buf.append( rLocation ); Reference< XInterface >() );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"! No loader available!") );
throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() );
} }
Reference< XInterface > xInstance; Reference< XInterface > xInstance;
...@@ -256,24 +248,18 @@ static Reference< XInterface > loadComponent( ...@@ -256,24 +248,18 @@ static Reference< XInterface > loadComponent(
if (! xInstance.is()) if (! xInstance.is())
{ {
OUStringBuffer buf( 64 ); throw RuntimeException(
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("activating component \"") ); "activating component \"" + rImplName + "\" from location \"" + rLocation + "\" failed!",
buf.append( rImplName ); Reference< XInterface >() );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" from location \"") );
buf.append( rLocation );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" failed!") );
throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() );
} }
return xInstance; return xInstance;
} }
else else
{ {
OUStringBuffer buf( 64 ); throw RuntimeException(
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("location \"") ); "location \"" + rLocation + "\" has no extension! Cannot determine loader to be used!",
buf.append( rLocation ); Reference< XInterface >() );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" has no extension! Cannot determine loader to be used!") );
throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() );
} }
} }
...@@ -370,11 +356,9 @@ Reference< XInterface > OInstanceProvider::getInstance( const OUString & rName ) ...@@ -370,11 +356,9 @@ Reference< XInterface > OInstanceProvider::getInstance( const OUString & rName )
out( "\n> error: " ); out( "\n> error: " );
out( rExc.Message ); out( rExc.Message );
} }
OUStringBuffer buf( 64 ); throw NoSuchElementException(
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("no such element \"") ); "no such element \"" + rName + "\"!",
buf.append( rName ); Reference< XInterface >() );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") );
throw NoSuchElementException( buf.makeStringAndClear(), Reference< XInterface >() );
} }
struct ODisposingListener : public WeakImplHelper1< XEventListener > struct ODisposingListener : public WeakImplHelper1< XEventListener >
...@@ -462,8 +446,7 @@ SAL_IMPLEMENT_MAIN() ...@@ -462,8 +446,7 @@ SAL_IMPLEMENT_MAIN()
throw RuntimeException("give component exOR service name!", Reference< XInterface >() ); throw RuntimeException("give component exOR service name!", Reference< XInterface >() );
if (aImplName.isEmpty() && aServiceName.isEmpty()) if (aImplName.isEmpty() && aServiceName.isEmpty())
{ {
if (! aUnoUrl.endsWithIgnoreAsciiCaseAsciiL( if (! aUnoUrl.endsWithIgnoreAsciiCase( ";uno.ComponentContext" ))
RTL_CONSTASCII_STRINGPARAM(";uno.ComponentContext") ))
throw RuntimeException( throw RuntimeException(
OUString("expected UNO-URL with instance name uno.ComponentContext!" ), OUString("expected UNO-URL with instance name uno.ComponentContext!" ),
Reference<XInterface>() ); Reference<XInterface>() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment