clang-tidy: performance-unnecessary-copy-initialization in desktop

Change-Id: I0e6ce8858fc058403020e2db863730f04cac70db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176392
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin 2024-11-11 11:15:50 +02:00
parent 08ed26c3b8
commit 40afc6f25a
3 changed files with 4 additions and 5 deletions

View file

@ -411,7 +411,7 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create(
// Initialize logger which will be used in ProgressLogImpl (created below)
rtl::Bootstrap::expandMacros(logFile);
comphelper::EventLogger logger(xComponentContext, "unopkg");
const Reference<XLogger> xLogger(logger.getLogger());
const Reference<XLogger>& xLogger(logger.getLogger());
Reference<XLogFormatter> xLogFormatter(SimpleTextFormatter::create(xComponentContext));
Sequence < beans::NamedValue > aSeq2 { { u"Formatter"_ustr, Any(xLogFormatter) }, {u"FileURL"_ustr, Any(logFile)} };
Reference<XLogHandler> xFileHandler(css::logging::FileHandler::createWithSettings(xComponentContext, aSeq2));

View file

@ -450,9 +450,8 @@ void BackendImpl::implProcessHelp(
std::unique_ptr<OUString[]> pXhpFiles(new OUString[nXhpFileCount]);
for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
{
OUString aXhpFile = aXhpFileVector[iXhp];
OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL );
pXhpFiles[iXhp] = aXhpRelFile;
const OUString& aXhpFile = aXhpFileVector[iXhp];
pXhpFiles[iXhp] = aXhpFile.copy( nLenLangFolderURL );
}
OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() );

View file

@ -922,7 +922,7 @@ std::vector< MigrationModuleInfo > MigrationImpl::detectUIChangesForAllModules()
uno::Sequence< OUString > lNames = xModules->getElementNames();
sal_Int32 nLength = lNames.getLength();
for (sal_Int32 i=0; i<nLength; ++i) {
OUString sModuleShortName = lNames[i];
const OUString& sModuleShortName = lNames[i];
uno::Reference< embed::XStorage > xModule = xModules->openStorageElement(sModuleShortName, embed::ElementModes::READ);
if (xModule.is()) {
MigrationModuleInfo aModuleInfo;