diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-29 16:21:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-04 15:18:00 +0200 |
commit | 2c05d758b2b62c9df413e2514fb3cd233d0f3ec7 (patch) | |
tree | e0a23d3da6fb17ae97d18957fc14f4a4a8de2d3f /comphelper/source/property | |
parent | a3088b1e72ef17babe3d3664c610afd02cfe0891 (diff) |
add << operator for css::uno::Exception
Change-Id: Ia23dafd07133779144965682df3b7125a3214235
Reviewed-on: https://gerrit.libreoffice.org/43046
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'comphelper/source/property')
-rw-r--r-- | comphelper/source/property/property.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/comphelper/source/property/property.cxx b/comphelper/source/property/property.cxx index 5e3fd29dc01b..f5e369808d2a 100644 --- a/comphelper/source/property/property.cxx +++ b/comphelper/source/property/property.cxx @@ -32,7 +32,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/uno/genfunc.h> - +#include <rtl/ustrbuf.hxx> #include <algorithm> @@ -90,15 +90,15 @@ void copyProperties(const Reference<XPropertySet>& _rxSource, catch (Exception&) { #if OSL_DEBUG_LEVEL > 0 - OStringBuffer aBuffer; + OUStringBuffer aBuffer; aBuffer.append( "::comphelper::copyProperties: could not copy property '" ); - aBuffer.append( OString( pSourceProps->Name.getStr(), pSourceProps->Name.getLength(), RTL_TEXTENCODING_ASCII_US ) ); + aBuffer.append( pSourceProps->Name ); aBuffer.append( "' to the destination set (a '" ); Reference< XServiceInfo > xSI( _rxDest, UNO_QUERY ); if ( xSI.is() ) { - aBuffer.append( OUStringToOString( xSI->getImplementationName(), osl_getThreadTextEncoding() ) ); + aBuffer.append( xSI->getImplementationName() ); } else { @@ -108,20 +108,19 @@ void copyProperties(const Reference<XPropertySet>& _rxSource, Any aException( ::cppu::getCaughtException() ); aBuffer.append( "Caught an exception of type '" ); - OUString sExceptionType( aException.getValueTypeName() ); - aBuffer.append( OString( sExceptionType.getStr(), sExceptionType.getLength(), RTL_TEXTENCODING_ASCII_US ) ); + aBuffer.append( aException.getValueTypeName() ); aBuffer.append( "'" ); Exception aBaseException; if ( ( aException >>= aBaseException ) && !aBaseException.Message.isEmpty() ) { aBuffer.append( ", saying '" ); - aBuffer.append( OString( aBaseException.Message.getStr(), aBaseException.Message.getLength(), osl_getThreadTextEncoding() ) ); + aBuffer.append( aBaseException.Message ); aBuffer.append( "'" ); } aBuffer.append( "." ); - OSL_FAIL( aBuffer.getStr() ); + SAL_WARN( "comphelper", aBuffer.makeStringAndClear() ); #endif } } |