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>
This commit is contained in:
Noel Grandin 2022-05-23 09:01:36 +02:00
parent 32c43ee75c
commit be9a394884
23 changed files with 75 additions and 60 deletions

View file

@ -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(

View file

@ -354,7 +354,7 @@ private:
ModifiedChild();
ModifiedChild(
rtl::Reference< ChildAccess > const & theChild,
rtl::Reference< ChildAccess > theChild,
bool theDirectlyModified);
};

View file

@ -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());
}

View file

@ -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_;

View file

@ -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() )
{

View file

@ -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(

View file

@ -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);

View file

@ -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() )
{

View file

@ -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;

View file

@ -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)
{}

View file

@ -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;

View file

@ -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):

View file

@ -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;

View file

@ -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 {

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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)
{

View file

@ -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;

View file

@ -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 {

View file

@ -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;

View file

@ -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;

View file

@ -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)
{}
};