diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-30 14:59:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-30 19:16:45 +0200 |
commit | 7b87afa899be289306c709d35eb1d32c0b73b1ed (patch) | |
tree | 7faf699a2e22c770ccac90cc38262a284946d9c7 /unotools | |
parent | f3df14cc4343ce65608436acfa67b2ccfb68115d (diff) |
clang-tidy modernize-pass-by-value in unotools
Change-Id: Ifa67ab7198f5d3b06171869f57703acdaa959f7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135128
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/configitem.cxx | 5 | ||||
-rw-r--r-- | unotools/source/config/configvaluecontainer.cxx | 7 | ||||
-rw-r--r-- | unotools/source/config/viewoptions.cxx | 5 | ||||
-rw-r--r-- | unotools/source/i18n/charclass.cxx | 9 | ||||
-rw-r--r-- | unotools/source/i18n/intlwrapper.cxx | 6 | ||||
-rw-r--r-- | unotools/source/i18n/localedatawrapper.cxx | 9 | ||||
-rw-r--r-- | unotools/source/misc/ServiceDocumenter.hxx | 5 | ||||
-rw-r--r-- | unotools/source/ucbhelper/progresshandlerwrap.cxx | 5 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.cxx | 11 |
9 files changed, 35 insertions, 27 deletions
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index 2632a79fb3b7..90da75c043eb 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -49,6 +49,7 @@ using namespace com::sun::star::container; using namespace com::sun::star::configuration; #include <cppuhelper/implbase.hxx> +#include <utility> /* The ConfigChangeListener_Impl receives notifications from the configuration about changes that @@ -137,8 +138,8 @@ void ConfigChangeListener_Impl::disposing( const EventObject& /*rSource*/ ) pParent->RemoveChangesListener(); } -ConfigItem::ConfigItem(const OUString &rSubTree, ConfigItemMode nSetMode ) : - sSubTree(rSubTree), +ConfigItem::ConfigItem(OUString aSubTree, ConfigItemMode nSetMode ) : + sSubTree(std::move(aSubTree)), m_nMode(nSetMode), m_bIsModified(false), m_bEnableInternalNotification(false), diff --git a/unotools/source/config/configvaluecontainer.cxx b/unotools/source/config/configvaluecontainer.cxx index 6fc60d753113..10abeaf12896 100644 --- a/unotools/source/config/configvaluecontainer.cxx +++ b/unotools/source/config/configvaluecontainer.cxx @@ -24,6 +24,7 @@ #include <unotools/confignode.hxx> #include <uno/data.h> #include <algorithm> +#include <utility> #include <vector> namespace utl @@ -53,7 +54,7 @@ namespace utl Type aDataType; // the type object pointed to by pLocation public: - explicit NodeValueAccessor( const OUString& _rNodePath ); + explicit NodeValueAccessor( OUString _aNodePath ); void bind( void* _pLocation, const Type& _rType ); @@ -66,8 +67,8 @@ namespace utl bool operator == ( const NodeValueAccessor& rhs ) const; }; - NodeValueAccessor::NodeValueAccessor( const OUString& _rNodePath ) - :sRelativePath( _rNodePath ) + NodeValueAccessor::NodeValueAccessor( OUString _aNodePath ) + :sRelativePath(std::move( _aNodePath )) ,eLocationType( LocationType::Unbound ) ,pLocation( nullptr ) { diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx index c94e683c08d0..173ccdc10f66 100644 --- a/unotools/source/config/viewoptions.cxx +++ b/unotools/source/config/viewoptions.cxx @@ -27,6 +27,7 @@ #include <unotools/configmgr.hxx> #include <comphelper/configurationhelper.hxx> #include <comphelper/processfactory.hxx> +#include <utility> #include <tools/diagnose_ex.h> constexpr OUStringLiteral PACKAGE_VIEWS = u"org.openoffice.Office.Views"; @@ -36,9 +37,9 @@ constexpr OUStringLiteral PROPERTY_VISIBLE = u"Visible"; constexpr OUStringLiteral PROPERTY_USERDATA = u"UserData"; -SvtViewOptions::SvtViewOptions( EViewType eType, const OUString& sViewName ) +SvtViewOptions::SvtViewOptions( EViewType eType, OUString sViewName ) : m_eViewType ( eType ) - , m_sViewName ( sViewName ) + , m_sViewName (std::move( sViewName )) { (void)m_eViewType; // so the release build does not complain, since we only use it in assert // we must know, which view type we must support diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx index 05bc2dd6bf48..b577d2577884 100644 --- a/unotools/source/i18n/charclass.cxx +++ b/unotools/source/i18n/charclass.cxx @@ -23,6 +23,7 @@ #include <tools/diagnose_ex.h> #include <com/sun/star/i18n/CharacterClassification.hpp> +#include <utility> using namespace ::com::sun::star; using namespace ::com::sun::star::i18n; @@ -30,15 +31,15 @@ using namespace ::com::sun::star::uno; CharClass::CharClass( const Reference< uno::XComponentContext > & rxContext, - const LanguageTag& rLanguageTag + LanguageTag aLanguageTag ) - : maLanguageTag( rLanguageTag) + : maLanguageTag(std::move( aLanguageTag)) { xCC = CharacterClassification::create( rxContext ); } -CharClass::CharClass( const LanguageTag& rLanguageTag ) - : maLanguageTag( rLanguageTag) +CharClass::CharClass( LanguageTag aLanguageTag ) + : maLanguageTag(std::move( aLanguageTag)) { xCC = CharacterClassification::create( comphelper::getProcessComponentContext() ); } diff --git a/unotools/source/i18n/intlwrapper.cxx b/unotools/source/i18n/intlwrapper.cxx index f15869fb6255..a4c21ea940aa 100644 --- a/unotools/source/i18n/intlwrapper.cxx +++ b/unotools/source/i18n/intlwrapper.cxx @@ -22,11 +22,11 @@ #include <unotools/localedatawrapper.hxx> #include <com/sun/star/i18n/CollatorOptions.hpp> #include <comphelper/processfactory.hxx> +#include <utility> -IntlWrapper::IntlWrapper( - const LanguageTag& rLanguageTag ) +IntlWrapper::IntlWrapper( LanguageTag aLanguageTag ) : - maLanguageTag( rLanguageTag ), + maLanguageTag(std::move( aLanguageTag )), m_xContext( comphelper::getProcessComponentContext() ) { } diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index 469457986f56..55cde4a360a4 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -42,6 +42,7 @@ #include <tools/date.hxx> #include <tools/time.hxx> #include <o3tl/string_view.hxx> +#include <utility> const sal_uInt16 nCurrFormatDefault = 0; @@ -59,25 +60,25 @@ sal_uInt8 LocaleDataWrapper::nLocaleDataChecking = 0; LocaleDataWrapper::LocaleDataWrapper( const Reference< uno::XComponentContext > & rxContext, - const LanguageTag& rLanguageTag + LanguageTag aLanguageTag ) : m_xContext( rxContext ), xLD( LocaleData2::create(rxContext) ), - maLanguageTag( rLanguageTag ) + maLanguageTag(std::move( aLanguageTag )) { loadData(); loadDateAcceptancePatterns({}); } LocaleDataWrapper::LocaleDataWrapper( - const LanguageTag& rLanguageTag, + LanguageTag aLanguageTag, const std::vector<OUString> & rOverrideDateAcceptancePatterns ) : m_xContext( comphelper::getProcessComponentContext() ), xLD( LocaleData2::create(m_xContext) ), - maLanguageTag( rLanguageTag ) + maLanguageTag(std::move( aLanguageTag )) { loadData(); loadDateAcceptancePatterns(rOverrideDateAcceptancePatterns); diff --git a/unotools/source/misc/ServiceDocumenter.hxx b/unotools/source/misc/ServiceDocumenter.hxx index 9cef2bf01172..0c94b5ac7e83 100644 --- a/unotools/source/misc/ServiceDocumenter.hxx +++ b/unotools/source/misc/ServiceDocumenter.hxx @@ -11,6 +11,7 @@ #include <cppuhelper/implbase.hxx> #include <com/sun/star/script/XServiceDocumenter.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <utility> namespace com::sun::star::uno { class XComponentContext; } @@ -20,8 +21,8 @@ class ServiceDocumenter : public ::cppu::WeakImplHelper< css::script::XServiceDocumenter, css::lang::XServiceInfo> { public: - ServiceDocumenter(css::uno::Reference< css::uno::XComponentContext> const& xContext) - : m_xContext(xContext) + ServiceDocumenter(css::uno::Reference< css::uno::XComponentContext> xContext) + : m_xContext(std::move(xContext)) , m_sCoreBaseUrl("http://example.com") , m_sServiceBaseUrl("https://api.libreoffice.org/docs/idl/ref") {}; diff --git a/unotools/source/ucbhelper/progresshandlerwrap.cxx b/unotools/source/ucbhelper/progresshandlerwrap.cxx index 0934633836a6..29c1067ec7fc 100644 --- a/unotools/source/ucbhelper/progresshandlerwrap.cxx +++ b/unotools/source/ucbhelper/progresshandlerwrap.cxx @@ -19,6 +19,7 @@ #include <unotools/progresshandlerwrap.hxx> #include <com/sun/star/task/XStatusIndicator.hpp> +#include <utility> namespace utl { @@ -27,8 +28,8 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::task; using namespace ::com::sun::star::ucb; -ProgressHandlerWrap::ProgressHandlerWrap( css::uno::Reference< css::task::XStatusIndicator > const & xSI ) -: m_xStatusIndicator( xSI ) +ProgressHandlerWrap::ProgressHandlerWrap( css::uno::Reference< css::task::XStatusIndicator > xSI ) +: m_xStatusIndicator(std::move( xSI )) { } diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index 9cbee8ef6b95..ad116eff294f 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -60,6 +60,7 @@ #include <comphelper/storagehelper.hxx> #include <ucbhelper/content.hxx> #include <mutex> +#include <utility> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::io; @@ -156,8 +157,8 @@ class UcbPropertiesChangeListener_Impl : public ::cppu::WeakImplHelper< XPropert public: UcbLockBytesRef m_xLockBytes; - explicit UcbPropertiesChangeListener_Impl( UcbLockBytesRef const & rRef ) - : m_xLockBytes( rRef ) + explicit UcbPropertiesChangeListener_Impl( UcbLockBytesRef xRef ) + : m_xLockBytes(std::move( xRef )) {} virtual void SAL_CALL disposing ( const EventObject &/*rEvent*/) override {} @@ -193,7 +194,7 @@ public: Moderator( Reference < XContent > const & xContent, Reference < XInteractionHandler > const & xInteract, - const Command& rArg + Command aArg ); enum class ResultType { @@ -419,14 +420,14 @@ ModeratorsInteractionHandler::handle( Moderator::Moderator( Reference < XContent > const & xContent, Reference < XInteractionHandler > const & xInteract, - const Command& rArg + Command aArg ) : m_aRes(m_aMutex,*this), m_aResultType(ResultType::NORESULT), m_nIOErrorCode(IOErrorCode_ABORT), m_aRep(m_aMutex,*this), m_aReplyType(NOREPLY), - m_aArg(rArg), + m_aArg(std::move(aArg)), m_aContent( xContent, new UcbTaskEnvironment( |