diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-24 19:08:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-25 06:21:25 +0000 |
commit | d638a512ac19fa68f7760ff110469337f061f481 (patch) | |
tree | a5f9d74252f31be1a90b3bcbd346ea58dea217cb /desktop | |
parent | 4ca4282517d02592966576fc642048b3d5ae5532 (diff) |
loplugin:stringadd in d*
after my patch to merge the bufferadd loplugin into stringadd
Change-Id: I625a0adf89f54ea25f0377a266c37acf9a37d723
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149550
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 8 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 4 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_updatedialog.cxx | 14 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx | 5 | ||||
-rw-r--r-- | desktop/source/deployment/manager/dp_manager.cxx | 11 | ||||
-rw-r--r-- | desktop/source/deployment/misc/dp_misc.cxx | 3 | ||||
-rw-r--r-- | desktop/source/deployment/registry/component/dp_component.cxx | 14 | ||||
-rw-r--r-- | desktop/source/deployment/registry/dp_registry.cxx | 8 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 7 | ||||
-rw-r--r-- | desktop/source/migration/migration.cxx | 7 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx | 7 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 7 |
12 files changed, 34 insertions, 61 deletions
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 74f838939bfa..9b77da1a9037 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -1066,12 +1066,12 @@ bool IpcThread::process(OString const & arguments, bool * waitProcessed) { aHelpURLBuffer.append("vnd.sun.star.help://smath/start"); } if (bShowHelp) { - aHelpURLBuffer.append("?Language="); - aHelpURLBuffer.append(utl::ConfigManager::getUILocale()); + aHelpURLBuffer.append("?Language=" + + utl::ConfigManager::getUILocale() #if defined UNX - aHelpURLBuffer.append("&System=UNX"); + + "&System=UNX"); #elif defined _WIN32 - aHelpURLBuffer.append("&System=WIN"); + + "&System=WIN"); #endif ApplicationEvent* pAppEvent = new ApplicationEvent( ApplicationEvent::Type::OpenHelpUrl, diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index f21585c3e402..9953e0549a7b 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -150,8 +150,8 @@ void Entry_Impl::checkDependencies() OUStringBuffer aMissingDep( DpResId( RID_STR_ERROR_MISSING_DEPENDENCIES ) ); for ( const auto& i : std::as_const(depExc.UnsatisfiedDependencies) ) { - aMissingDep.append("\n"); - aMissingDep.append(dp_misc::Dependencies::getErrorText(i)); + aMissingDep.append("\n" + + dp_misc::Dependencies::getErrorText(i)); } aMissingDep.append("\n"); m_sErrorText = aMissingDep.makeStringAndClear(); diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index 2861d77856ca..e8da99f3c103 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -881,31 +881,25 @@ IMPL_LINK_NOARG(UpdateDialog, selectionHandler, weld::TreeView&, void) m_noDependency = m_noDependency.replaceAt( nPos, sProductName.getLength(), utl::ConfigManager::getProductName() ); } - b.append(m_noInstall); - b.append(LF); - b.append(m_noDependency); + b.append(m_noInstall + OUStringChar(LF) + m_noDependency); for (sal_Int32 i = 0; i < data.unsatisfiedDependencies.getLength(); ++i) { - b.append(LF); - b.append(" "); + b.append(OUStringChar(LF) + " "); // U+2003 EM SPACE would be better than two spaces, // but some fonts do not contain it b.append( confineToParagraph( data.unsatisfiedDependencies[i])); } - b.append(LF); - b.append(" "); - b.append(m_noDependencyCurVer); + b.append(OUStringChar(LF) + " " + m_noDependencyCurVer); } break; } case SPECIFIC_ERROR: { UpdateDialog::SpecificError & data = m_specificErrors[ pos ]; - b.append(m_failure); - b.append(LF); + b.append(m_failure + OUStringChar(LF)); b.append( data.message.isEmpty() ? m_unknownError : data.message ); break; } diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx index 9b1aa423d03f..0248a1537fa1 100644 --- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx @@ -373,10 +373,7 @@ void UpdateInstallDialog::Thread::downloadExtensions() { if (nPos) buf.append("\n"); - buf.append("Could not download "); - buf.append(elem.first); - buf.append(". "); - buf.append(elem.second.Message); + buf.append("Could not download " + elem.first + ". " + elem.second.Message); ++nPos; } m_dialog.setError(UpdateInstallDialog::ERROR_DOWNLOAD, updateData.aInstalledPackage->getDisplayName(), diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 9c4a849e2843..206b44d85bd6 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -941,17 +941,16 @@ void PackageManagerImpl::removePackage( OUString PackageManagerImpl::getDeployPath( ActivePackages::Data const & data ) { - OUStringBuffer buf; - buf.append( data.temporaryName ); + OUStringBuffer buf( data.temporaryName ); //The bundled extensions are not contained in an additional folder //with a unique name. data.temporaryName contains already the //UTF8 encoded folder name. See PackageManagerImpl::synchronize if (m_context != "bundled") { - buf.append( "_/" ); - buf.append( ::rtl::Uri::encode( data.fileName, rtl_UriCharClassPchar, - rtl_UriEncodeIgnoreEscapes, - RTL_TEXTENCODING_UTF8 ) ); + buf.append( "_/" + + ::rtl::Uri::encode( data.fileName, rtl_UriCharClassPchar, + rtl_UriEncodeIgnoreEscapes, + RTL_TEXTENCODING_UTF8 ) ); } return makeURL( m_activePackages, buf.makeStringAndClear() ); } diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index 15e31b0fe402..01fb414a7909 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -104,8 +104,7 @@ OUString generateOfficePipeId() // create hex-value string from the MD5 value to keep // the string size minimal - OUStringBuffer buf; - buf.append( "SingleOfficeIPC_" ); + OUStringBuffer buf( "SingleOfficeIPC_" ); for ( sal_uInt32 i = 0; i < md5_key_len; ++i ) { buf.append( static_cast<sal_Int32>(md5_buf[ i ]), 0x10 ); } diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index 234381d0657b..cbe7548f05cb 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -858,13 +858,9 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ) if (!m_unorc_inited || !m_unorc_modified) return; - OStringBuffer buf; - - buf.append("ORIGIN="); OUString sOrigin = dp_misc::makeRcTerm(m_cachePath); OString osOrigin = OUStringToOString(sOrigin, RTL_TEXTENCODING_UTF8); - buf.append(osOrigin); - buf.append(LF); + OStringBuffer buf("ORIGIN=" + osOrigin + OStringChar(LF)); if (! m_jar_typelibs.empty()) { @@ -913,9 +909,8 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ) bool space = false; if (!sCommonRDB.isEmpty()) { - buf.append( "?$ORIGIN/" ); - buf.append( OUStringToOString( - sCommonRDB, RTL_TEXTENCODING_ASCII_US ) ); + buf.append( "?$ORIGIN/" + + OUStringToOString( sCommonRDB, RTL_TEXTENCODING_ASCII_US ) ); space = true; } if (!sNativeRDB.isEmpty()) @@ -951,8 +946,7 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ) { buf.append(' '); } - buf.append('?'); - buf.append(OUStringToOString(component, RTL_TEXTENCODING_UTF8)); + buf.append("?" + OUStringToOString(component, RTL_TEXTENCODING_UTF8)); space = true; } buf.append(LF); diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx index 961afe7bbec1..ac19bcd8e9d8 100644 --- a/desktop/source/deployment/registry/dp_registry.cxx +++ b/desktop/source/deployment/registry/dp_registry.cxx @@ -381,8 +381,8 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create( OUStringBuffer buf; buf.append( Reference<lang::XServiceInfo>( - ambiguousBackend, UNO_QUERY_THROW )->getImplementationName() ); - buf.append( ": " ); + ambiguousBackend, UNO_QUERY_THROW )->getImplementationName() + + ": " ); const Sequence< Reference<deployment::XPackageTypeInfo> > types( ambiguousBackend->getSupportedPackageTypes() ); for ( sal_Int32 pos = 0; pos < types.getLength(); ++pos ) { @@ -391,9 +391,7 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create( buf.append( xInfo->getMediaType() ); const OUString filter( xInfo->getFileFilter() ); if (!filter.isEmpty()) { - buf.append( " (" ); - buf.append( filter ); - buf.append( ")" ); + buf.append( " (" + filter + ")" ); } if (pos < (types.getLength() - 1)) buf.append( ", " ); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6753220051e0..5a5d3e4399b2 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -259,8 +259,8 @@ public: OStringBuffer aOutput; for (const auto &s : aEvents) { - aOutput.append(OUStringToOString(s, RTL_TEXTENCODING_UTF8)); - aOutput.append("\n"); + aOutput.append(OUStringToOString(s, RTL_TEXTENCODING_UTF8) + + "\n"); } if (aOutput.getLength() > 0) { @@ -3120,8 +3120,7 @@ static char* lo_extractRequest(LibreOfficeKit* /*pThis*/, const char* pFilePath) if( xLTS.is() ) { - OUStringBuffer jsonText; - jsonText.append("{ \"Targets\": { "); + OUStringBuffer jsonText("{ \"Targets\": { "); bool lastParentheses = extractLinks(xLTS->getLinks(), false, jsonText); jsonText.append("} }"); if (!lastParentheses) diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 38c8ccb61167..273dd5e3def6 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -728,8 +728,8 @@ void MigrationImpl::copyConfig() // shared registrymodifications.xcu does not exists // the configuration is split in many registry files // determine the file names from the first element in included paths - OUStringBuffer buf(m_aInfo.userdata); - buf.append("/user/registry/data"); + OUStringBuffer buf(m_aInfo.userdata + + "/user/registry/data"); sal_Int32 n = 0; do { OUString seg(comp.first.getToken(0, '.', n)); @@ -741,8 +741,7 @@ void MigrationImpl::copyConfig() SAL_INFO( "desktop.migration", "configuration migration component " << comp.first << " ignored (cannot be encoded as file path)" ); goto next; } - buf.append('/'); - buf.append(enc); + buf.append("/" + enc); } while (n >= 0); buf.append(".xcu"); regFilePath = buf.makeStringAndClear(); diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx index a902f956d8d5..581922a3c365 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx @@ -324,13 +324,10 @@ void CommandEnvironmentImpl::update_( Any const & Status ) return; } else { - OUStringBuffer buf; - buf.append( "WARNING: " ); + OUStringBuffer buf( "WARNING: " ); deployment::DeploymentException dp_exc; if (Status >>= dp_exc) { - buf.append( dp_exc.Message ); - buf.append( ", Cause: " ); - buf.append( ::comphelper::anyToString(dp_exc.Cause) ); + buf.append( dp_exc.Message + ", Cause: " + ::comphelper::anyToString(dp_exc.Cause) ); } else { buf.append( ::comphelper::anyToString(Status) ); diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index c9c9b33674ac..553952917748 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -55,14 +55,11 @@ namespace unopkg { OUString toString( OptionInfo const * info ) { assert(info != nullptr); - OUStringBuffer buf; - buf.append("--"); + OUStringBuffer buf("--"); buf.appendAscii(info->m_name); if (info->m_short_option != '\0') { - buf.append(" (short -" ); - buf.append(info->m_short_option ); - buf.append(")"); + buf.append(" (short -" + OUStringChar(info->m_short_option) + ")"); } if (info->m_has_argument) buf.append(" <argument>" ); |