forms/source/component/imgprod.cxx                         |    2 +-
 fpicker/source/office/RemoteFilesDialog.cxx                |    4 +---
 fpicker/source/office/iodlgimp.cxx                         |    2 +-
 framework/source/accelerators/acceleratorconfiguration.cxx |    7 +++----
 framework/source/accelerators/storageholder.cxx            |    2 +-
 framework/source/dispatch/dispatchinformationprovider.cxx  |    4 ++--
 framework/source/services/desktop.cxx                      |    2 +-
 framework/source/uiconfiguration/CommandImageResolver.cxx  |    4 ++--
 framework/source/uielement/headermenucontroller.cxx        |    2 +-
 framework/source/uielement/menubarmerger.cxx               |    4 ++--
 framework/source/uielement/toolbarmanager.cxx              |    2 +-
 framework/source/uielement/toolbarsmenucontroller.cxx      |    2 +-
 12 files changed, 17 insertions(+), 20 deletions(-)

New commits:
commit 61d7bd4cd2117e8c4a9bb1cb8fe306438ec34245
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Nov 11 19:32:54 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Nov 11 21:02:47 2024 +0100

    clang-tidy: performance-unnecessary-copy-initialization in framework
    
    Change-Id: I2ebf2c49ec9aa03f46abdbd2149f04ed5a22f94b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176416
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx 
b/framework/source/accelerators/acceleratorconfiguration.cxx
index cdc74298f937..8876093fc4f6 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -897,16 +897,15 @@ void SAL_CALL 
XCUBasedAcceleratorConfiguration::removeResetListener(const css::u
     SAL_INFO("fwk.accelerators", 
"XCUBasedAcceleratorConfiguration::removeResetListener(): implement me");
 }
 
-void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const 
css::util::ChangesEvent& aEvent)
+void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const 
css::util::ChangesEvent& aReceivedEvents)
 {
     SAL_INFO( "fwk.accelerators", 
"XCUBasedAcceleratorConfiguration::changesOccurred()" );
 
     css::uno::Reference< css::container::XHierarchicalNameAccess > xHAccess;
-    aEvent.Base >>= xHAccess;
+    aReceivedEvents.Base >>= xHAccess;
     if (! xHAccess.is ())
         return;
 
-    css::util::ChangesEvent aReceivedEvents( aEvent );
     const sal_Int32 c = aReceivedEvents.Changes.getLength();
     for (sal_Int32 i=0; i<c; ++i)
     {
@@ -973,7 +972,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( bool 
bPreferred, const css:
         sal_Int32 nKeys = lKeys.getLength();
         for ( sal_Int32 i=0; i<nKeys; ++i )
         {
-            OUString sKey = lKeys[i];
+            const OUString& sKey = lKeys[i];
             xAccess->getByName(sKey) >>= xKey;
             xKey->getByName(CFG_PROP_COMMAND) >>= xCommand;
 
diff --git a/framework/source/accelerators/storageholder.cxx 
b/framework/source/accelerators/storageholder.cxx
index 6cef699bfb14..95937439ca61 100644
--- a/framework/source/accelerators/storageholder.cxx
+++ b/framework/source/accelerators/storageholder.cxx
@@ -231,7 +231,7 @@ void StorageHolder::closePath(const OUString& rPath)
            pIt2 != lFolders.rend();
          ++pIt2                     )
     {
-        OUString             sPath = *pIt2;
+        const OUString&             sPath = *pIt2;
         TPath2StorageInfo::iterator pPath = m_lStorages.find(sPath);
         if (pPath == m_lStorages.end())
             continue; // ???
diff --git a/framework/source/dispatch/dispatchinformationprovider.cxx 
b/framework/source/dispatch/dispatchinformationprovider.cxx
index a5a0bd6980e6..b9aeac9524d4 100644
--- a/framework/source/dispatch/dispatchinformationprovider.cxx
+++ b/framework/source/dispatch/dispatchinformationprovider.cxx
@@ -51,7 +51,7 @@ css::uno::Sequence< sal_Int16 > SAL_CALL 
DispatchInformationProvider::getSupport
     for (i1=0; i1<c1; ++i1)
     {
         // ignore controller, which doesn't implement the right interface
-        css::uno::Reference< css::frame::XDispatchInformationProvider > 
xProvider = lProvider[i1];
+        const css::uno::Reference< css::frame::XDispatchInformationProvider >& 
xProvider = lProvider[i1];
         if (!xProvider.is())
             continue;
 
@@ -84,7 +84,7 @@ css::uno::Sequence< css::frame::DispatchInformation > 
SAL_CALL DispatchInformati
         try
         {
             // ignore controller, which doesn't implement the right interface
-            css::uno::Reference< css::frame::XDispatchInformationProvider > 
xProvider = lProvider[i1];
+            const css::uno::Reference< 
css::frame::XDispatchInformationProvider >& xProvider = lProvider[i1];
             if (!xProvider.is())
                 continue;
 
diff --git a/framework/source/services/desktop.cxx 
b/framework/source/services/desktop.cxx
index 608da2216a5c..db24a0bd1003 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -1662,7 +1662,7 @@ bool Desktop::impl_closeFrames(bool bAllowUI)
     {
         try
         {
-            css::uno::Reference< css::frame::XFrame > xFrame = lFrames[i];
+            const css::uno::Reference< css::frame::XFrame >& xFrame = 
lFrames[i];
 
             // XController.suspend() will show a UI ...
             // Use it in case it was allowed from outside only.
diff --git a/framework/source/uiconfiguration/CommandImageResolver.cxx 
b/framework/source/uiconfiguration/CommandImageResolver.cxx
index e6c0c8ba850d..10e3ae4c85b9 100644
--- a/framework/source/uiconfiguration/CommandImageResolver.cxx
+++ b/framework/source/uiconfiguration/CommandImageResolver.cxx
@@ -79,7 +79,7 @@ void CommandImageResolver::registerCommands(const 
Sequence<OUString>& aCommandSe
 
     for (sal_Int32 i = 0; i < nSequenceSize; ++i)
     {
-        OUString aCommandName(aCommandSequence[i]);
+        const OUString& aCommandName(aCommandSequence[i]);
         OUString aImageName;
 
         m_aImageCommandNameVector[i] = aCommandName;
@@ -129,7 +129,7 @@ ImageList* CommandImageResolver::getImageList(ImageType 
nImageType)
 
     if (!m_pImageList[nImageType])
     {
-        OUString sIconPath = ImageType_Prefixes[nImageType];
+        const OUString& sIconPath = ImageType_Prefixes[nImageType];
         m_pImageList[nImageType].reset( new ImageList(m_aImageNameVector, 
sIconPath) );
     }
 
diff --git a/framework/source/uielement/headermenucontroller.cxx 
b/framework/source/uielement/headermenucontroller.cxx
index 6adc07f0c07b..5105f3661740 100644
--- a/framework/source/uielement/headermenucontroller.cxx
+++ b/framework/source/uielement/headermenucontroller.cxx
@@ -114,7 +114,7 @@ void HeaderMenuController::fillPopupMenu( const Reference< 
css::frame::XModel >&
             bool bFirstItemInserted( false );
             for ( sal_Int32 n = 0; n < aSeqNames.getLength(); n++ )
             {
-                OUString aName = aSeqNames[n];
+                const OUString& aName = aSeqNames[n];
                 Reference< XPropertySet > xPropSet( xNameContainer->getByName( 
aName ), UNO_QUERY );
                 if ( xPropSet.is() )
                 {
diff --git a/framework/source/uielement/menubarmerger.cxx 
b/framework/source/uielement/menubarmerger.cxx
index eebf61aa7383..dfdebdc7919a 100644
--- a/framework/source/uielement/menubarmerger.cxx
+++ b/framework/source/uielement/menubarmerger.cxx
@@ -104,7 +104,7 @@ ReferencePathInfo MenuBarMerger::FindReferencePath(
     do
     {
         ++nLevel;
-        OUString aCmd( rReferencePath[i] );
+        const OUString& aCmd( rReferencePath[i] );
 
         if ( i == nCount-1 )
         {
@@ -350,7 +350,7 @@ bool MenuBarMerger::ProcessFallbackOperation(
             }
             else
             {
-                const OUString aCmd( rReferencePath[nLevel] );
+                const OUString& aCmd( rReferencePath[nLevel] );
 
                 VclPtr<PopupMenu> pPopupMenu = VclPtr<PopupMenu>::Create();
 
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index d6bde87bc940..914a0b1b2671 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1691,7 +1691,7 @@ void ToolBarManager::notifyRegisteredControllers( const 
OUString& aUIElementName
     {
         try
         {
-            Reference< XSubToolbarController > xController = aNotifyVector[i];
+            const Reference< XSubToolbarController >& xController = 
aNotifyVector[i];
             if ( xController.is() )
                 xController->functionSelected( aCommand );
         }
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx 
b/framework/source/uielement/toolbarsmenucontroller.cxx
index 387eef47590b..6c0c09549dce 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -545,7 +545,7 @@ void SAL_CALL ToolbarsMenuController::itemSelected( const 
css::awt::MenuEvent& r
                 {
                     try
                     {
-                        OUString aElementName = aElementNames[i];
+                        const OUString& aElementName = aElementNames[i];
                         Sequence< PropertyValue > aWindowState;
 
                         if ( xPersistentWindowState->getByName( aElementName ) 
>>= aWindowState )
commit 66c312696014677c57cd21a6b25fa06e92ae487e
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Nov 11 19:32:41 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Nov 11 21:02:38 2024 +0100

    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 <noel.gran...@collabora.co.uk>

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

Reply via email to