diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-23 09:01:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-23 10:52:11 +0200 |
commit | be9a39488420b069ed5c7fd65347b2ff68883e62 (patch) | |
tree | a95bd53d5a9347c9e2e7b16efccba86ba6c1653b /configmgr | |
parent | 32c43ee75c094ffe3c34f7a713aa252479515ad0 (diff) |
clang-tidy modernize-pass-by-value in configmgr
Change-Id: If2e69c04e4d72ec6911fb435092275dbfffbf991
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134752
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'configmgr')
23 files changed, 75 insertions, 60 deletions
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index 86e6bdb72772..865d383002d3 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -21,6 +21,7 @@ #include <cassert> #include <cstdlib> +#include <utility> #include <vector> #include <com/sun/star/beans/Property.hpp> @@ -1924,8 +1925,8 @@ Access::ModifiedChild::ModifiedChild(): {} Access::ModifiedChild::ModifiedChild( - rtl::Reference< ChildAccess > const & theChild, bool theDirectlyModified): - child(theChild), directlyModified(theDirectlyModified) + rtl::Reference< ChildAccess > theChild, bool theDirectlyModified): + child(std::move(theChild)), directlyModified(theDirectlyModified) {} rtl::Reference< ChildAccess > Access::getModifiedChild( diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx index 811c63693835..51e43d5bcfcc 100644 --- a/configmgr/source/access.hxx +++ b/configmgr/source/access.hxx @@ -354,7 +354,7 @@ private: ModifiedChild(); ModifiedChild( - rtl::Reference< ChildAccess > const & theChild, + rtl::Reference< ChildAccess > theChild, bool theDirectlyModified); }; diff --git a/configmgr/source/broadcaster.cxx b/configmgr/source/broadcaster.cxx index 24b047e9d5a4..f1830ee81b13 100644 --- a/configmgr/source/broadcaster.cxx +++ b/configmgr/source/broadcaster.cxx @@ -35,6 +35,7 @@ #include <cppuhelper/exc_hlp.hxx> #include <rtl/ustrbuf.hxx> #include <rtl/ustring.hxx> +#include <utility> #include "broadcaster.hxx" @@ -183,8 +184,8 @@ void Broadcaster::send() { Broadcaster::DisposeNotification::DisposeNotification( css::uno::Reference< css::lang::XEventListener > const & theListener, - css::lang::EventObject const & theEvent): - listener(theListener), event(theEvent) + css::lang::EventObject theEvent): + listener(theListener), event(std::move(theEvent)) { assert(theListener.is()); } @@ -192,8 +193,8 @@ Broadcaster::DisposeNotification::DisposeNotification( Broadcaster::ContainerNotification::ContainerNotification( css::uno::Reference< css::container::XContainerListener > const & theListener, - css::container::ContainerEvent const & theEvent): - listener(theListener), event(theEvent) + css::container::ContainerEvent theEvent): + listener(theListener), event(std::move(theEvent)) { assert(theListener.is()); } @@ -201,8 +202,8 @@ Broadcaster::ContainerNotification::ContainerNotification( Broadcaster::PropertyChangeNotification::PropertyChangeNotification( css::uno::Reference< css::beans::XPropertyChangeListener > const & theListener, - css::beans::PropertyChangeEvent const & theEvent): - listener(theListener), event(theEvent) + css::beans::PropertyChangeEvent theEvent): + listener(theListener), event(std::move(theEvent)) { assert(theListener.is()); } @@ -218,8 +219,8 @@ Broadcaster::PropertiesChangeNotification::PropertiesChangeNotification( Broadcaster::ChangesNotification::ChangesNotification( css::uno::Reference< css::util::XChangesListener > const & theListener, - css::util::ChangesEvent const & theEvent): - listener(theListener), event(theEvent) + css::util::ChangesEvent theEvent): + listener(theListener), event(std::move(theEvent)) { assert(theListener.is()); } diff --git a/configmgr/source/broadcaster.hxx b/configmgr/source/broadcaster.hxx index 6c4943f5526e..d0c461e731d8 100644 --- a/configmgr/source/broadcaster.hxx +++ b/configmgr/source/broadcaster.hxx @@ -86,7 +86,7 @@ private: DisposeNotification( css::uno::Reference< css::lang::XEventListener > const & theListener, - css::lang::EventObject const & theEvent); + css::lang::EventObject theEvent); }; struct ContainerNotification { @@ -95,7 +95,7 @@ private: ContainerNotification( css::uno::Reference< css::container::XContainerListener > const & theListener, - css::container::ContainerEvent const & theEvent); + css::container::ContainerEvent theEvent); }; struct PropertyChangeNotification { @@ -104,7 +104,7 @@ private: PropertyChangeNotification( css::uno::Reference< css::beans::XPropertyChangeListener > const & theListener, - css::beans::PropertyChangeEvent const & theEvent); + css::beans::PropertyChangeEvent theEvent); }; struct PropertiesChangeNotification { @@ -122,7 +122,7 @@ private: ChangesNotification( css::uno::Reference< css::util::XChangesListener > const & theListener, - css::util::ChangesEvent const & theEvent); + css::util::ChangesEvent theEvent); }; std::vector< DisposeNotification > disposeNotifications_; diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx index 6010a5a5ce3b..60a11006bf7c 100644 --- a/configmgr/source/childaccess.cxx +++ b/configmgr/source/childaccess.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <cassert> +#include <utility> #include <vector> #include <com/sun/star/container/XChild.hpp> @@ -63,9 +64,9 @@ css::uno::Sequence< sal_Int8 > const & ChildAccess::getUnoTunnelId() ChildAccess::ChildAccess( Components & components, rtl::Reference< RootAccess > const & root, - rtl::Reference< Access > const & parent, OUString const & name, + rtl::Reference< Access > const & parent, OUString name, rtl::Reference< Node > const & node): - Access(components), root_(root), parent_(parent), name_(name), node_(node), + Access(components), root_(root), parent_(parent), name_(std::move(name)), node_(node), inTransaction_(false), lock_( lock() ) { diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx index dc7e47005d2f..3b7a5a5410aa 100644 --- a/configmgr/source/childaccess.hxx +++ b/configmgr/source/childaccess.hxx @@ -56,7 +56,7 @@ public: ChildAccess( Components & components, rtl::Reference< RootAccess > const & root, - rtl::Reference< Access > const & parent, OUString const & name, + rtl::Reference< Access > const & parent, OUString name, rtl::Reference< Node > const & node); ChildAccess( diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 57f9e30e185b..0693ec26bcc3 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -21,6 +21,7 @@ #include <cassert> #include <chrono> +#include <utility> #include <vector> #include <set> @@ -85,9 +86,9 @@ struct UnresolvedVectorItem { rtl::Reference< ParseManager > manager; UnresolvedVectorItem( - OUString const & theName, - rtl::Reference< ParseManager > const & theManager): - name(theName), manager(theManager) {} + OUString theName, + rtl::Reference< ParseManager > theManager): + name(std::move(theName)), manager(std::move(theManager)) {} }; typedef std::vector< UnresolvedVectorItem > UnresolvedVector; @@ -151,7 +152,7 @@ class Components::WriteThread: public salhelper::Thread { public: WriteThread( rtl::Reference< WriteThread > * reference, Components & components, - OUString const & url, Data const & data); + OUString url, Data const & data); void flush() { delay_.set(); } @@ -170,9 +171,9 @@ private: Components::WriteThread::WriteThread( rtl::Reference< WriteThread > * reference, Components & components, - OUString const & url, Data const & data): + OUString url, Data const & data): Thread("configmgrWriter"), reference_(reference), components_(components), - url_(url), data_(data), + url_(std::move(url)), data_(data), lock_( lock() ) { assert(reference != nullptr); diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx index f9936b6ba1a3..b8bdcb4262f2 100644 --- a/configmgr/source/configurationprovider.cxx +++ b/configmgr/source/configurationprovider.cxx @@ -49,6 +49,7 @@ #include <rtl/ustring.hxx> #include <i18nlangtag/languagetag.hxx> +#include <utility> #include "components.hxx" #include "configurationprovider.hxx" @@ -93,8 +94,8 @@ public: Service( const css::uno::Reference< css::uno::XComponentContext >& context, - OUString const & locale): - ServiceBase(m_aMutex), context_(context), locale_(locale), + OUString locale): + ServiceBase(m_aMutex), context_(context), locale_(std::move(locale)), default_(false), lock_( lock() ) { diff --git a/configmgr/source/configurationregistry.cxx b/configmgr/source/configurationregistry.cxx index 1301fcf134ce..b2fd214f3510 100644 --- a/configmgr/source/configurationregistry.cxx +++ b/configmgr/source/configurationregistry.cxx @@ -52,6 +52,7 @@ #include <cppuhelper/weak.hxx> #include <mutex> #include <rtl/ustring.hxx> +#include <utility> #include <sal/types.h> namespace com::sun::star::util { @@ -131,8 +132,8 @@ class RegistryKey: public cppu::WeakImplHelper< css::registry::XRegistryKey > { public: - RegistryKey(Service & service, css::uno::Any const & value): - service_(service), value_(value) {} + RegistryKey(Service & service, css::uno::Any value): + service_(service), value_(std::move(value)) {} private: RegistryKey(const RegistryKey&) = delete; diff --git a/configmgr/source/groupnode.cxx b/configmgr/source/groupnode.cxx index eab65427c252..00934e9171e8 100644 --- a/configmgr/source/groupnode.cxx +++ b/configmgr/source/groupnode.cxx @@ -21,6 +21,7 @@ #include <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <utility> #include "data.hxx" #include "groupnode.hxx" @@ -30,8 +31,8 @@ namespace configmgr { GroupNode::GroupNode( - int layer, bool extensible, OUString const & templateName): - Node(layer), extensible_(extensible), templateName_(templateName), + int layer, bool extensible, OUString templateName): + Node(layer), extensible_(extensible), templateName_(std::move(templateName)), mandatory_(Data::NO_LAYER) {} diff --git a/configmgr/source/groupnode.hxx b/configmgr/source/groupnode.hxx index 12e18b37bc90..961ecc090622 100644 --- a/configmgr/source/groupnode.hxx +++ b/configmgr/source/groupnode.hxx @@ -32,7 +32,7 @@ namespace configmgr class GroupNode : public Node { public: - GroupNode(int layer, bool extensible, OUString const& templateName); + GroupNode(int layer, bool extensible, OUString templateName); virtual rtl::Reference<Node> clone(bool keepTemplateName) const override; diff --git a/configmgr/source/localizedvaluenode.cxx b/configmgr/source/localizedvaluenode.cxx index 6404ff7a06a7..816975063d29 100644 --- a/configmgr/source/localizedvaluenode.cxx +++ b/configmgr/source/localizedvaluenode.cxx @@ -22,14 +22,15 @@ #include <com/sun/star/uno/Any.hxx> #include <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <utility> #include "localizedvaluenode.hxx" #include "node.hxx" namespace configmgr { -LocalizedValueNode::LocalizedValueNode(int layer, css::uno::Any const & value): - Node(layer), value_(value) +LocalizedValueNode::LocalizedValueNode(int layer, css::uno::Any value): + Node(layer), value_(std::move(value)) {} LocalizedValueNode::LocalizedValueNode(int layer): diff --git a/configmgr/source/localizedvaluenode.hxx b/configmgr/source/localizedvaluenode.hxx index 34fe2815365a..07949ac5a621 100644 --- a/configmgr/source/localizedvaluenode.hxx +++ b/configmgr/source/localizedvaluenode.hxx @@ -32,7 +32,7 @@ class LocalizedValueNode : public Node { public: explicit LocalizedValueNode(int layer); - LocalizedValueNode(int layer, css::uno::Any const& value); + LocalizedValueNode(int layer, css::uno::Any value); virtual rtl::Reference<Node> clone(bool keepTemplateName) const override; diff --git a/configmgr/source/propertynode.cxx b/configmgr/source/propertynode.cxx index 119bce5c9be3..351025a2ffb1 100644 --- a/configmgr/source/propertynode.cxx +++ b/configmgr/source/propertynode.cxx @@ -26,6 +26,7 @@ #include <rtl/ref.hxx> #include <rtl/ustring.hxx> #include <sal/log.hxx> +#include <utility> #include "components.hxx" #include "node.hxx" @@ -35,10 +36,10 @@ namespace configmgr { PropertyNode::PropertyNode( - int layer, Type staticType, bool nillable, css::uno::Any const & value, + int layer, Type staticType, bool nillable, css::uno::Any value, bool extension): Node(layer), staticType_(staticType), nillable_(nillable), - extension_(extension), value_(value) + extension_(extension), value_(std::move(value)) {} rtl::Reference< Node > PropertyNode::clone(bool) const { diff --git a/configmgr/source/propertynode.hxx b/configmgr/source/propertynode.hxx index 9a3f8f91e87e..108b8e944b2b 100644 --- a/configmgr/source/propertynode.hxx +++ b/configmgr/source/propertynode.hxx @@ -36,7 +36,7 @@ class PropertyNode: public Node { public: PropertyNode( int layer, Type staticType, bool nillable, - css::uno::Any const & value, bool extension); + css::uno::Any value, bool extension); virtual rtl::Reference< Node > clone(bool keepTemplateName) const override; diff --git a/configmgr/source/readonlyaccess.cxx b/configmgr/source/readonlyaccess.cxx index 286963c783a2..76ec606d5bc4 100644 --- a/configmgr/source/readonlyaccess.cxx +++ b/configmgr/source/readonlyaccess.cxx @@ -25,6 +25,7 @@ #include <osl/mutex.hxx> #include <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <utility> #include <sal/types.h> #include "components.hxx" @@ -42,8 +43,8 @@ class Service: { public: explicit Service( - css::uno::Reference< css::uno::XComponentContext > const & context): - context_(context) {} + css::uno::Reference< css::uno::XComponentContext > context): + context_(std::move(context)) {} private: Service(const Service&) = delete; diff --git a/configmgr/source/readwriteaccess.cxx b/configmgr/source/readwriteaccess.cxx index 292124ddec25..57e8b298a966 100644 --- a/configmgr/source/readwriteaccess.cxx +++ b/configmgr/source/readwriteaccess.cxx @@ -25,6 +25,7 @@ #include <osl/mutex.hxx> #include <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <utility> #include <sal/types.h> #include "components.hxx" @@ -42,8 +43,8 @@ class Service: { public: explicit Service( - css::uno::Reference< css::uno::XComponentContext > const & context): - context_(context) {} + css::uno::Reference< css::uno::XComponentContext > context): + context_(std::move(context)) {} private: Service(const Service&) = delete; diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx index 1043bd9bedab..ff7adddef2d5 100644 --- a/configmgr/source/rootaccess.cxx +++ b/configmgr/source/rootaccess.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <cassert> +#include <utility> #include <vector> #include <com/sun/star/lang/DisposedException.hpp> @@ -54,10 +55,10 @@ namespace configmgr { RootAccess::RootAccess( - Components & components, OUString const & pathRepresentation, - OUString const & locale, bool update): - Access(components), pathRepresentation_(pathRepresentation), - locale_(locale), + Components & components, OUString pathRepresentation, + OUString locale, bool update): + Access(components), pathRepresentation_(std::move(pathRepresentation)), + locale_(std::move(locale)), lock_( lock() ), update_(update), finalized_(false), alive_(true) { diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx index 982de3c6f2c8..4eb90d36c0a6 100644 --- a/configmgr/source/rootaccess.hxx +++ b/configmgr/source/rootaccess.hxx @@ -53,8 +53,8 @@ class RootAccess: { public: RootAccess( - Components & components, OUString const & pathRepresentation, - OUString const & locale, bool update); + Components & components, OUString pathRepresentation, + OUString locale, bool update); virtual std::vector<OUString> getAbsolutePath() override; diff --git a/configmgr/source/setnode.cxx b/configmgr/source/setnode.cxx index 2ba4c50be681..5e15ac31d61f 100644 --- a/configmgr/source/setnode.cxx +++ b/configmgr/source/setnode.cxx @@ -23,6 +23,7 @@ #include <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <utility> #include "data.hxx" #include "node.hxx" @@ -32,10 +33,10 @@ namespace configmgr { SetNode::SetNode( - int layer, OUString const & defaultTemplateName, - OUString const & templateName): - Node(layer), defaultTemplateName_(defaultTemplateName), - templateName_(templateName), mandatory_(Data::NO_LAYER) + int layer, OUString defaultTemplateName, + OUString templateName): + Node(layer), defaultTemplateName_(std::move(defaultTemplateName)), + templateName_(std::move(templateName)), mandatory_(Data::NO_LAYER) {} rtl::Reference< Node > SetNode::clone(bool keepTemplateName) const { diff --git a/configmgr/source/setnode.hxx b/configmgr/source/setnode.hxx index 1a8f44132940..706d153daf6f 100644 --- a/configmgr/source/setnode.hxx +++ b/configmgr/source/setnode.hxx @@ -34,8 +34,8 @@ namespace configmgr { class SetNode: public Node { public: SetNode( - int layer, OUString const & defaultTemplateName, - OUString const & templateName); + int layer, OUString defaultTemplateName, + OUString templateName); virtual rtl::Reference< Node > clone(bool keepTemplateName) const override; diff --git a/configmgr/source/xcsparser.hxx b/configmgr/source/xcsparser.hxx index 36e5a1a0037a..f2c5c77429d6 100644 --- a/configmgr/source/xcsparser.hxx +++ b/configmgr/source/xcsparser.hxx @@ -26,6 +26,7 @@ #include <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <utility> #include <xmlreader/xmlreader.hxx> #include "node.hxx" @@ -80,9 +81,9 @@ private: OUString name; Element( - rtl::Reference< Node > const & theNode, - OUString const & theName): - node(theNode), name(theName) {} + rtl::Reference< Node > theNode, + OUString theName): + node(std::move(theNode)), name(std::move(theName)) {} }; typedef std::stack< Element > ElementStack; diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx index cf6fb3e91b2d..e50b7b5a0fc8 100644 --- a/configmgr/source/xcuparser.hxx +++ b/configmgr/source/xcuparser.hxx @@ -27,6 +27,7 @@ #include <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <utility> #include <xmlreader/xmlreader.hxx> #include "additions.hxx" @@ -124,13 +125,13 @@ private: private: explicit State(bool thePop): ignore(true), insert(false), pop(thePop) {} - explicit State(rtl::Reference< Node > const & theNode): - node(theNode), ignore(false), insert(false), pop(true) + explicit State(rtl::Reference< Node > theNode): + node(std::move(theNode)), ignore(false), insert(false), pop(true) {} State( - rtl::Reference< Node > const & theNode, OUString const & theName): - node(theNode), name(theName), ignore(false), insert(true), pop(true) + rtl::Reference< Node > theNode, OUString theName): + node(std::move(theNode)), name(std::move(theName)), ignore(false), insert(true), pop(true) {} }; |