From 66c312696014677c57cd21a6b25fa06e92ae487e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 11 Nov 2024 19:32:41 +0200 Subject: [PATCH] clang-tidy: performance-unnecessary-copy-initialization in fpicker Change-Id: I9ba5dd3d13390db5d2c6d03caf087c453ee09ba6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176415 Tested-by: Jenkins Reviewed-by: Noel Grandin --- forms/source/component/imgprod.cxx | 2 +- fpicker/source/office/RemoteFilesDialog.cxx | 4 +--- fpicker/source/office/iodlgimp.cxx | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx index 47f9f13e3425..7ea05d743ac1 100644 --- a/forms/source/component/imgprod.cxx +++ b/forms/source/component/imgprod.cxx @@ -241,7 +241,7 @@ void ImageProducer::ImplInitConsumer( const Graphic& rGraphic ) void ImageProducer::ImplUpdateConsumer( const Graphic& rGraphic ) { BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); - Bitmap aBmp( aBmpEx.GetBitmap() ); + const Bitmap& aBmp( aBmpEx.GetBitmap() ); BitmapScopedReadAccess pBmpAcc(aBmp); if( !pBmpAcc ) diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index b4ad4485c17e..9bc424d604c3 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -323,13 +323,11 @@ int RemoteFilesDialog::GetSelectedServicePos() void RemoteFilesDialog::AddFilter( const OUString& rFilter, const OUString& rType ) { - OUString sName = rFilter; - m_aFilters.emplace_back( rFilter, rType ); if (rType.isEmpty()) m_xFilter_lb->append_separator(u""_ustr); else - m_xFilter_lb->append_text(sName); + m_xFilter_lb->append_text(rFilter); if (m_xFilter_lb->get_active() == -1) m_xFilter_lb->set_active(0); diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx index 71886c87a9e4..70a050183ca5 100644 --- a/fpicker/source/office/iodlgimp.cxx +++ b/fpicker/source/office/iodlgimp.cxx @@ -161,7 +161,7 @@ void SvtExpFileDlg_Impl::InsertFilterListEntry(const SvtFileDialogFilter_Impl* p { // insert and set user data OUString sId(weld::toId(pFilterDesc)); - OUString sName = pFilterDesc->GetName(); + const OUString& sName = pFilterDesc->GetName(); if (pFilterDesc->isGroupSeparator()) m_xLbFilter->append_separator(sId); else