toolkit/source/controls/accessiblecontrolcontext.cxx | 5 ++--- ucb/source/core/ucbstore.cxx | 4 ++-- ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx | 2 +- ucb/source/ucp/webdav-curl/webdavcontent.cxx | 6 +++--- unotools/source/config/configitem.cxx | 2 +- vbahelper/source/msforms/vbacombobox.cxx | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-)
New commits: commit 8393267c651d0a3071472a8d6ad9861ed75af38b Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Nov 11 22:06:27 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Nov 12 09:03:21 2024 +0100 clang-tidy: performance-unnecessary-copy-initialization in various Change-Id: I1033c33a6b4bf06e365ce183b1a73c98bea777ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176442 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/toolkit/source/controls/accessiblecontrolcontext.cxx b/toolkit/source/controls/accessiblecontrolcontext.cxx index 6739377238ed..e3a81d3a954e 100644 --- a/toolkit/source/controls/accessiblecontrolcontext.cxx +++ b/toolkit/source/controls/accessiblecontrolcontext.cxx @@ -199,9 +199,8 @@ namespace toolkit if ( !m_xModelPropsInfo.is() && m_xControlModel.is() ) m_xModelPropsInfo = m_xControlModel->getPropertySetInfo(); - OUString sPropertyName( _pPropertyName ); - if ( m_xModelPropsInfo.is() && m_xModelPropsInfo->hasPropertyByName( sPropertyName ) ) - m_xControlModel->getPropertyValue( sPropertyName ) >>= sReturn; + if ( m_xModelPropsInfo.is() && m_xModelPropsInfo->hasPropertyByName( _pPropertyName ) ) + m_xControlModel->getPropertyValue( _pPropertyName ) >>= sReturn; } catch( const Exception& ) { diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index fd5da4202ab5..145ba022ffd4 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -1669,7 +1669,7 @@ Sequence< PropertyValue > SAL_CALL PersistentPropertySet::getPropertyValues() for ( sal_Int32 n = 0; n < nCount; ++n ) { PropertyValue& rValue = pValues[ n ]; - OUString rName = aElems[ n ]; + const OUString& rName = aElems[ n ]; OUString aXMLName = makeHierarchalNameSegment( rName ); @@ -1982,7 +1982,7 @@ Sequence< Property > SAL_CALL PropertySetInfo_Impl::getProperties() for ( sal_uInt32 n = 0; n < nCount; ++n ) { Property& rProp = pProps[ n ]; - OUString rName = aElems[ n ]; + const OUString& rName = aElems[ n ]; OUString aXMLName = makeHierarchalNameSegment( rName ); diff --git a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx index bc127791d674..6640df2b963e 100644 --- a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx @@ -1120,7 +1120,7 @@ void DAVResourceAccess::resetUri() { auto const it = m_aRedirectURIs.begin(); - CurlUri const aUri( *it ); + CurlUri const& aUri( *it ); m_aRedirectURIs.clear(); setURL ( aUri.GetURI() ); initialize(); diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx index fc8a932b0cee..04fef2ec92de 100644 --- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx @@ -1378,7 +1378,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Only DAV resources support PROPFIND std::vector< OUString > aPropNames; - uno::Sequence< beans::Property > aProperties(rProperties); + const uno::Sequence< beans::Property >& aProperties(rProperties); if ( aProperties.getLength() > 0 ) ContentProperties::UCBNamesToDAVNames( @@ -2038,7 +2038,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( uno::Reference< ucb::XContentIdentifier > xNewId = new ::ucbhelper::ContentIdentifier( aNewURL ); - uno::Reference< ucb::XContentIdentifier > xOldId = xIdentifier; + const uno::Reference< ucb::XContentIdentifier >& xOldId = xIdentifier; try { @@ -3913,7 +3913,7 @@ Content::ResourceType Content::getResourceType( { // extract host name and connection port CurlUri theUri( rResAccess->getURL() ); - OUString aHostName = theUri.GetHost(); + const OUString& aHostName = theUri.GetHost(); sal_Int32 nPort = theUri.GetPort(); DAVException::ExceptionCode e{}; switch (aDAVOptions.getHttpResponseStatusCode()) diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index a083c22e2a4c..017f4b747d20 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -330,7 +330,7 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const css::uno::Sequence< OUS { try { - OUString sName = rNames[i]; + const OUString& sName = rNames[i]; OUString sPath; OUString sProperty; diff --git a/vbahelper/source/msforms/vbacombobox.cxx b/vbahelper/source/msforms/vbacombobox.cxx index 288adc27a92d..6da823948cfb 100644 --- a/vbahelper/source/msforms/vbacombobox.cxx +++ b/vbahelper/source/msforms/vbacombobox.cxx @@ -75,7 +75,7 @@ ScVbaComboBox::setListIndex( const uno::Any& _value ) m_xProps->getPropertyValue( u"StringItemList"_ustr ) >>= sItems; if( ( nIndex >= 0 ) && ( sItems.getLength() > nIndex ) ) { - OUString sText = sItems[ nIndex ]; + const OUString& sText = sItems[ nIndex ]; m_xProps->setPropertyValue( u"Text"_ustr, uno::Any( sText ) ); // fire the _Change event