codemaker/source/cppumaker/cpputype.cxx |   12 ++++-----
 codemaker/source/cppumaker/includes.cxx |    5 ++-
 codemaker/source/cppumaker/includes.hxx |    2 -
 codemaker/source/javamaker/javatype.cxx |   42 ++++++++++++++++----------------
 include/codemaker/exceptiontree.hxx     |    5 ++-
 include/codemaker/global.hxx            |    3 +-
 include/codemaker/options.hxx           |    5 ++-
 7 files changed, 39 insertions(+), 35 deletions(-)

New commits:
commit 225328b1e3994fcd6b293f007fee10c27e98291e
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed May 18 11:52:59 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Wed May 18 14:08:28 2022 +0200

    clang-tidy modernize-pass-by-value in codemaker
    
    Change-Id: I2bd9c4c8ced5f0edb9dbf560fe0ed126b9233c26
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134519
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index e5436c9049f5..03fcd033beca 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -27,6 +27,7 @@
 #include <set>
 #include <string_view>
 #include <memory>
+#include <utility>
 #include <vector>
 #include <iostream>
 
@@ -152,8 +153,7 @@ bool isBootstrapType(OUString const & name)
 class CppuType
 {
 public:
-    CppuType(
-        OUString const & name, rtl::Reference< TypeManager > const & typeMgr);
+    CppuType(OUString name, rtl::Reference< TypeManager > const & typeMgr);
 
     virtual ~CppuType() {}
 
@@ -273,12 +273,12 @@ private:
 };
 
 CppuType::CppuType(
-    OUString const & name, rtl::Reference< TypeManager > const & typeMgr):
+    OUString name, rtl::Reference< TypeManager > const & typeMgr):
     m_inheritedMemberCount(0)
     , m_cppuTypeLeak(false)
     , m_cppuTypeDynamic(true)
     , m_indentLength(0)
-    , name_(name)
+    , name_(std::move(name))
     , id_(name_.copy(name_.lastIndexOf('.') + 1))
     , m_typeMgr(typeMgr)
     , m_dependencies(typeMgr, name_)
@@ -1051,9 +1051,9 @@ class BaseOffset
 {
 public:
     BaseOffset(
-        rtl::Reference< TypeManager > const & manager,
+        rtl::Reference< TypeManager > manager,
         rtl::Reference< unoidl::InterfaceTypeEntity > const & entity):
-        manager_(manager), offset_(0) {
+        manager_(std::move(manager)), offset_(0) {
         calculateBases(entity);
     }
     BaseOffset(const BaseOffset&) = delete;
diff --git a/codemaker/source/cppumaker/includes.cxx 
b/codemaker/source/cppumaker/includes.cxx
index db7dae46bccc..9dacdf268265 100644
--- a/codemaker/source/cppumaker/includes.cxx
+++ b/codemaker/source/cppumaker/includes.cxx
@@ -33,14 +33,15 @@
 #include <rtl/ustring.hxx>
 #include <sal/types.h>
 
+#include <utility>
 #include <vector>
 
 using codemaker::cppumaker::Includes;
 
 Includes::Includes(
-    rtl::Reference< TypeManager > const & manager,
+    rtl::Reference< TypeManager > manager,
     codemaker::cppumaker::Dependencies const & dependencies, bool hpp):
-    m_manager(manager), m_map(dependencies.getMap()), m_hpp(hpp),
+    m_manager(std::move(manager)), m_map(dependencies.getMap()), m_hpp(hpp),
     m_includeCassert(false),
     m_includeAny(dependencies.hasAnyDependency()), m_includeReference(false),
     m_includeSequence(dependencies.hasSequenceDependency()),
diff --git a/codemaker/source/cppumaker/includes.hxx 
b/codemaker/source/cppumaker/includes.hxx
index 0362c417ac2a..8cd830b4a731 100644
--- a/codemaker/source/cppumaker/includes.hxx
+++ b/codemaker/source/cppumaker/includes.hxx
@@ -33,7 +33,7 @@ namespace codemaker::cppumaker {
 class Includes {
 public:
     Includes(
-        rtl::Reference< TypeManager > const & manager,
+        rtl::Reference< TypeManager > manager,
         Dependencies const & dependencies, bool hpp);
 
     ~Includes();
diff --git a/codemaker/source/javamaker/javatype.cxx 
b/codemaker/source/javamaker/javatype.cxx
index 563506221721..3db9572e5c7c 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -320,7 +320,7 @@ SpecialType getFieldDescriptor(
 class MethodDescriptor {
 public:
     MethodDescriptor(
-        rtl::Reference< TypeManager > const & manager,
+        rtl::Reference< TypeManager > manager,
         std::set<OUString> * dependencies, std::u16string_view returnType,
         SpecialType * specialReturnType,
         PolymorphicUnoType * polymorphicUnoType);
@@ -346,10 +346,10 @@ private:
 };
 
 MethodDescriptor::MethodDescriptor(
-    rtl::Reference< TypeManager > const & manager, std::set<OUString> * 
dependencies,
+    rtl::Reference< TypeManager > manager, std::set<OUString> * dependencies,
     std::u16string_view returnType, SpecialType * specialReturnType,
     PolymorphicUnoType * polymorphicUnoType):
-    m_manager(manager), m_dependencies(dependencies), m_needsSignature(false)
+    m_manager(std::move(manager)), m_dependencies(dependencies), 
m_needsSignature(false)
 {
     assert(dependencies != nullptr);
     m_descriptorStart.append('(');
@@ -400,20 +400,20 @@ public:
 
     // KIND_MEMBER:
     TypeInfo(
-        OString const & name, SpecialType specialType, sal_Int32 index,
+        OString name, SpecialType specialType, sal_Int32 index,
         PolymorphicUnoType const & polymorphicUnoType,
         sal_Int32 typeParameterIndex);
 
     // KIND_ATTRIBUTE/METHOD:
     TypeInfo(
-        Kind kind, OString const & name, SpecialType specialType, Flags flags,
-        sal_Int32 index, PolymorphicUnoType const & polymorphicUnoType);
+        Kind kind, OString name, SpecialType specialType, Flags flags,
+        sal_Int32 index, PolymorphicUnoType  polymorphicUnoType);
 
     // KIND_PARAMETER:
     TypeInfo(
-        OString const & parameterName, SpecialType specialType,
-        bool inParameter, bool outParameter, OString const & methodName,
-        sal_Int32 index, PolymorphicUnoType const & polymorphicUnoType);
+        OString parameterName, SpecialType specialType,
+        bool inParameter, bool outParameter, OString  methodName,
+        sal_Int32 index, PolymorphicUnoType  polymorphicUnoType);
 
     sal_uInt16 generateCode(ClassFile::Code & code, std::set<OUString> * 
dependencies)
         const;
@@ -447,10 +447,10 @@ sal_Int32 translateSpecialTypeFlags(
 }
 
 TypeInfo::TypeInfo(
-    OString const & name, SpecialType specialType, sal_Int32 index,
+    OString name, SpecialType specialType, sal_Int32 index,
     PolymorphicUnoType const & polymorphicUnoType,
     sal_Int32 typeParameterIndex):
-    m_kind(KIND_MEMBER), m_name(name),
+    m_kind(KIND_MEMBER), m_name(std::move(name)),
     m_flags(translateSpecialTypeFlags(specialType, false, false)),
     m_index(index), m_polymorphicUnoType(polymorphicUnoType),
     m_typeParameterIndex(typeParameterIndex)
@@ -461,24 +461,24 @@ TypeInfo::TypeInfo(
 }
 
 TypeInfo::TypeInfo(
-    Kind kind, OString const & name, SpecialType specialType, Flags flags,
-    sal_Int32 index, PolymorphicUnoType const & polymorphicUnoType):
-    m_kind(kind), m_name(name),
+    Kind kind, OString name, SpecialType specialType, Flags flags,
+    sal_Int32 index, PolymorphicUnoType polymorphicUnoType):
+    m_kind(kind), m_name(std::move(name)),
     m_flags(flags | translateSpecialTypeFlags(specialType, false, false)),
-    m_index(index), m_polymorphicUnoType(polymorphicUnoType),
+    m_index(index), m_polymorphicUnoType(std::move(polymorphicUnoType)),
     m_typeParameterIndex(0)
 {
     assert(kind == KIND_ATTRIBUTE || kind == KIND_METHOD);
 }
 
 TypeInfo::TypeInfo(
-    OString const & parameterName, SpecialType specialType, bool inParameter,
-    bool outParameter, OString const & methodName, sal_Int32 index,
-    PolymorphicUnoType const & polymorphicUnoType):
-    m_kind(KIND_PARAMETER), m_name(parameterName),
+    OString parameterName, SpecialType specialType, bool inParameter,
+    bool outParameter, OString methodName, sal_Int32 index,
+    PolymorphicUnoType polymorphicUnoType):
+    m_kind(KIND_PARAMETER), m_name(std::move(parameterName)),
     m_flags(translateSpecialTypeFlags(specialType, inParameter, outParameter)),
-    m_index(index), m_methodName(methodName),
-    m_polymorphicUnoType(polymorphicUnoType),
+    m_index(index), m_methodName(std::move(methodName)),
+    m_polymorphicUnoType(std::move(polymorphicUnoType)),
     m_typeParameterIndex(0)
 {}
 
diff --git a/include/codemaker/exceptiontree.hxx 
b/include/codemaker/exceptiontree.hxx
index e42850c101e5..4d5055f8e589 100644
--- a/include/codemaker/exceptiontree.hxx
+++ b/include/codemaker/exceptiontree.hxx
@@ -24,6 +24,7 @@
 #include <rtl/string.hxx>
 
 #include <memory>
+#include <utility>
 #include <vector>
 
 class TypeManager;
@@ -37,8 +38,8 @@ struct ExceptionTreeNode {
     typedef std::vector< std::unique_ptr<ExceptionTreeNode> > Children;
 
     // Internally used by ExceptionTree:
-    ExceptionTreeNode(rtl::OString const & theName):
-        name(theName), present(false) {}
+    ExceptionTreeNode(rtl::OString theName):
+        name(std::move(theName)), present(false) {}
 
     // Internally used by ExceptionTree:
     ~ExceptionTreeNode() { clearChildren(); }
diff --git a/include/codemaker/global.hxx b/include/codemaker/global.hxx
index 3fff70f9988f..e62e1a973273 100644
--- a/include/codemaker/global.hxx
+++ b/include/codemaker/global.hxx
@@ -20,6 +20,7 @@
 #ifndef INCLUDED_CODEMAKER_GLOBAL_HXX
 #define INCLUDED_CODEMAKER_GLOBAL_HXX
 
+#include <utility>
 #include <vector>
 #include <string_view>
 
@@ -80,7 +81,7 @@ bool removeTypeFile(const ::rtl::OString& fileName);
 
 class CannotDumpException final {
 public:
-    CannotDumpException(OUString const & message): message_(message) {}
+    CannotDumpException(OUString message): message_(std::move(message)) {}
 
     ~CannotDumpException() noexcept;
 
diff --git a/include/codemaker/options.hxx b/include/codemaker/options.hxx
index ca86fa1b3995..803274901a4a 100644
--- a/include/codemaker/options.hxx
+++ b/include/codemaker/options.hxx
@@ -22,6 +22,7 @@
 
 #include <codemaker/global.hxx>
 #include <unordered_map>
+#include <utility>
 
 typedef std::unordered_map
 <
@@ -33,8 +34,8 @@ typedef std::unordered_map
 class IllegalArgument
 {
 public:
-    IllegalArgument(const ::rtl::OString& msg)
-        : m_message(msg) {}
+    IllegalArgument(::rtl::OString msg)
+        : m_message(std::move(msg)) {}
 
     ::rtl::OString  m_message;
 };

Reply via email to