diff options
Diffstat (limited to 'cppu/source/uno/lbenv.cxx')
-rw-r--r-- | cppu/source/uno/lbenv.cxx | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx index f19d8e725e4f..472feae34b4e 100644 --- a/cppu/source/uno/lbenv.cxx +++ b/cppu/source/uno/lbenv.cxx @@ -42,6 +42,7 @@ #include <string_view> #include <unordered_map> +#include <utility> #include <vector> #include <stdio.h> @@ -78,7 +79,7 @@ struct ObjectEntry sal_Int32 nRef; bool mixedObject; - explicit ObjectEntry( const OUString & rOId_ ); + explicit ObjectEntry( OUString aOId_ ); void append( uno_DefaultEnvironment * pEnv, @@ -147,8 +148,8 @@ struct uno_DefaultEnvironment : public uno_ExtEnvironment }; -ObjectEntry::ObjectEntry( OUString const & rOId_ ) - : oid( rOId_ ), +ObjectEntry::ObjectEntry( OUString aOId_ ) + : oid(std::move( aOId_ )), nRef( 0 ), mixedObject( false ) { @@ -345,7 +346,7 @@ static void s_stub_defenv_revokeInterface(va_list * pParam) Ptr2ObjectMap::const_iterator const iFind( that->aPtr2ObjectMap.find( pInterface ) ); - OSL_ASSERT( iFind != that->aPtr2ObjectMap.end() ); + assert(iFind != that->aPtr2ObjectMap.end()); ObjectEntry * pOEntry = iFind->second; if (! --pOEntry->nRef) { @@ -696,18 +697,18 @@ extern "C" void SAL_CALL uno_dumpEnvironment( { writeLine( stream, "###################################" "###########################################", pFilter ); - buf.append( "environment: " ); - buf.append( pEnv->pTypeName ); - writeLine( stream, buf.makeStringAndClear(), pFilter ); + buf.append( OUString::Concat("environment: ") + OUString::unacquired(&pEnv->pTypeName) ); + writeLine( stream, buf, pFilter ); + buf.setLength(0); writeLine( stream, "NO INTERFACE INFORMATION AVAILABLE!", pFilter ); return; } writeLine( stream, "########################################" "######################################", pFilter ); - buf.append( "environment dump: " ); - buf.append( pEnv->pTypeName ); - writeLine( stream, buf.makeStringAndClear(), pFilter ); + buf.append( OUString::Concat("environment dump: ") + OUString::unacquired(&pEnv->pTypeName) ); + writeLine( stream, buf, pFilter ); + buf.setLength(0); uno_DefaultEnvironment * that = reinterpret_cast< uno_DefaultEnvironment * >(pEnv); @@ -721,33 +722,32 @@ extern "C" void SAL_CALL uno_dumpEnvironment( buf.append( "+ " ); if (pOEntry->mixedObject) buf.append( "mixed " ); - buf.append( "object entry: nRef=" ); - buf.append( pOEntry->nRef ); - buf.append( "; oid=\"" ); - buf.append( pOEntry->oid ); - buf.append( '\"' ); - writeLine( stream, buf.makeStringAndClear(), pFilter ); + buf.append( "object entry: nRef=" + + OUString::number(pOEntry->nRef) + + "; oid=\"" + + pOEntry->oid + + "\"" ); + writeLine( stream, buf, pFilter ); + buf.setLength(0); for ( std::size_t nPos = 0; nPos < pOEntry->aInterfaces.size(); ++nPos ) { const InterfaceEntry & rIEntry = pOEntry->aInterfaces[nPos]; - buf.append( " - " ); - buf.append( rIEntry.pTypeDescr->aBase.pTypeName ); + buf.append( OUString::Concat(" - ") + + OUString::unacquired(&rIEntry.pTypeDescr->aBase.pTypeName) ); if (rIEntry.fpFreeProxy) { - buf.append( "; proxy free=0x" ); - buf.append( - reinterpret_cast< sal_IntPtr >(rIEntry.fpFreeProxy), 16 ); + buf.append( "; proxy free=0x" + + OUString::number( reinterpret_cast< sal_IntPtr >(rIEntry.fpFreeProxy), 16 ) ); } else { buf.append( "; original" ); } - buf.append( "; ptr=0x" ); - buf.append( - reinterpret_cast< sal_IntPtr >(rIEntry.pInterface), 16 ); + buf.append( "; ptr=0x" + + OUString::number(reinterpret_cast< sal_IntPtr >(rIEntry.pInterface), 16 ) ); if (pOEntry->find( rIEntry.pInterface, nPos + 1 ) < 0) { @@ -757,7 +757,8 @@ extern "C" void SAL_CALL uno_dumpEnvironment( buf.append( " (ptr not found in map!)" ); } } - writeLine( stream, buf.makeStringAndClear(), pFilter ); + writeLine( stream, buf, pFilter ); + buf.setLength(0); } } if (! ptr2obj.empty()) @@ -782,7 +783,7 @@ extern "C" void SAL_CALL uno_dumpEnvironmentByName( { writeLine( stream, - OUStringConcatenation("environment \"" + OUString::unacquired(&pEnvDcp) + "\" does not exist!"), + Concat2View("environment \"" + OUString::unacquired(&pEnvDcp) + "\" does not exist!"), pFilter ); } } @@ -845,10 +846,10 @@ static void unoenv_computeObjectIdentifier( (*pUnoI->release)( pUnoI ); OUString aStr( // interface - OUString::number( reinterpret_cast< sal_Int64 >(pUnoI), 16 ) + ";" + OUString::number( reinterpret_cast< sal_IntPtr >(pUnoI), 16 ) + ";" // environment[context] + OUString::unacquired(&pEnv->aBase.pTypeName) + "[" - + OUString::number( reinterpret_cast< sal_Int64 >( + + OUString::number( reinterpret_cast< sal_IntPtr >( reinterpret_cast< uno_Environment * >(pEnv)->pContext ), 16 ) // process;good guid |