summaryrefslogtreecommitdiff
path: root/basic/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-24 09:29:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-24 09:50:49 +0000
commitc76fb95d45f0240ee00f831a88e8a52bf3faacbc (patch)
tree482c9442f5f5b1576626e6eb76ff42ae59350816 /basic/source
parent3c3a47e911a7ee4d199fe96bd3003c7d9afa9deb (diff)
loplugin:stringadd in b*
after my patch to merge the bufferadd loplugin into stringadd Change-Id: Ieb9b4f5154173738e26b429b55c7a3ea38733553 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149478 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic/source')
-rw-r--r--basic/source/basmgr/basmgr.cxx6
-rw-r--r--basic/source/classes/sbunoobj.cxx51
-rw-r--r--basic/source/sbx/sbxscan.cxx3
3 files changed, 22 insertions, 38 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 72776dd08153..c00221f27a12 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -1540,9 +1540,9 @@ ErrCode BasicManager::ExecuteMacro( OUString const& i_fullyQualifiedName, std::u
sal_Int32 nPos {0};
for (;;)
{
- aBuff.append( "\"" );
- aBuff.append( o3tl::getToken(sArgs2, 0, ',', nPos) );
- aBuff.append( "\"" );
+ aBuff.append( OUString::Concat("\"")
+ + o3tl::getToken(sArgs2, 0, ',', nPos)
+ + "\"" );
if (nPos<0)
break;
aBuff.append( "," );
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 71ef915e942a..36feb923a6de 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -1605,9 +1605,7 @@ static OUString getDbgObjectName(SbUnoObject& rUnoObj)
{
aRet.append( "\n" );
}
- aRet.append( "\"" );
- aRet.append( aName );
- aRet.append( "\":" );
+ aRet.append( "\"" + aName + "\":" );
return aRet.makeStringAndClear();
}
@@ -1739,16 +1737,16 @@ static OUString Impl_GetSupportedInterfaces(SbUnoObject& rUnoObj)
auto x = o3tl::tryAccess<Reference<XInterface>>(aToInspectObj);
if( !x )
{
- aRet.append( ID_DBG_SUPPORTEDINTERFACES );
- aRet.append( " not available.\n(TypeClass is not TypeClass_INTERFACE)\n" );
+ aRet.append( ID_DBG_SUPPORTEDINTERFACES
+ + " not available.\n(TypeClass is not TypeClass_INTERFACE)\n" );
}
else
{
Reference< XTypeProvider > xTypeProvider( *x, UNO_QUERY );
- aRet.append( "Supported interfaces by object " );
- aRet.append(getDbgObjectName(rUnoObj));
- aRet.append( "\n" );
+ aRet.append( "Supported interfaces by object "
+ + getDbgObjectName(rUnoObj)
+ + "\n" );
if( xTypeProvider.is() )
{
// get the interfaces of the implementation
@@ -1769,9 +1767,9 @@ static OUString Impl_GetSupportedInterfaces(SbUnoObject& rUnoObj)
typelib_TypeDescription * pTD = nullptr;
rType.getDescription( &pTD );
- aRet.append( "*** ERROR: No IdlClass for type \"" );
- aRet.append( pTD->pTypeName );
- aRet.append( "\"\n*** Please check type library\n" );
+ aRet.append( OUString::Concat("*** ERROR: No IdlClass for type \"")
+ + OUString::unacquired(&pTD->pTypeName)
+ + "\"\n*** Please check type library\n" );
}
}
}
@@ -1827,9 +1825,7 @@ static OUString Dbg_SbxDataType2String( SbxDataType eType )
// Debugging help method to display the properties of a SbUnoObjects
static OUString Impl_DumpProperties(SbUnoObject& rUnoObj)
{
- OUStringBuffer aRet;
- aRet.append("Properties of object ");
- aRet.append(getDbgObjectName(rUnoObj));
+ OUStringBuffer aRet("Properties of object " + getDbgObjectName(rUnoObj));
// analyse the Uno-Infos to recognise the arrays
Reference< XIntrospectionAccess > xAccess = rUnoObj.getIntrospectionAccess();
@@ -1887,8 +1883,7 @@ static OUString Impl_DumpProperties(SbUnoObject& rUnoObj)
aPropStr.append( Dbg_SbxDataType2String( eType ) );
if( bMaybeVoid )
aPropStr.append( "/void" );
- aPropStr.append( " " );
- aPropStr.append( pVar->GetName() );
+ aPropStr.append( " " + pVar->GetName() );
if( i == nPropCount - 1 )
aPropStr.append( "\n" );
@@ -1904,9 +1899,7 @@ static OUString Impl_DumpProperties(SbUnoObject& rUnoObj)
// Debugging help method to display the methods of an SbUnoObjects
static OUString Impl_DumpMethods(SbUnoObject& rUnoObj)
{
- OUStringBuffer aRet;
- aRet.append("Methods of object ");
- aRet.append(getDbgObjectName(rUnoObj));
+ OUStringBuffer aRet("Methods of object " + getDbgObjectName(rUnoObj));
// XIntrospectionAccess, so that the types of the parameter could be outputted
Reference< XIntrospectionAccess > xAccess = rUnoObj.getIntrospectionAccess();
@@ -1953,10 +1946,8 @@ static OUString Impl_DumpMethods(SbUnoObject& rUnoObj)
eType = SbxDataType( SbxOBJECT | SbxARRAY );
}
// output the name and the type
- aRet.append( Dbg_SbxDataType2String( eType ) );
- aRet.append( " " );
- aRet.append ( pVar->GetName() );
- aRet.append( " ( " );
+ aRet.append( Dbg_SbxDataType2String( eType )
+ + " " + pVar->GetName() + " ( " );
// the get-method mustn't have a parameter
Sequence< Reference< XIdlClass > > aParamsSeq = rxMethod->getParameterTypes();
@@ -4751,9 +4742,7 @@ Any SbUnoStructRefObject::getUnoAny()
OUString SbUnoStructRefObject::Impl_DumpProperties()
{
- OUStringBuffer aRet;
- aRet.append("Properties of object ");
- aRet.append( getDbgObjectName() );
+ OUStringBuffer aRet("Properties of object " + getDbgObjectName() );
sal_uInt32 nPropCount = pProps->Count();
sal_uInt32 nPropsPerLine = 1 + nPropCount / 30;
@@ -4786,10 +4775,8 @@ OUString SbUnoStructRefObject::Impl_DumpProperties()
}
}
}
- aPropStr.append( Dbg_SbxDataType2String( eType ) );
-
- aPropStr.append( " " );
- aPropStr.append( pVar->GetName() );
+ aPropStr.append( Dbg_SbxDataType2String( eType )
+ + " " + pVar->GetName() );
if( i == nPropCount - 1 )
{
@@ -4910,9 +4897,7 @@ OUString SbUnoStructRefObject::getDbgObjectName() const
{
aRet.append( "\n" );
}
- aRet.append( "\"" );
- aRet.append( aName );
- aRet.append( "\":" );
+ aRet.append( "\"" + aName + "\":" );
return aRet.makeStringAndClear();
}
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 71633b086a35..317539fbeecd 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -114,8 +114,7 @@ ErrCode ImpScan( const OUString& rWSrc, double& nVal, SbxDataType& rType,
short decsep = 0;
short ndig = 0;
short ncdig = 0; // number of digits after decimal point
- OUStringBuffer aSearchStr("0123456789DEde");
- aSearchStr.append(cNonIntntlDecSep);
+ OUStringBuffer aSearchStr(OUString::Concat("0123456789DEde") + OUStringChar(cNonIntntlDecSep));
if( cIntntlDecSep != cNonIntntlDecSep )
aSearchStr.append(cIntntlDecSep);
if( cIntntlDecSepAlt && cIntntlDecSepAlt != cNonIntntlDecSep )