From 657f067b917169f41a8432c8f329877f6e50c3f6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 20 Feb 2017 13:55:39 +0200 Subject: remove some unnecessary OUStringBuffer usage Change-Id: Iae9146a3be569107019d9c5af404b94e51e76cd5 Reviewed-on: https://gerrit.libreoffice.org/34469 Tested-by: Jenkins Reviewed-by: Noel Grandin --- pyuno/source/module/pyuno_runtime.cxx | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'pyuno/source/module/pyuno_runtime.cxx') diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index 755a6dc46a75..69e5a1732605 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -464,11 +464,8 @@ PyRef Runtime::any2PyObject (const Any &a ) const } } } - OUStringBuffer buf; - buf.append( "Any carries enum " ); - buf.append( a.getValueType().getTypeName()); - buf.append( " with invalid value " ).append( l ); - throw RuntimeException( buf.makeStringAndClear() ); + throw RuntimeException( "Any carries enum " + a.getValueType().getTypeName() + + " with invalid value " + OUString::number(l) ); } case typelib_TypeClass_EXCEPTION: case typelib_TypeClass_STRUCT: @@ -480,10 +477,8 @@ PyRef Runtime::any2PyObject (const Any &a ) const PyRef ret( PyObject_CallObject( excClass.get() , argsTuple.get() ), SAL_NO_ACQUIRE ); if( ! ret.is() ) { - OUStringBuffer buf; - buf.append( "Couldn't instantiate python representation of structured UNO type " ); - buf.append( a.getValueType().getTypeName() ); - throw RuntimeException( buf.makeStringAndClear() ); + throw RuntimeException( "Couldn't instantiate python representation of structured UNO type " + + a.getValueType().getTypeName() ); } if( auto e = o3tl::tryAccess(a) ) @@ -550,10 +545,7 @@ PyRef Runtime::any2PyObject (const Any &a ) const } default: { - OUStringBuffer buf; - buf.append( "Unknown UNO type class " ); - buf.append( (sal_Int32 ) a.getValueTypeClass() ); - throw RuntimeException(buf.makeStringAndClear( ) ); + throw RuntimeException( "Unknown UNO type class " + OUString::number(a.getValueTypeClass()) ); } } } -- cgit