compilerplugins/clang/stringadd.cxx   |    3 ---
 pyuno/source/module/pyuno_runtime.cxx |   15 +++++----------
 2 files changed, 5 insertions(+), 13 deletions(-)

New commits:
commit 641e8b1875b14a9e59eb326ce06642bb520139ab
Author:     Mike Kaganski <[email protected]>
AuthorDate: Sun Sep 28 17:35:18 2025 +0500
Commit:     Mike Kaganski <[email protected]>
CommitDate: Sun Sep 28 19:03:11 2025 +0200

    Drop loplugin:stringadd exclusion for pyuno_runtime.cxx
    
    Change-Id: I362f4322fd0948b83272234e4fe52a957aea5f9e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191578
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>

diff --git a/compilerplugins/clang/stringadd.cxx 
b/compilerplugins/clang/stringadd.cxx
index 7348fc66a74f..72ed12a40ef7 100644
--- a/compilerplugins/clang/stringadd.cxx
+++ b/compilerplugins/clang/stringadd.cxx
@@ -56,9 +56,6 @@ public:
             return false;
         if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/qa/OStringBuffer/"))
             return false;
-        // there is an ifdef here, but my check is not working, not sure why
-        if (fn == SRCDIR "/pyuno/source/module/pyuno_runtime.cxx")
-            return false;
         // TODO this file has a boatload of buffer appends' and I don't feel 
like fixing them all now
         if (fn == SRCDIR "/vcl/source/gdi/pdfwriter_impl.cxx")
             return false;
diff --git a/pyuno/source/module/pyuno_runtime.cxx 
b/pyuno/source/module/pyuno_runtime.cxx
index c3fd51940e53..103398b9a042 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -191,8 +191,7 @@ static PyRef importUnoModule( )
         // Who knows, a future Python might print something better.
         PyRef str( PyObject_Str( excTraceback.get() ), SAL_NO_ACQUIRE );
 
-        OUStringBuffer buf;
-        buf.append( "python object raised an unknown exception (" );
+        OUStringBuffer buf("python object raised an unknown exception (");
         PyRef valueRep( PyObject_Repr( excValue.get() ), SAL_NO_ACQUIRE );
         buf.appendAscii( PyUnicode_AsUTF8( valueRep.get())).append( ", 
traceback follows
" );
         buf.appendAscii( PyUnicode_AsUTF8( str.get() ) );
@@ -254,8 +253,7 @@ static void readLoggingConfig( sal_Int32 *pLevel, FILE 
**ppFile )
         if (osl_getProcessInfo(
             nullptr , osl_Process_IDENTIFIER , &data ) == osl_Process_E_None)
         {
-            o += ".";
-            o += OString::number(data.Ident);
+            o += "." + OString::number(data.Ident);
         }
 
         *ppFile = fopen( o.getStr() , "w" );
@@ -606,15 +604,13 @@ static Sequence< Type > invokeGetTypes( const Runtime & r 
, PyObject * o )
 static OUString
 lcl_ExceptionMessage(PyObject *const o, OUString const*const pWrapped)
 {
-    OUStringBuffer buf;
-    buf.append("Couldn't convert ");
+    OUStringBuffer buf("Couldn't convert ");
     PyRef reprString( PyObject_Str(o), SAL_NO_ACQUIRE );
     buf.appendAscii( PyUnicode_AsUTF8(reprString.get()) );
     buf.append(" to a UNO type");
     if (pWrapped)
     {
-        buf.append("; caught exception: ");
-        buf.append(*pWrapped);
+        buf.append("; caught exception: " + *pWrapped);
     }
     return buf.makeStringAndClear();
 }
@@ -943,8 +939,7 @@ Any Runtime::extractUnoException( const PyRef & excType, 
const PyRef &excValue,
         buf.append( ", traceback follows
" );
         if( !str.isEmpty() )
         {
-            buf.append( str );
-            buf.append( "
" );
+            buf.append(str + "
");
         }
         else
         {

Reply via email to