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 /cppuhelper/source/component_context.cxx | |
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 'cppuhelper/source/component_context.cxx')
-rw-r--r-- | cppuhelper/source/component_context.cxx | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx index f75891238832..ab2ebf91ae71 100644 --- a/cppuhelper/source/component_context.cxx +++ b/cppuhelper/source/component_context.cxx @@ -80,20 +80,18 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p return "void"; OUStringBuffer buf( 64 ); - buf.append( (sal_Unicode)'(' ); - buf.append( pTypeRef->pTypeName ); - buf.append( (sal_Unicode)')' ); + buf.append( "(" + pTypeRef->pTypeName + ")" ); switch (pTypeRef->eTypeClass) { case typelib_TypeClass_INTERFACE: - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); + buf.append( "0x" ); buf.append( (sal_Int64)*(void **)pVal, 16 ); break; case typelib_TypeClass_STRUCT: case typelib_TypeClass_EXCEPTION: { - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("{ ") ); + buf.append( "{ " ); typelib_TypeDescription * pTypeDescr = 0; ::typelib_typedescriptionreference_getDescription( &pTypeDescr, pTypeRef ); OSL_ASSERT( pTypeDescr ); @@ -107,7 +105,7 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p { buf.append( val2str( pVal, ((typelib_TypeDescription *)pCompType->pBaseTypeDescription)->pWeakRef ) ); if (nDescr) - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(", ") ); + buf.append( ", " ); } typelib_TypeDescriptionReference ** ppTypeRefs = pCompType->ppTypeRefs; @@ -117,18 +115,18 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p for ( sal_Int32 nPos = 0; nPos < nDescr; ++nPos ) { buf.append( ppMemberNames[ nPos ] ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(" = ") ); + buf.append( " = " ); typelib_TypeDescription * pMemberType = 0; TYPELIB_DANGER_GET( &pMemberType, ppTypeRefs[ nPos ] ); buf.append( val2str( (char *)pVal + pMemberOffsets[ nPos ], pMemberType->pWeakRef ) ); TYPELIB_DANGER_RELEASE( pMemberType ); if (nPos < (nDescr -1)) - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(", ") ); + buf.append( ", " ); } ::typelib_typedescription_release( pTypeDescr ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(" }") ); + buf.append( " }" ); break; } case typelib_TypeClass_SEQUENCE: @@ -145,29 +143,29 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p if (nElements) { - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("{ ") ); + buf.append( "{ " ); char * pElements = pSequence->elements; for ( sal_Int32 nPos = 0; nPos < nElements; ++nPos ) { buf.append( val2str( pElements + (nElementSize * nPos), pElementTypeDescr->pWeakRef ) ); if (nPos < (nElements -1)) - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(", ") ); + buf.append( ", " ); } - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(" }") ); + buf.append( " }" ); } else { - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("{}") ); + buf.append( "{}" ); } TYPELIB_DANGER_RELEASE( pElementTypeDescr ); TYPELIB_DANGER_RELEASE( pTypeDescr ); break; } case typelib_TypeClass_ANY: - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("{ ") ); + buf.append( "{ " ); buf.append( val2str( ((uno_Any *)pVal)->pData, ((uno_Any *)pVal)->pType ) ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(" }") ); + buf.append( " }" ); break; case typelib_TypeClass_TYPE: buf.append( (*(typelib_TypeDescriptionReference **)pVal)->pTypeName ); @@ -202,9 +200,9 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p } case typelib_TypeClass_BOOLEAN: if (*(sal_Bool *)pVal) - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("true") ); + buf.append( "true" ); else - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("false") ); + buf.append( "false" ); break; case typelib_TypeClass_CHAR: buf.append( (sal_Unicode)'\'' ); @@ -218,28 +216,28 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p buf.append( *(double *)pVal ); break; case typelib_TypeClass_BYTE: - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); + buf.append( "0x" ); buf.append( (sal_Int32)*(sal_Int8 *)pVal, 16 ); break; case typelib_TypeClass_SHORT: - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); + buf.append( "0x" ); buf.append( (sal_Int32)*(sal_Int16 *)pVal, 16 ); break; case typelib_TypeClass_UNSIGNED_SHORT: - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); + buf.append( "0x" ); buf.append( (sal_Int32)*(sal_uInt16 *)pVal, 16 ); break; case typelib_TypeClass_LONG: - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); + buf.append( "0x" ); buf.append( *(sal_Int32 *)pVal, 16 ); break; case typelib_TypeClass_UNSIGNED_LONG: - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); + buf.append( "0x" ); buf.append( (sal_Int64)*(sal_uInt32 *)pVal, 16 ); break; case typelib_TypeClass_HYPER: case typelib_TypeClass_UNSIGNED_HYPER: - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") ); + buf.append( "0x" ); #if defined(__GNUC__) && defined(SPARC) // I guess this really should check if there are strict alignment // requirements, not just "GCC on SPARC". @@ -414,7 +412,7 @@ void ComponentContext::insertByName( new ContextEntry( element, /* lateInit_: */ - name.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("/singletons/") ) && + name.startsWith( "/singletons/" ) && !element.hasValue() ) ); MutexGuard guard( m_mutex ); ::std::pair<t_map::iterator, bool> insertion( m_map.insert( @@ -454,7 +452,7 @@ void ComponentContext::replaceByName( throw container::NoSuchElementException( "no such element: " + name, static_cast<OWeakObject *>(this) ); - if (name.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("/singletons/") ) && + if (name.startsWith( "/singletons/" ) && !element.hasValue()) { iFind->second->value.clear(); @@ -606,10 +604,9 @@ Any ComponentContext::lookupMap( OUString const & rName ) { Any caught( getCaughtException() ); OUStringBuffer buf; - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( - "exception occurred raising singleton \"") ); + buf.append( "exception occurred raising singleton \"" ); buf.append( rName ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\": ") ); + buf.append( "\": " ); buf.append( exc.Message ); throw lang::WrappedTargetRuntimeException( buf.makeStringAndClear(), static_cast<OWeakObject *>(this),caught ); @@ -705,7 +702,7 @@ void ComponentContext::disposing() // service manager disposed separately if (!m_xSMgr.is() || - !iPos->first.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(SMGR_SINGLETON) )) + !iPos->first.startsWith( SMGR_SINGLETON )) { if (pEntry->lateInit) { |