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.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2024-11-11 19:32:54 +02:00
parent 66c3126960
commit 61d7bd4cd2
9 changed files with 14 additions and 15 deletions

View file

@ -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;

View file

@ -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; // ???

View file

@ -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;

View file

@ -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.

View file

@ -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) );
}

View file

@ -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() )
{

View file

@ -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();

View file

@ -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 );
}

View file

@ -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 )