From a34d9e36193821fdbc8fb7d6b3527daf076b2069 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 12 Nov 2024 21:02:56 +0200 Subject: [PATCH] loplugin:reftotemp in scripting..uui Change-Id: I6953958b4429dd0fa1a44d02b0b49618f97baf90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176500 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/test/testinteractionhandler.hxx | 6 +++--- include/tools/UnitConversion.hxx | 2 +- scripting/source/dlgprov/dlgevtatt.cxx | 8 ++++---- test/source/a11y/AccessibilityTools.cxx | 2 +- test/source/a11y/accessibletestbase.cxx | 6 +++--- toolkit/source/awt/stylesettings.cxx | 10 +++++----- toolkit/source/controls/table/mousefunction.cxx | 2 +- ucb/source/ucp/webdav-curl/webdavcontent.cxx | 6 +++--- ucbhelper/source/provider/contentinfo.cxx | 6 +++--- unotools/source/config/lingucfg.cxx | 6 +++--- unoxml/source/dom/saxbuilder.cxx | 10 +++++----- uui/source/iahndl-authentication.cxx | 4 ++-- 12 files changed, 34 insertions(+), 34 deletions(-) diff --git a/include/test/testinteractionhandler.hxx b/include/test/testinteractionhandler.hxx index 01a3726cf42d..b1851493efd0 100644 --- a/include/test/testinteractionhandler.hxx +++ b/include/test/testinteractionhandler.hxx @@ -76,13 +76,13 @@ public: { mbPasswordRequested = false; - css::uno::Sequence> const &rContinuations = rRequest->getContinuations(); + css::uno::Sequence> const aContinuations = rRequest->getContinuations(); css::uno::Any const aRequest(rRequest->getRequest()); - if (handlePasswordRequest(rContinuations, aRequest)) + if (handlePasswordRequest(aContinuations, aRequest)) return true; - for (auto const & cont : rContinuations) + for (auto const & cont : aContinuations) { css::uno::Reference xApprove(cont, css::uno::UNO_QUERY); if (xApprove.is()) diff --git a/include/tools/UnitConversion.hxx b/include/tools/UnitConversion.hxx index b7756343252c..775afa52482d 100644 --- a/include/tools/UnitConversion.hxx +++ b/include/tools/UnitConversion.hxx @@ -16,7 +16,7 @@ inline Fraction conversionFract(o3tl::Length from, o3tl::Length to) { - const auto & [ mul, div ] = o3tl::getConversionMulDiv(from, to); + const auto[mul, div] = o3tl::getConversionMulDiv(from, to); return { mul, div }; } diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx index 30cade77c880..fbc8680ea374 100644 --- a/scripting/source/dlgprov/dlgevtatt.cxx +++ b/scripting/source/dlgprov/dlgevtatt.cxx @@ -554,19 +554,19 @@ namespace dlgprov try { // call method - const Reference< XIdlMethod >& rxMethod = m_xIntrospectionAccess-> + const Reference< XIdlMethod > xMethod = m_xIntrospectionAccess-> getMethod( aMethodName, MethodConcept::ALL - MethodConcept::DANGEROUS ); Reference< XMaterialHolder > xMaterialHolder = Reference< XMaterialHolder >::query( m_xIntrospectionAccess ); Any aHandlerObject = xMaterialHolder->getMaterial(); - Sequence< Reference< XIdlClass > > aParamTypeSeq = rxMethod->getParameterTypes(); + Sequence< Reference< XIdlClass > > aParamTypeSeq = xMethod->getParameterTypes(); sal_Int32 nParamCount = aParamTypeSeq.getLength(); if( nParamCount == 0 ) { Sequence args; - rxMethod->invoke( aHandlerObject, args ); + xMethod->invoke( aHandlerObject, args ); bHandled = true; } else if( nParamCount == 2 ) @@ -585,7 +585,7 @@ namespace dlgprov pArgs[0] <<= xWindow; } pArgs[1] = aEventObject; - aRet = rxMethod->invoke( aHandlerObject, Args ); + aRet = xMethod->invoke( aHandlerObject, Args ); bHandled = true; } } diff --git a/test/source/a11y/AccessibilityTools.cxx b/test/source/a11y/AccessibilityTools.cxx index b91d431db9b5..3bf97052bf81 100644 --- a/test/source/a11y/AccessibilityTools.cxx +++ b/test/source/a11y/AccessibilityTools.cxx @@ -692,7 +692,7 @@ OUString AccessibilityTools::debugName(accessibility::XAccessibleAction* xAct) r.append("description=\"" + xAct->getAccessibleActionDescription(i) + "\""); - const auto& xKeyBinding = xAct->getAccessibleActionKeyBinding(i); + const auto xKeyBinding = xAct->getAccessibleActionKeyBinding(i); if (xKeyBinding) { r.append(" keybindings=["); diff --git a/test/source/a11y/accessibletestbase.cxx b/test/source/a11y/accessibletestbase.cxx index 38d07312c990..dc34855a3935 100644 --- a/test/source/a11y/accessibletestbase.cxx +++ b/test/source/a11y/accessibletestbase.cxx @@ -175,7 +175,7 @@ void test::AccessibleTestBase::collectText( const uno::Reference& xContext, rtl::OUStringBuffer& buffer, bool onlyChildren) { - const auto& roleName = AccessibilityTools::getRoleName(xContext->getAccessibleRole()); + const auto roleName = AccessibilityTools::getRoleName(xContext->getAccessibleRole()); std::cout << "collecting text for child of role " << roleName << "..." << std::endl; @@ -243,7 +243,7 @@ test::AccessibleTestBase::getFirstRelationTargetOfType( { for (sal_Int32 i = 0; i < relset->getRelationCount(); ++i) { - const auto& rel = relset->getRelation(i); + const auto rel = relset->getRelation(i); if (rel.RelationType == relationType) { for (const uno::Reference& targetAccessible : @@ -280,7 +280,7 @@ void test::AccessibleTestBase::dumpA11YTree( if (i > 0) std::cout << ", "; - const auto& rel = xRelSet->getRelation(i); + const auto rel = xRelSet->getRelation(i); std::cout << "(type=" << AccessibilityTools::getRelationTypeName(rel.RelationType) << " (" << static_cast(rel.RelationType) << ")"; std::cout << " targets=["; diff --git a/toolkit/source/awt/stylesettings.cxx b/toolkit/source/awt/stylesettings.cxx index 75c2b687d2d6..e1869dd8d2e3 100644 --- a/toolkit/source/awt/stylesettings.cxx +++ b/toolkit/source/awt/stylesettings.cxx @@ -113,7 +113,7 @@ namespace toolkit sal_Int32 WindowStyleSettings::ImplGetStyleColor( Color const & (StyleSettings::*i_pGetter)() const ) const { - const VclPtr& pWindow = pOwningWindow->GetWindow(); + const VclPtr pWindow = pOwningWindow->GetWindow(); const AllSettings aAllSettings = pWindow->GetSettings(); const StyleSettings& aStyleSettings = aAllSettings.GetStyleSettings(); return sal_Int32((aStyleSettings.*i_pGetter)()); @@ -131,7 +131,7 @@ namespace toolkit FontDescriptor WindowStyleSettings::ImplGetStyleFont( vcl::Font const & (StyleSettings::*i_pGetter)() const ) const { - const VclPtr& pWindow = pOwningWindow->GetWindow(); + const VclPtr pWindow = pOwningWindow->GetWindow(); const AllSettings aAllSettings = pWindow->GetSettings(); const StyleSettings& aStyleSettings = aAllSettings.GetStyleSettings(); return VCLUnoHelper::CreateFontDescriptor( (aStyleSettings.*i_pGetter)() ); @@ -375,7 +375,7 @@ namespace toolkit ::sal_Int32 SAL_CALL WindowStyleSettings::getFaceGradientColor() { StyleMethodGuard aGuard( pOwningWindow ); - const VclPtr& pWindow = pOwningWindow->GetWindow(); + const VclPtr pWindow = pOwningWindow->GetWindow(); const AllSettings aAllSettings = pWindow->GetSettings(); const StyleSettings& aStyleSettings = aAllSettings.GetStyleSettings(); return sal_Int32(aStyleSettings.GetFaceGradientColor()); @@ -665,7 +665,7 @@ namespace toolkit ::sal_Int32 SAL_CALL WindowStyleSettings::getSeparatorColor() { StyleMethodGuard aGuard( pOwningWindow ); - const VclPtr& pWindow = pOwningWindow->GetWindow(); + const VclPtr pWindow = pOwningWindow->GetWindow(); const AllSettings aAllSettings = pWindow->GetSettings(); const StyleSettings& aStyleSettings = aAllSettings.GetStyleSettings(); return sal_Int32(aStyleSettings.GetSeparatorColor()); @@ -731,7 +731,7 @@ namespace toolkit sal_Bool SAL_CALL WindowStyleSettings::getHighContrastMode() { StyleMethodGuard aGuard( pOwningWindow ); - const VclPtr& pWindow = pOwningWindow->GetWindow(); + const VclPtr pWindow = pOwningWindow->GetWindow(); const AllSettings aAllSettings = pWindow->GetSettings(); const StyleSettings& aStyleSettings = aAllSettings.GetStyleSettings(); return aStyleSettings.GetHighContrastMode(); diff --git a/toolkit/source/controls/table/mousefunction.cxx b/toolkit/source/controls/table/mousefunction.cxx index d0a784fdf18e..80d5e8d0fd17 100644 --- a/toolkit/source/controls/table/mousefunction.cxx +++ b/toolkit/source/controls/table/mousefunction.cxx @@ -53,7 +53,7 @@ namespace svt::table // set proper pointer PointerStyle aNewPointer( PointerStyle::Arrow ); - ColumnMetrics const & columnMetrics( i_tableControl.getColumnMetrics( m_nResizingColumn ) ); + ColumnMetrics const columnMetrics( i_tableControl.getColumnMetrics( m_nResizingColumn ) ); if ( ( aPoint.X() > tableSize.Width() ) || ( aPoint.X() < columnMetrics.nStartPixel ) ) diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx index 04fef2ec92de..d0e656a3be0c 100644 --- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx @@ -3028,7 +3028,7 @@ Content::ResourceType Content::resourceTypeForLocks( } } - const OUString & rURL = m_xIdentifier->getContentIdentifier(); + const OUString aURL = m_xIdentifier->getContentIdentifier(); if ( eResourceTypeForLocks == UNKNOWN ) { @@ -3200,7 +3200,7 @@ Content::ResourceType Content::resourceTypeForLocks( { SAL_WARN_IF( eResourceTypeForLocks != m_eResourceTypeForLocks, "ucb.ucp.webdav", - "different resource types for <" << rURL << ">: " + "different resource types for <" << aURL << ">: " << +eResourceTypeForLocks << " vs. " << +m_eResourceTypeForLocks); } SAL_INFO( "ucb.ucp.webdav", "resourceTypeForLocks() - URL: <" @@ -3984,7 +3984,7 @@ Content::ResourceType Content::getResourceType( osl::MutexGuard aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess ) ); } - const Content::ResourceType & ret = getResourceType( xEnv, xResAccess ); + const Content::ResourceType ret = getResourceType( xEnv, xResAccess ); { osl::Guard< osl::Mutex > aGuard( m_aMutex ); m_xResAccess.reset( new DAVResourceAccess( *xResAccess ) ); diff --git a/ucbhelper/source/provider/contentinfo.cxx b/ucbhelper/source/provider/contentinfo.cxx index 1e513604eb19..6d8674866da8 100644 --- a/ucbhelper/source/provider/contentinfo.cxx +++ b/ucbhelper/source/provider/contentinfo.cxx @@ -91,15 +91,15 @@ const uno::Sequence< beans::Property > & PropertySetInfo::getPropertiesImpl() xSet->getPropertySetInfo() ); if ( xInfo.is() ) { - const uno::Sequence< beans::Property >& rAddProps + const uno::Sequence< beans::Property > aAddProps = xInfo->getProperties(); - sal_Int32 nAddProps = rAddProps.getLength(); + sal_Int32 nAddProps = aAddProps.getLength(); if ( nAddProps > 0 ) { sal_Int32 nPos = m_xProps->getLength(); m_xProps->realloc( nPos + nAddProps ); - std::copy(rAddProps.begin(), rAddProps.end(), + std::copy(aAddProps.begin(), aAddProps.end(), std::next(m_xProps->getArray(), nPos)); } } diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index 5e4aee967e0b..b49dec173ed8 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -193,12 +193,12 @@ public: SvtLinguConfigItem::SvtLinguConfigItem() : utl::ConfigItem( u"Office.Linguistic"_ustr ) { - const uno::Sequence< OUString > &rPropertyNames = GetPropertyNames(); - LoadOptions( rPropertyNames ); + const uno::Sequence< OUString > aPropertyNames = GetPropertyNames(); + LoadOptions( aPropertyNames ); ClearModified(); // request notify events when properties change - EnableNotification( rPropertyNames ); + EnableNotification( aPropertyNames ); } void SvtLinguConfigItem::Notify( const uno::Sequence< OUString > &rPropertyNames ) diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx index 72a75b452be2..228c1b321d3f 100644 --- a/unoxml/source/dom/saxbuilder.cxx +++ b/unoxml/source/dom/saxbuilder.cxx @@ -180,8 +180,8 @@ namespace DOM } Reference< XElement > aElement; - const OUString& aPrefix(SvXMLImport::getNamespacePrefixFromToken(nElement, nullptr)); - const OUString& aURI( SvXMLImport::getNamespaceURIFromToken( nElement ) ); + const OUString aPrefix(SvXMLImport::getNamespacePrefixFromToken(nElement, nullptr)); + const OUString aURI( SvXMLImport::getNamespaceURIFromToken( nElement ) ); OUString aQualifiedName( SvXMLImport::getNameFromToken( nElement ) ); if( !aPrefix.isEmpty() ) aQualifiedName = aPrefix + SvXMLImport::aNamespaceSeparator + aQualifiedName; @@ -246,8 +246,8 @@ namespace DOM for (auto &it : sax_fastparser::castToFastAttributeList( xAttribs )) { sal_Int32 nAttrToken = it.getToken(); - const OUString& aAttrPrefix(SvXMLImport::getNamespacePrefixFromToken(nAttrToken, nullptr)); - const OUString& aAttrURI( SvXMLImport::getNamespaceURIFromToken( nAttrToken ) ); + const OUString aAttrPrefix(SvXMLImport::getNamespacePrefixFromToken(nAttrToken, nullptr)); + const OUString aAttrURI( SvXMLImport::getNamespaceURIFromToken( nAttrToken ) ); OUString aAttrQualifiedName( SvXMLImport::getNameFromToken( nAttrToken ) ); if( !aAttrPrefix.isEmpty() ) aAttrQualifiedName = aAttrPrefix + SvXMLImport::aNamespaceSeparator + aAttrQualifiedName; @@ -297,7 +297,7 @@ namespace DOM Reference< XElement > aElement(aNode, UNO_QUERY); OUString aRefName; - const OUString& aPrefix = aElement->getPrefix(); + const OUString aPrefix = aElement->getPrefix(); if (!aPrefix.isEmpty()) aRefName = aPrefix + SvXMLImport::aNamespaceSeparator + aElement->getTagName(); else diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index fb3d6ce31120..6d280ebd0a82 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -656,7 +656,7 @@ UUIInteractionHelper::handlePasswordRequest( // parameters to be filled for the call to handlePasswordRequest_ uno::Reference xParent = getParentXWindow(); task::PasswordRequestMode nMode = task::PasswordRequestMode_PASSWORD_ENTER; - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations = rRequest->getContinuations(); + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const aContinuations = rRequest->getContinuations(); OUString aDocumentName; sal_uInt16 nMaxPasswordLen = 0; // any length bool bIsPasswordToModify = false; @@ -715,7 +715,7 @@ UUIInteractionHelper::handlePasswordRequest( if (bDoHandleRequest) { - handlePasswordRequest_( Application::GetFrameWeld(xParent), nMode, rContinuations, + handlePasswordRequest_( Application::GetFrameWeld(xParent), nMode, aContinuations, aDocumentName, nMaxPasswordLen, bIsPasswordToModify ); return true; }