[Libreoffice-commits] core.git: pyuno/source

Muhammet Kara muhammet.kara at pardus.org.tr
Mon Sep 25 12:05:36 UTC 2017


 pyuno/source/module/pyuno_adapter.cxx |   28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 7810858ee6cac233ce5868de1f2ef5de1d443af4
Author: Muhammet Kara <muhammet.kara at pardus.org.tr>
Date:   Sun Sep 24 21:14:44 2017 +0000

    tdf#57950: Replace chained OUStringBuffer::append() with operator+
    
    Change-Id: Ibf9d3b24b0caa6b84f403d7bbbc90912fe64a559
    Reviewed-on: https://gerrit.libreoffice.org/42728
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx
index 52f7577c550b..ebb6204bb7ea 100644
--- a/pyuno/source/module/pyuno_adapter.cxx
+++ b/pyuno/source/module/pyuno_adapter.cxx
@@ -238,12 +238,13 @@ Any Adapter::invoke( const OUString &aFunctionName,
         raiseInvocationTargetExceptionWhenNeeded( runtime);
         if( !method.is() )
         {
-            OUStringBuffer buf;
-            buf.append( "pyuno::Adapter: Method " ).append( aFunctionName );
-            buf.append( " is not implemented at object " );
             PyRef str( PyObject_Repr( mWrappedObject.get() ), SAL_NO_ACQUIRE );
-            buf.append(pyString2ustring(str.get()));
-            throw IllegalArgumentException( buf.makeStringAndClear(), Reference< XInterface > (),0 );
+
+            OUString sMsg = "pyuno::Adapter: Method "
+                          + aFunctionName
+                          + " is not implemented at object "
+                          + pyString2ustring(str.get());
+            throw IllegalArgumentException( sMsg, Reference< XInterface > (),0 );
         }
 
         PyRef pyRet( PyObject_CallObject( method.get(), argsTuple.get() ), SAL_NO_ACQUIRE );
@@ -276,15 +277,14 @@ Any Adapter::invoke( const OUString &aFunctionName,
 
                     if( aOutParamIndex.getLength() +1 != seq.getLength() )
                     {
-                        OUStringBuffer buf;
-                        buf.append( "pyuno bridge: expected for method " );
-                        buf.append( aFunctionName );
-                        buf.append( " one return value and " );
-                        buf.append( aOutParamIndex.getLength() );
-                        buf.append( " out parameters, got a sequence of " );
-                        buf.append( seq.getLength() );
-                        buf.append( " elements as return value." );
-                        throw RuntimeException(buf.makeStringAndClear(), *this );
+                        OUString sMsg = "pyuno bridge: expected for method "
+                                      + aFunctionName
+                                      + " one return value and "
+                                      + OUString::number(aOutParamIndex.getLength())
+                                      + " out parameters, got a sequence of "
+                                      + OUString::number(seq.getLength())
+                                      + " elements as return value.";
+                        throw RuntimeException( sMsg, *this );
                     }
 
                     aOutParam.realloc( aOutParamIndex.getLength() );


More information about the Libreoffice-commits mailing list