From db7f33af1438538bb51b376242294ecd3bfcb055 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 30 Mar 2023 16:10:11 +0200 Subject: loplugin:stringadd in various when applying my upcoming patch to also consider O[U]StringBuffer Change-Id: I8cf6a47ad357ddc73e2c430d966be72d5efd1485 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149767 Tested-by: Jenkins Reviewed-by: Noel Grandin --- unodevtools/source/skeletonmaker/cppcompskeleton.cxx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'unodevtools') diff --git a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx index 0e57d1132921..b17c35c90c84 100644 --- a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx +++ b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx @@ -81,8 +81,7 @@ static short generateNamespace(std::ostream & o, OStringBuffer buf; if (index == -1) { if (serviceobject) { - buf.append("comp_"); - buf.append(implname); + buf.append("comp_" + implname); nm = buf.makeStringAndClear(); o << "namespace comp_" << implname << " {\n\n"; count=1; @@ -94,13 +93,11 @@ static short generateNamespace(std::ostream & o, do { OString token(implname.getToken(0, '.', nPos)); if (nPos < 0 && serviceobject) { - buf.append("::comp_"); - buf.append(token); + buf.append("::comp_" + token); o << "namespace comp_" << token << " { "; count++; } else { - buf.append("::"); - buf.append(token); + buf.append("::" + token); o << "namespace " << token << " { "; count++; } @@ -612,14 +609,14 @@ static OString generateClassDefinition(std::ostream& o, if (!interfaces.empty()) { if (supportxcomponent) { - parentname.append("::cppu::WeakComponentImplHelper"); - parentname.append(static_cast(interfaces.size())); + parentname.append("::cppu::WeakComponentImplHelper" + + OString::number(static_cast(interfaces.size()))); o << " private ::cppu::BaseMutex,\n" " public ::cppu::WeakComponentImplHelper" << interfaces.size() << "<"; } else { - parentname.append("::cppu::WeakImplHelper"); - parentname.append(static_cast(interfaces.size())); + parentname.append("::cppu::WeakImplHelper" + + OString::number(static_cast(interfaces.size()))); o << " public ::cppu::WeakImplHelper" << interfaces.size() << "<"; } @@ -661,8 +658,7 @@ static OString generateClassDefinition(std::ostream& o, "css::uno::RuntimeException);\n"; OStringBuffer buffer(256); - buffer.append(parentname); - buffer.append("< "); + buffer.append(parentname + "< "); std::set< OUString >::const_iterator iter = interfaces.begin(); while (iter != interfaces.end()) { -- cgit