summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-26 09:30:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-26 10:31:44 +0200
commit24c709655e5c1ca51c6c6da7ef0cb733354f6d20 (patch)
tree7362d7aa63becf1b45b049c8d764ec42f466a091 /comphelper
parent85e477cd08aae47cd3a69a561ca333e3e1e19a0e (diff)
clang-tidy modernize-pass-by-value in comphelper
Change-Id: I29074d801eaef57f160ce14b943b21831b327ecf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134979 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/container/container.cxx5
-rw-r--r--comphelper/source/container/enumhelper.cxx15
-rw-r--r--comphelper/source/eventattachermgr/eventattachermgr.cxx13
-rw-r--r--comphelper/source/misc/backupfilehelper.cxx9
-rw-r--r--comphelper/source/misc/instancelocker.cxx13
-rw-r--r--comphelper/source/misc/instancelocker.hxx6
-rw-r--r--comphelper/source/misc/interaction.cxx9
-rw-r--r--comphelper/source/misc/mimeconfighelper.cxx5
-rw-r--r--comphelper/source/misc/officerestartmanager.hxx5
-rw-r--r--comphelper/source/misc/stillreadwriteinteraction.cxx5
-rw-r--r--comphelper/source/misc/string.cxx3
-rw-r--r--comphelper/source/misc/threadpool.cxx5
-rw-r--r--comphelper/source/officeinstdir/officeinstallationdirectories.cxx5
-rw-r--r--comphelper/source/officeinstdir/officeinstallationdirectories.hxx2
-rw-r--r--comphelper/source/property/propertycontainerhelper.cxx3
-rw-r--r--comphelper/source/property/propertysethelper.cxx5
-rw-r--r--comphelper/source/streaming/seekableinput.cxx9
17 files changed, 66 insertions, 51 deletions
diff --git a/comphelper/source/container/container.cxx b/comphelper/source/container/container.cxx
index 1a6132e0d65a..7b2432723360 100644
--- a/comphelper/source/container/container.cxx
+++ b/comphelper/source/container/container.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/container/XChild.hpp>
#include <comphelper/container.hxx>
#include <o3tl/any.hxx>
+#include <utility>
#include <osl/diagnose.h>
@@ -29,8 +30,8 @@ namespace comphelper
{
-IndexAccessIterator::IndexAccessIterator(css::uno::Reference< css::uno::XInterface> const & xStartingPoint)
- :m_xStartingPoint(xStartingPoint)
+IndexAccessIterator::IndexAccessIterator(css::uno::Reference< css::uno::XInterface> xStartingPoint)
+ :m_xStartingPoint(std::move(xStartingPoint))
{
OSL_ENSURE(m_xStartingPoint.is(), "IndexAccessIterator::IndexAccessIterator : no starting point !");
}
diff --git a/comphelper/source/container/enumhelper.cxx b/comphelper/source/container/enumhelper.cxx
index b5fe864c8820..bc9ae43e44ad 100644
--- a/comphelper/source/container/enumhelper.cxx
+++ b/comphelper/source/container/enumhelper.cxx
@@ -21,13 +21,14 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
+#include <utility>
namespace comphelper
{
-OEnumerationByName::OEnumerationByName(const css::uno::Reference<css::container::XNameAccess>& _rxAccess)
- :m_aNames(_rxAccess->getElementNames())
- ,m_xAccess(_rxAccess)
+OEnumerationByName::OEnumerationByName(css::uno::Reference<css::container::XNameAccess> _xAccess)
+ :m_aNames(_xAccess->getElementNames())
+ ,m_xAccess(_xAccess)
,m_nPos(0)
,m_bListening(false)
{
@@ -35,10 +36,10 @@ OEnumerationByName::OEnumerationByName(const css::uno::Reference<css::container:
}
-OEnumerationByName::OEnumerationByName(const css::uno::Reference<css::container::XNameAccess>& _rxAccess,
+OEnumerationByName::OEnumerationByName(const css::uno::Reference<css::container::XNameAccess> _xAccess,
std::vector<OUString> _aNames )
:m_aNames(std::move(_aNames))
- ,m_xAccess(_rxAccess)
+ ,m_xAccess(std::move(_xAccess))
,m_nPos(0)
,m_bListening(false)
{
@@ -147,8 +148,8 @@ const OUString& OEnumerationByName::getElement(sal_Int32 nIndex) const
}
-OEnumerationByIndex::OEnumerationByIndex(const css::uno::Reference< css::container::XIndexAccess >& _rxAccess)
- :m_xAccess(_rxAccess)
+OEnumerationByIndex::OEnumerationByIndex(css::uno::Reference< css::container::XIndexAccess > _xAccess)
+ :m_xAccess(std::move(_xAccess))
,m_nPos(0)
,m_bListening(false)
{
diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx
index a08c6cf4777a..1c9f1a23cdc6 100644
--- a/comphelper/source/eventattachermgr/eventattachermgr.cxx
+++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx
@@ -49,6 +49,7 @@
#include <deque>
#include <algorithm>
+#include <utility>
using namespace com::sun::star::uno;
using namespace com::sun::star::io;
@@ -140,8 +141,8 @@ class AttacherAllListener_Impl : public WeakImplHelper< XAllListener >
/// @throws CannotConvertException
void convertToEventReturn( Any & rRet, const Type & rRetType );
public:
- AttacherAllListener_Impl( ImplEventAttacherManager* pManager_, const OUString &rScriptType_,
- const OUString & rScriptCode_ );
+ AttacherAllListener_Impl( ImplEventAttacherManager* pManager_, OUString aScriptType_,
+ OUString aScriptCode_ );
// Methods of XAllListener
virtual void SAL_CALL firing(const AllEventObject& Event) override;
@@ -156,12 +157,12 @@ public:
AttacherAllListener_Impl::AttacherAllListener_Impl
(
ImplEventAttacherManager* pManager_,
- const OUString & rScriptType_,
- const OUString & rScriptCode_
+ OUString aScriptType_,
+ OUString aScriptCode_
)
: mxManager( pManager_ )
- , aScriptType( rScriptType_ )
- , aScriptCode( rScriptCode_ )
+ , aScriptType(std::move( aScriptType_ ))
+ , aScriptCode(std::move( aScriptCode_ ))
{
}
diff --git a/comphelper/source/misc/backupfilehelper.cxx b/comphelper/source/misc/backupfilehelper.cxx
index 22bd5c5a851f..d225b9f301d9 100644
--- a/comphelper/source/misc/backupfilehelper.cxx
+++ b/comphelper/source/misc/backupfilehelper.cxx
@@ -19,6 +19,7 @@
#include <deque>
#include <memory>
#include <string_view>
+#include <utility>
#include <vector>
#include <zlib.h>
@@ -221,8 +222,8 @@ namespace
{
}
- ExtensionInfoEntry(const OString& rName, bool bEnabled)
- : maName(rName),
+ ExtensionInfoEntry(OString aName, bool bEnabled)
+ : maName(std::move(aName)),
maRepository(USER),
mbEnabled(bEnabled)
{
@@ -995,13 +996,13 @@ namespace
PackedFileEntry(
sal_uInt32 nFullFileSize,
sal_uInt32 nCrc32,
- FileSharedPtr const & rFile,
+ FileSharedPtr xFile,
bool bDoCompress)
: mnFullFileSize(nFullFileSize),
mnPackFileSize(nFullFileSize),
mnOffset(0),
mnCrc32(nCrc32),
- maFile(rFile),
+ maFile(std::move(xFile)),
mbDoCompress(bDoCompress)
{
}
diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx
index 2b1e89604e6a..84c8054ecbb8 100644
--- a/comphelper/source/misc/instancelocker.cxx
+++ b/comphelper/source/misc/instancelocker.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/frame/DoubleInitializationException.hpp>
#include <com/sun/star/embed/Actions.hpp>
#include <com/sun/star/embed/XActionsApproval.hpp>
+#include <utility>
#include "instancelocker.hxx"
@@ -188,13 +189,13 @@ uno::Sequence< OUString > SAL_CALL OInstanceLocker::getSupportedServiceNames()
// OLockListener
-OLockListener::OLockListener( const uno::WeakReference< lang::XComponent >& xWrapper,
- const uno::Reference< uno::XInterface >& xInstance,
+OLockListener::OLockListener( uno::WeakReference< lang::XComponent > xWrapper,
+ uno::Reference< uno::XInterface > xInstance,
sal_Int32 nMode,
- const uno::Reference< embed::XActionsApproval >& rApproval )
-: m_xInstance( xInstance )
-, m_xApproval( rApproval )
-, m_xWrapper( xWrapper )
+ uno::Reference< embed::XActionsApproval > xApproval )
+: m_xInstance(std::move( xInstance ))
+, m_xApproval(std::move( xApproval ))
+, m_xWrapper(std::move( xWrapper ))
, m_bDisposed( false )
, m_bInitialized( false )
, m_nMode( nMode )
diff --git a/comphelper/source/misc/instancelocker.hxx b/comphelper/source/misc/instancelocker.hxx
index 7391c5d7d365..6a050c7f437c 100644
--- a/comphelper/source/misc/instancelocker.hxx
+++ b/comphelper/source/misc/instancelocker.hxx
@@ -85,10 +85,10 @@ class OLockListener : public ::cppu::WeakImplHelper< css::util::XCloseListener,
sal_Int32 m_nMode;
public:
- OLockListener( const css::uno::WeakReference< css::lang::XComponent >& xWrapper,
- const css::uno::Reference< css::uno::XInterface >& xInstance,
+ OLockListener( css::uno::WeakReference< css::lang::XComponent > xWrapper,
+ css::uno::Reference< css::uno::XInterface > xInstance,
sal_Int32 nMode,
- const css::uno::Reference< css::embed::XActionsApproval >& rApproval );
+ css::uno::Reference< css::embed::XActionsApproval > xApproval );
virtual ~OLockListener() override;
diff --git a/comphelper/source/misc/interaction.cxx b/comphelper/source/misc/interaction.cxx
index e1fd64d9b04b..9e7b1706d111 100644
--- a/comphelper/source/misc/interaction.cxx
+++ b/comphelper/source/misc/interaction.cxx
@@ -20,6 +20,7 @@
#include <comphelper/interaction.hxx>
#include <comphelper/sequence.hxx>
+#include <utility>
#include <osl/diagnose.h>
@@ -30,14 +31,14 @@ namespace comphelper
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::task;
- OInteractionRequest::OInteractionRequest(const Any& _rRequestDescription)
- :m_aRequest(_rRequestDescription)
+ OInteractionRequest::OInteractionRequest(Any _aRequestDescription)
+ :m_aRequest(std::move(_aRequestDescription))
{
}
- OInteractionRequest::OInteractionRequest(const Any& rRequestDescription,
+ OInteractionRequest::OInteractionRequest(Any aRequestDescription,
std::vector<Reference<XInteractionContinuation>>&& rContinuations)
- : m_aRequest(rRequestDescription)
+ : m_aRequest(std::move(aRequestDescription))
, m_aContinuations(std::move(rContinuations))
{
}
diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx
index 3b234b6591ae..7f402b6351ec 100644
--- a/comphelper/source/misc/mimeconfighelper.cxx
+++ b/comphelper/source/misc/mimeconfighelper.cxx
@@ -33,14 +33,15 @@
#include <comphelper/documentconstants.hxx>
#include <comphelper/propertysequence.hxx>
#include <rtl/ustrbuf.hxx>
+#include <utility>
using namespace ::com::sun::star;
using namespace comphelper;
-MimeConfigurationHelper::MimeConfigurationHelper( const uno::Reference< uno::XComponentContext >& rxContext )
-: m_xContext( rxContext )
+MimeConfigurationHelper::MimeConfigurationHelper( uno::Reference< uno::XComponentContext > xContext )
+: m_xContext(std::move( xContext ))
{
if ( !m_xContext.is() )
throw uno::RuntimeException();
diff --git a/comphelper/source/misc/officerestartmanager.hxx b/comphelper/source/misc/officerestartmanager.hxx
index 8b3658a8e892..bc95668b9399 100644
--- a/comphelper/source/misc/officerestartmanager.hxx
+++ b/comphelper/source/misc/officerestartmanager.hxx
@@ -26,6 +26,7 @@
#include <osl/mutex.hxx>
#include <cppuhelper/implbase.hxx>
+#include <utility>
namespace comphelper
{
@@ -41,8 +42,8 @@ class OOfficeRestartManager : public ::cppu::WeakImplHelper< css::task::XRestart
bool m_bRestartRequested;
public:
- explicit OOfficeRestartManager( const css::uno::Reference< css::uno::XComponentContext >& xContext )
- : m_xContext( xContext )
+ explicit OOfficeRestartManager( css::uno::Reference< css::uno::XComponentContext > xContext )
+ : m_xContext(std::move( xContext ))
, m_bOfficeInitialized( false )
, m_bRestartRequested( false )
{}
diff --git a/comphelper/source/misc/stillreadwriteinteraction.cxx b/comphelper/source/misc/stillreadwriteinteraction.cxx
index 7bf48b2d97b2..88bc25bc46cb 100644
--- a/comphelper/source/misc/stillreadwriteinteraction.cxx
+++ b/comphelper/source/misc/stillreadwriteinteraction.cxx
@@ -30,14 +30,15 @@
#include <com/sun/star/ucb/AuthenticationRequest.hpp>
#include <com/sun/star/ucb/CertificateValidationRequest.hpp>
+#include <utility>
namespace comphelper{
StillReadWriteInteraction::StillReadWriteInteraction(const css::uno::Reference< css::task::XInteractionHandler >& xHandler,
- const css::uno::Reference< css::task::XInteractionHandler >& xAuxiliaryHandler)
+ css::uno::Reference< css::task::XInteractionHandler > xAuxiliaryHandler)
: m_bUsed (false)
, m_bHandledByMySelf (false)
- , m_xAuxiliaryHandler(xAuxiliaryHandler)
+ , m_xAuxiliaryHandler(std::move(xAuxiliaryHandler))
{
std::vector< ::ucbhelper::InterceptedInteraction::InterceptedRequest > lInterceptions;
lInterceptions.reserve(4);
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx
index 0041f53d153d..979964f17552 100644
--- a/comphelper/source/misc/string.cxx
+++ b/comphelper/source/misc/string.cxx
@@ -21,6 +21,7 @@
#include <cstddef>
#include <string_view>
+#include <utility>
#include <vector>
#include <algorithm>
@@ -495,7 +496,7 @@ sal_Int32 compareNatural( const OUString & rLHS, const OUString & rRHS,
NaturalStringSorter::NaturalStringSorter(
const uno::Reference< uno::XComponentContext > &rContext,
- const lang::Locale &rLocale) : m_aLocale(rLocale)
+ lang::Locale aLocale) : m_aLocale(std::move(aLocale))
{
m_xCollator = i18n::Collator::create( rContext );
m_xCollator->loadDefaultCollator(m_aLocale, 0);
diff --git a/comphelper/source/misc/threadpool.cxx b/comphelper/source/misc/threadpool.cxx
index 48ff4af2d7c6..00fee7d8eb59 100644
--- a/comphelper/source/misc/threadpool.cxx
+++ b/comphelper/source/misc/threadpool.cxx
@@ -19,6 +19,7 @@
#include <thread>
#include <chrono>
#include <comphelper/debuggerinfo.hxx>
+#include <utility>
#if defined HAVE_VALGRIND_HEADERS
#include <valgrind/memcheck.h>
@@ -304,8 +305,8 @@ bool ThreadPool::isTaskTagDone(const std::shared_ptr<ThreadTaskTag>& pTag)
return pTag->isDone();
}
-ThreadTask::ThreadTask(const std::shared_ptr<ThreadTaskTag>& pTag)
- : mpTag(pTag)
+ThreadTask::ThreadTask(std::shared_ptr<ThreadTaskTag> xTag)
+ : mpTag(std::move(xTag))
{
}
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
index fb0359a748f7..4cb3eb5e3702 100644
--- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
+++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
@@ -30,6 +30,7 @@
#include <osl/file.hxx>
#include <com/sun/star/util/theMacroExpander.hpp>
#include <comphelper/fileurl.hxx>
+#include <utility>
#include "officeinstallationdirectories.hxx"
@@ -78,8 +79,8 @@ constexpr OUStringLiteral g_aOfficeBrandDirMacro(u"$(brandbaseurl)");
constexpr OUStringLiteral g_aUserDirMacro(u"$(userdataurl)");
OfficeInstallationDirectories::OfficeInstallationDirectories(
- const uno::Reference< uno::XComponentContext > & xCtx )
-: m_xCtx( xCtx )
+ uno::Reference< uno::XComponentContext > xCtx )
+: m_xCtx(std::move( xCtx ))
{
}
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx
index f3546831f408..cc0881c236fd 100644
--- a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx
+++ b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx
@@ -41,7 +41,7 @@ class OfficeInstallationDirectories : public cppu::BaseMutex, public UnoImplBase
{
public:
explicit OfficeInstallationDirectories(
- const css::uno::Reference< css::uno::XComponentContext > & xCtx );
+ css::uno::Reference< css::uno::XComponentContext > xCtx );
virtual ~OfficeInstallationDirectories() override;
// XOfficeInstallationDirectories
diff --git a/comphelper/source/property/propertycontainerhelper.cxx b/comphelper/source/property/propertycontainerhelper.cxx
index 5fd6053ce100..7ff224bec741 100644
--- a/comphelper/source/property/propertycontainerhelper.cxx
+++ b/comphelper/source/property/propertycontainerhelper.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/beans/UnknownPropertyException.hpp>
#include <algorithm>
+#include <utility>
namespace comphelper
@@ -51,7 +52,7 @@ namespace
struct PropertyDescriptionNameMatch
{
OUString const m_rCompare;
- explicit PropertyDescriptionNameMatch( const OUString& _rCompare ) : m_rCompare( _rCompare ) { }
+ explicit PropertyDescriptionNameMatch( OUString _aCompare ) : m_rCompare(std::move( _aCompare )) { }
bool operator() (const PropertyDescription& x ) const
{
diff --git a/comphelper/source/property/propertysethelper.cxx b/comphelper/source/property/propertysethelper.cxx
index 1568aca9b49d..519b0705fadd 100644
--- a/comphelper/source/property/propertysethelper.cxx
+++ b/comphelper/source/property/propertysethelper.cxx
@@ -23,6 +23,7 @@
#include <rtl/ref.hxx>
#include <memory>
+#include <utility>
using namespace ::comphelper;
using namespace ::com::sun::star;
@@ -41,8 +42,8 @@ static PropertyMapEntry const * find( const rtl::Reference<PropertySetInfo>& mxI
}
-PropertySetHelper::PropertySetHelper( rtl::Reference<comphelper::PropertySetInfo> const & xInfo ) noexcept
- : mxInfo(xInfo)
+PropertySetHelper::PropertySetHelper( rtl::Reference<comphelper::PropertySetInfo> xInfo ) noexcept
+ : mxInfo(std::move(xInfo))
{
}
diff --git a/comphelper/source/streaming/seekableinput.cxx b/comphelper/source/streaming/seekableinput.cxx
index bd30aa354620..3508f933ee26 100644
--- a/comphelper/source/streaming/seekableinput.cxx
+++ b/comphelper/source/streaming/seekableinput.cxx
@@ -26,6 +26,7 @@
#include <comphelper/seekableinput.hxx>
+#include <utility>
using namespace ::com::sun::star;
@@ -57,10 +58,10 @@ static void copyInputToOutput_Impl( const uno::Reference< io::XInputStream >& xI
OSeekableInputWrapper::OSeekableInputWrapper(
- const uno::Reference< io::XInputStream >& xInStream,
- const uno::Reference< uno::XComponentContext >& rxContext )
-: m_xContext( rxContext )
-, m_xOriginalStream( xInStream )
+ uno::Reference< io::XInputStream > xInStream,
+ uno::Reference< uno::XComponentContext > xContext )
+: m_xContext(std::move( xContext ))
+, m_xOriginalStream(std::move( xInStream ))
{
if ( !m_xContext.is() )
throw uno::RuntimeException();