include/unoidl/unoidl.hxx                        |  173 +++++++++++------------
 unoidl/source/legacyprovider.cxx                 |   24 +--
 unoidl/source/sourceprovider-parser-requires.hxx |    4 
 unoidl/source/sourceprovider-parser.y            |   32 ++--
 unoidl/source/sourceprovider-scanner.hxx         |    8 -
 unoidl/source/unoidl-write.cxx                   |    6 
 unoidl/source/unoidl.cxx                         |   14 -
 unoidl/source/unoidlprovider.cxx                 |   36 ++--
 8 files changed, 150 insertions(+), 147 deletions(-)

New commits:
commit 66e5317a91475ab5f7c796f023431d6a642fd60e
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Sun Oct 10 20:41:42 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Oct 11 11:37:04 2021 +0200

    loplugin:moveparam in unoidl
    
    Change-Id: Id3069cad0b118b5593bb7a0faa9d7e33e5bef168
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123353
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/unoidl/unoidl.hxx b/include/unoidl/unoidl.hxx
index 7196a4b14c70..e2ae024d06f7 100644
--- a/include/unoidl/unoidl.hxx
+++ b/include/unoidl/unoidl.hxx
@@ -68,8 +68,8 @@ private:
 struct AnnotatedReference {
     AnnotatedReference(
         OUString const & theName,
-        std::vector< OUString > const & theAnnotations):
-        name(theName), annotations(theAnnotations)
+        std::vector< OUString > && theAnnotations):
+        name(theName), annotations(std::move(theAnnotations))
     {}
 
     OUString name;
@@ -133,8 +133,8 @@ public:
 protected:
     SAL_DLLPRIVATE PublishableEntity(
         Sort sort, bool published,
-        std::vector< OUString > const & annotations):
-        Entity(sort), published_(published), annotations_(annotations)
+        std::vector< OUString >&& annotations):
+        Entity(sort), published_(published), 
annotations_(std::move(annotations))
     {}
 
     virtual SAL_DLLPRIVATE ~PublishableEntity() noexcept override;
@@ -150,8 +150,8 @@ public:
     struct Member {
         Member(
             OUString const & theName, sal_Int32 theValue,
-            std::vector< OUString > const & theAnnotations):
-            name(theName), value(theValue), annotations(theAnnotations)
+            std::vector< OUString >&& theAnnotations):
+            name(theName), value(theValue), 
annotations(std::move(theAnnotations))
         {}
 
         OUString name;
@@ -162,11 +162,11 @@ public:
     };
 
     SAL_DLLPRIVATE EnumTypeEntity(
-        bool published, std::vector< Member > const & members,
-        std::vector< OUString > const & annotations):
-        PublishableEntity(SORT_ENUM_TYPE, published, annotations),
-        members_(members)
-    { assert(!members.empty()); }
+        bool published, std::vector< Member >&& members,
+        std::vector< OUString >&& annotations):
+        PublishableEntity(SORT_ENUM_TYPE, published, std::move(annotations)),
+        members_(std::move(members))
+    { assert(!members_.empty()); }
 
     std::vector< Member > const & getMembers() const { return members_; }
 
@@ -180,8 +180,8 @@ class SAL_WARN_UNUSED LO_DLLPUBLIC_UNOIDL 
PlainStructTypeEntity final : public P
 public:
     struct Member {
         Member(OUString const & theName, OUString const & theType,
-               std::vector< OUString > const & theAnnotations):
-            name(theName), type(theType), annotations(theAnnotations)
+               std::vector< OUString >&& theAnnotations):
+            name(theName), type(theType), 
annotations(std::move(theAnnotations))
         {}
 
         OUString name;
@@ -193,10 +193,10 @@ public:
 
     SAL_DLLPRIVATE PlainStructTypeEntity(
         bool published, OUString const & directBase,
-        std::vector< Member > const & directMembers,
-        std::vector< OUString > const & annotations):
-        PublishableEntity(SORT_PLAIN_STRUCT_TYPE, published, annotations),
-        directBase_(directBase), directMembers_(directMembers)
+        std::vector< Member >&& directMembers,
+        std::vector< OUString > && annotations):
+        PublishableEntity(SORT_PLAIN_STRUCT_TYPE, published, 
std::move(annotations)),
+        directBase_(directBase), directMembers_(std::move(directMembers))
     {}
 
     const OUString& getDirectBase() const { return directBase_; }
@@ -219,9 +219,9 @@ public:
         Member(
             OUString const & theName, OUString const & theType,
             bool theParameterized,
-            std::vector< OUString > const & theAnnotations):
+            std::vector< OUString >&& theAnnotations):
             name(theName), type(theType), parameterized(theParameterized),
-            annotations(theAnnotations)
+            annotations(std::move(theAnnotations))
         {}
 
         OUString name;
@@ -234,12 +234,12 @@ public:
     };
 
     SAL_DLLPRIVATE PolymorphicStructTypeTemplateEntity(
-        bool published, std::vector< OUString > const & typeParameters,
-        std::vector< Member > const & members,
-        std::vector< OUString > const & annotations):
+        bool published, std::vector< OUString >&& typeParameters,
+        std::vector< Member >&& members,
+        std::vector< OUString >&& annotations):
         PublishableEntity(
-            SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE, published, annotations),
-        typeParameters_(typeParameters), members_(members)
+            SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE, published, 
std::move(annotations)),
+        typeParameters_(std::move(typeParameters)), 
members_(std::move(members))
     {}
 
     std::vector< OUString > const & getTypeParameters() const
@@ -259,8 +259,8 @@ public:
     struct Member {
         Member(
             OUString const & theName, OUString const & theType,
-            std::vector< OUString > const & theAnnotations):
-            name(theName), type(theType), annotations(theAnnotations)
+            std::vector< OUString >&& theAnnotations):
+            name(theName), type(theType), 
annotations(std::move(theAnnotations))
         {}
 
         OUString name;
@@ -272,10 +272,10 @@ public:
 
     SAL_DLLPRIVATE ExceptionTypeEntity(
         bool published, OUString const & directBase,
-        std::vector< Member > const & directMembers,
-        std::vector< OUString > const & annotations):
-        PublishableEntity(SORT_EXCEPTION_TYPE, published, annotations),
-        directBase_(directBase), directMembers_(directMembers)
+        std::vector< Member >&& directMembers,
+        std::vector< OUString >&& annotations):
+        PublishableEntity(SORT_EXCEPTION_TYPE, published, 
std::move(annotations)),
+        directBase_(directBase), directMembers_(std::move(directMembers))
     {}
 
     const OUString& getDirectBase() const { return directBase_; }
@@ -296,13 +296,13 @@ public:
         Attribute(
             OUString const & theName, OUString const & theType,
             bool theBound, bool theReadOnly,
-            std::vector< OUString > const & theGetExceptions,
-            std::vector< OUString > const & theSetExceptions,
-            std::vector< OUString > const & theAnnotations):
+            std::vector< OUString >&& theGetExceptions,
+            std::vector< OUString >&& theSetExceptions,
+            std::vector< OUString >&& theAnnotations):
             name(theName), type(theType), bound(theBound),
-            readOnly(theReadOnly), getExceptions(theGetExceptions),
-            setExceptions(theSetExceptions), annotations(theAnnotations)
-        { assert(!theReadOnly || theSetExceptions.empty()); }
+            readOnly(theReadOnly), getExceptions(std::move(theGetExceptions)),
+            setExceptions(std::move(theSetExceptions)), 
annotations(std::move(theAnnotations))
+        { assert(!theReadOnly || setExceptions.empty()); }
 
         OUString name;
 
@@ -338,11 +338,11 @@ public:
 
         Method(
             OUString const & theName, OUString const & theReturnType,
-            std::vector< Parameter > const & theParameters,
-            std::vector< OUString > const & theExceptions,
-            std::vector< OUString > const & theAnnotations):
-            name(theName), returnType(theReturnType), 
parameters(theParameters),
-            exceptions(theExceptions), annotations(theAnnotations)
+            std::vector< Parameter >&& theParameters,
+            std::vector< OUString >&& theExceptions,
+            std::vector< OUString >&& theAnnotations):
+            name(theName), returnType(theReturnType), 
parameters(std::move(theParameters)),
+            exceptions(std::move(theExceptions)), 
annotations(std::move(theAnnotations))
         {}
 
         OUString name;
@@ -358,15 +358,16 @@ public:
 
     SAL_DLLPRIVATE InterfaceTypeEntity(
         bool published,
-        std::vector< AnnotatedReference > const & directMandatoryBases,
-        std::vector< AnnotatedReference > const & directOptionalBases,
-        std::vector< Attribute > const & directAttributes,
-        std::vector< Method > const & directMethods,
-        std::vector< OUString > const & annotations):
-        PublishableEntity(SORT_INTERFACE_TYPE, published, annotations),
-        directMandatoryBases_(directMandatoryBases),
-        directOptionalBases_(directOptionalBases),
-        directAttributes_(directAttributes), directMethods_(directMethods)
+        std::vector< AnnotatedReference >&& directMandatoryBases,
+        std::vector< AnnotatedReference >&& directOptionalBases,
+        std::vector< Attribute >&& directAttributes,
+        std::vector< Method >&& directMethods,
+        std::vector< OUString >&& annotations):
+        PublishableEntity(SORT_INTERFACE_TYPE, published, 
std::move(annotations)),
+        directMandatoryBases_(std::move(directMandatoryBases)),
+        directOptionalBases_(std::move(directOptionalBases)),
+        directAttributes_(std::move(directAttributes)),
+        directMethods_(std::move(directMethods))
     {}
 
     std::vector< AnnotatedReference > const & getDirectMandatoryBases() const
@@ -394,8 +395,8 @@ class SAL_WARN_UNUSED LO_DLLPUBLIC_UNOIDL TypedefEntity 
final : public Publishab
 public:
     SAL_DLLPRIVATE TypedefEntity(
         bool published, OUString const & type,
-        std::vector< OUString > const & annotations):
-        PublishableEntity(SORT_TYPEDEF, published, annotations), type_(type)
+        std::vector< OUString >&& annotations):
+        PublishableEntity(SORT_TYPEDEF, published, std::move(annotations)), 
type_(type)
     {}
 
     const OUString& getType() const { return type_; }
@@ -459,8 +460,8 @@ public:
     struct Member {
         Member(
             OUString const & theName, ConstantValue const & theValue,
-            std::vector< OUString > const & theAnnotations):
-            name(theName), value(theValue), annotations(theAnnotations)
+            std::vector< OUString >&& theAnnotations):
+            name(theName), value(theValue), 
annotations(std::move(theAnnotations))
         {}
 
         OUString name;
@@ -471,10 +472,10 @@ public:
     };
 
     SAL_DLLPRIVATE ConstantGroupEntity(
-        bool published, std::vector< Member > const & members,
-        std::vector< OUString > const & annotations):
-        PublishableEntity(SORT_CONSTANT_GROUP, published, annotations),
-        members_(members)
+        bool published, std::vector< Member >&& members,
+        std::vector< OUString >&& annotations):
+        PublishableEntity(SORT_CONSTANT_GROUP, published, 
std::move(annotations)),
+        members_(std::move(members))
     {}
 
     std::vector< Member > const & getMembers() const { return members_; }
@@ -509,11 +510,13 @@ public:
 
         Constructor(
             OUString const & theName,
-            std::vector< Parameter > const & theParameters,
-            std::vector< OUString > const & theExceptions,
-            std::vector< OUString > const & theAnnotations):
-            name(theName), parameters(theParameters), 
exceptions(theExceptions),
-            annotations(theAnnotations), defaultConstructor(false)
+            std::vector< Parameter >&& theParameters,
+            std::vector< OUString >&& theExceptions,
+            std::vector< OUString >&& theAnnotations):
+            name(theName), parameters(std::move(theParameters)),
+            exceptions(std::move(theExceptions)),
+            annotations(std::move(theAnnotations)),
+            defaultConstructor(false)
         {}
 
         OUString name;
@@ -529,11 +532,11 @@ public:
 
     SAL_DLLPRIVATE SingleInterfaceBasedServiceEntity(
         bool published, OUString const & base,
-        std::vector< Constructor > const & constructors,
-        std::vector< OUString > const & annotations):
+        std::vector< Constructor >&& constructors,
+        std::vector< OUString >&& annotations):
         PublishableEntity(
-            SORT_SINGLE_INTERFACE_BASED_SERVICE, published, annotations),
-        base_(base), constructors_(constructors)
+            SORT_SINGLE_INTERFACE_BASED_SERVICE, published, 
std::move(annotations)),
+        base_(base), constructors_(std::move(constructors))
     {}
 
     const OUString& getBase() const { return base_; }
@@ -568,9 +571,9 @@ public:
         Property(
             OUString const & theName, OUString const & theType,
             Attributes theAttributes,
-            std::vector< OUString > const & theAnnotations):
+            std::vector< OUString >&& theAnnotations):
             name(theName), type(theType), attributes(theAttributes),
-            annotations(theAnnotations)
+            annotations(std::move(theAnnotations))
         {}
 
         OUString name;
@@ -584,19 +587,19 @@ public:
 
     SAL_DLLPRIVATE AccumulationBasedServiceEntity(
         bool published,
-        std::vector< AnnotatedReference > const & directMandatoryBaseServices,
-        std::vector< AnnotatedReference > const & directOptionalBaseServices,
-        std::vector< AnnotatedReference > const & 
directMandatoryBaseInterfaces,
-        std::vector< AnnotatedReference > const & directOptionalBaseInterfaces,
-        std::vector< Property > const & directProperties,
-        std::vector< OUString > const & annotations):
+        std::vector< AnnotatedReference >&& directMandatoryBaseServices,
+        std::vector< AnnotatedReference >&& directOptionalBaseServices,
+        std::vector< AnnotatedReference >&& directMandatoryBaseInterfaces,
+        std::vector< AnnotatedReference >&& directOptionalBaseInterfaces,
+        std::vector< Property >&& directProperties,
+        std::vector< OUString >&& annotations):
         PublishableEntity(
-            SORT_ACCUMULATION_BASED_SERVICE, published, annotations),
-        directMandatoryBaseServices_(directMandatoryBaseServices),
-        directOptionalBaseServices_(directOptionalBaseServices),
-        directMandatoryBaseInterfaces_(directMandatoryBaseInterfaces),
-        directOptionalBaseInterfaces_(directOptionalBaseInterfaces),
-        directProperties_(directProperties)
+            SORT_ACCUMULATION_BASED_SERVICE, published, 
std::move(annotations)),
+        directMandatoryBaseServices_(std::move(directMandatoryBaseServices)),
+        directOptionalBaseServices_(std::move(directOptionalBaseServices)),
+        
directMandatoryBaseInterfaces_(std::move(directMandatoryBaseInterfaces)),
+        directOptionalBaseInterfaces_(std::move(directOptionalBaseInterfaces)),
+        directProperties_(std::move(directProperties))
         {}
 
     std::vector< AnnotatedReference > const & getDirectMandatoryBaseServices()
@@ -634,9 +637,9 @@ class LO_DLLPUBLIC_UNOIDL InterfaceBasedSingletonEntity 
final :
 public:
     SAL_DLLPRIVATE InterfaceBasedSingletonEntity(
         bool published, OUString const & base,
-        std::vector< OUString > const & annotations):
+        std::vector< OUString >&& annotations):
         PublishableEntity(
-            SORT_INTERFACE_BASED_SINGLETON, published, annotations),
+            SORT_INTERFACE_BASED_SINGLETON, published, std::move(annotations)),
         base_(base)
     {}
 
@@ -653,8 +656,8 @@ class SAL_WARN_UNUSED LO_DLLPUBLIC_UNOIDL 
ServiceBasedSingletonEntity final : pu
 public:
     SAL_DLLPRIVATE ServiceBasedSingletonEntity(
         bool published, OUString const & base,
-        std::vector< OUString > const & annotations):
-        PublishableEntity(SORT_SERVICE_BASED_SINGLETON, published, 
annotations),
+        std::vector< OUString >&& annotations):
+        PublishableEntity(SORT_SERVICE_BASED_SINGLETON, published, 
std::move(annotations)),
         base_(base)
     {}
 
diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx
index 13a2275282ba..1d147a975582 100644
--- a/unoidl/source/legacyprovider.cxx
+++ b/unoidl/source/legacyprovider.cxx
@@ -297,7 +297,7 @@ rtl::Reference< Entity > readEntity(
                 attrs.emplace_back(
                     attrName, reader.getFieldTypeName(j).replace('/', '.'),
                     bool(flags & RTFieldAccess::BOUND),
-                    bool(flags & RTFieldAccess::READONLY), getExcs, setExcs,
+                    bool(flags & RTFieldAccess::READONLY), std::move(getExcs), 
std::move(setExcs),
                     translateAnnotations(reader.getFieldDocumentation(j)));
             }
             std::vector< InterfaceTypeEntity::Method > meths;
@@ -355,13 +355,13 @@ rtl::Reference< Entity > readEntity(
                     meths.emplace_back(
                         reader.getMethodName(j),
                         reader.getMethodReturnTypeName(j).replace('/', '.'),
-                        params, excs,
+                        std::move(params), std::move(excs),
                         translateAnnotations(
                             reader.getMethodDocumentation(j)));
                 }
             }
             return new InterfaceTypeEntity(
-                reader.isPublished(), mandBases, optBases, attrs, meths,
+                reader.isPublished(), std::move(mandBases), 
std::move(optBases), std::move(attrs), std::move(meths),
                 translateAnnotations(reader.getDocumentation()));
         }
     case RT_TYPE_MODULE:
@@ -394,7 +394,7 @@ rtl::Reference< Entity > readEntity(
                         translateAnnotations(reader.getFieldDocumentation(j)));
                 }
                 return new PlainStructTypeEntity(
-                    reader.isPublished(), base, mems,
+                    reader.isPublished(), base, std::move(mems),
                     translateAnnotations(reader.getDocumentation()));
             } else {
                 if (reader.getSuperTypeCount() != 0) {
@@ -422,7 +422,7 @@ rtl::Reference< Entity > readEntity(
                         translateAnnotations(reader.getFieldDocumentation(j)));
                 }
                 return new PolymorphicStructTypeTemplateEntity(
-                    reader.isPublished(), params, mems,
+                    reader.isPublished(), std::move(params), std::move(mems),
                     translateAnnotations(reader.getDocumentation()));
             }
         }
@@ -446,7 +446,7 @@ rtl::Reference< Entity > readEntity(
 
             }
             return new EnumTypeEntity(
-                reader.isPublished(), mems,
+                reader.isPublished(), std::move(mems),
                 translateAnnotations(reader.getDocumentation()));
         }
     case RT_TYPE_EXCEPTION:
@@ -475,7 +475,7 @@ rtl::Reference< Entity > readEntity(
                     translateAnnotations(reader.getFieldDocumentation(j)));
             }
             return new ExceptionTypeEntity(
-                reader.isPublished(), base, mems,
+                reader.isPublished(), base, std::move(mems),
                 translateAnnotations(reader.getDocumentation()));
         }
     case RT_TYPE_TYPEDEF:
@@ -579,8 +579,8 @@ rtl::Reference< Entity > readEntity(
                         translateAnnotations(reader.getFieldDocumentation(j)));
                 }
                 return new AccumulationBasedServiceEntity(
-                    reader.isPublished(), mandServs, optServs, mandIfcs,
-                    optIfcs, props,
+                    reader.isPublished(), std::move(mandServs), 
std::move(optServs), std::move(mandIfcs),
+                    std::move(optIfcs), std::move(props),
                     translateAnnotations(reader.getDocumentation()));
             }
         case 1:
@@ -661,14 +661,14 @@ rtl::Reference< Entity > readEntity(
                         }
                         ctors.push_back(
                             SingleInterfaceBasedServiceEntity::Constructor(
-                                reader.getMethodName(j), params, excs,
+                                reader.getMethodName(j), std::move(params), 
std::move(excs),
                                 translateAnnotations(
                                     reader.getMethodDocumentation(j))));
                     }
                 }
                 return new SingleInterfaceBasedServiceEntity(
                     reader.isPublished(),
-                    reader.getSuperTypeName(0).replace('/', '.'), ctors,
+                    reader.getSuperTypeName(0).replace('/', '.'), 
std::move(ctors),
                     translateAnnotations(reader.getDocumentation()));
             }
         default:
@@ -764,7 +764,7 @@ rtl::Reference< Entity > readEntity(
                     translateAnnotations(reader.getFieldDocumentation(j)));
             }
             return new ConstantGroupEntity(
-                reader.isPublished(), mems,
+                reader.isPublished(), std::move(mems),
                 translateAnnotations(reader.getDocumentation()));
         }
     default:
diff --git a/unoidl/source/sourceprovider-parser-requires.hxx 
b/unoidl/source/sourceprovider-parser-requires.hxx
index 52b8c79e2a93..59c79b39943c 100644
--- a/unoidl/source/sourceprovider-parser-requires.hxx
+++ b/unoidl/source/sourceprovider-parser-requires.hxx
@@ -108,10 +108,10 @@ struct SourceProviderType {
     SourceProviderType(
         OUString const & polymorphicStructTypeTemplateName,
         SourceProviderEntity const * theEntity,
-        std::vector<SourceProviderType> const & typeArguments):
+        std::vector<SourceProviderType>&& typeArguments):
         type(TYPE_INSTANTIATED_POLYMORPHIC_STRUCT),
         name(polymorphicStructTypeTemplateName), entity(theEntity),
-        subtypes(typeArguments)
+        subtypes(std::move(typeArguments))
     { assert(theEntity != nullptr); }
 
     explicit SourceProviderType(OUString const & identifier):
diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index 326d0dd7a8c9..0175b5379897 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -787,7 +787,7 @@ Found findEntity(
                                  + " type parameters"));
                             return FOUND_ERROR;
                         }
-                        t = unoidl::detail::SourceProviderType(n, e, args);
+                        t = unoidl::detail::SourceProviderType(n, e, 
std::move(args));
                         break;
                     }
                     [[fallthrough]];
@@ -1014,7 +1014,7 @@ enumDefn:
               ent->pad.get());
       assert(pad != nullptr);
       ent->entity = new unoidl::EnumTypeEntity(
-          pad->isPublished(), pad->members, annotations($1));
+          pad->isPublished(), std::move(pad->members), annotations($1));
       ent->pad.clear();
       clearCurrentState(data);
   }
@@ -1146,7 +1146,7 @@ plainStructDefn:
                   ent->pad.get());
       assert(pad != nullptr);
       ent->entity = new unoidl::PlainStructTypeEntity(
-          pad->isPublished(), pad->baseName, pad->members, annotations($1));
+          pad->isPublished(), pad->baseName, std::move(pad->members), 
annotations($1));
       ent->pad.clear();
       clearCurrentState(data);
   }
@@ -1179,7 +1179,7 @@ polymorphicStructTemplateDefn:
                   ent->pad.get());
       assert(pad != nullptr);
       ent->entity = new unoidl::PolymorphicStructTypeTemplateEntity(
-          pad->isPublished(), pad->typeParameters, pad->members,
+          pad->isPublished(), std::move(pad->typeParameters), 
std::move(pad->members),
           annotations($1));
       ent->pad.clear();
       clearCurrentState(data);
@@ -1274,7 +1274,7 @@ exceptionDefn:
               ent->pad.get());
       assert(pad != nullptr);
       ent->entity = new unoidl::ExceptionTypeEntity(
-          pad->isPublished(), pad->baseName, pad->members, annotations($1));
+          pad->isPublished(), pad->baseName, std::move(pad->members), 
annotations($1));
       ent->pad.clear();
       clearCurrentState(data);
   }
@@ -1604,15 +1604,15 @@ interfaceDefn:
       }
       std::vector<unoidl::AnnotatedReference> mbases;
       for (auto & i: pad->directMandatoryBases) {
-          mbases.emplace_back(i.name, i.annotations);
+          mbases.emplace_back(i.name, std::move(i.annotations));
       }
       std::vector<unoidl::AnnotatedReference> obases;
       for (auto & i: pad->directOptionalBases) {
-          obases.emplace_back(i.name, i.annotations);
+          obases.emplace_back(i.name, std::move(i.annotations));
       }
       ent->entity = new unoidl::InterfaceTypeEntity(
-          pad->isPublished(), mbases, obases, pad->directAttributes,
-          pad->directMethods, annotations($1));
+          pad->isPublished(), std::move(mbases), std::move(obases), 
std::move(pad->directAttributes),
+          std::move(pad->directMethods), annotations($1));
       ent->pad.clear();
       clearCurrentState(data);
   }
@@ -1988,7 +1988,7 @@ constantGroupDefn:
               ent->pad.get());
       assert(pad != nullptr);
       ent->entity = new unoidl::ConstantGroupEntity(
-          pad->isPublished(), pad->members, annotations($1));
+          pad->isPublished(), std::move(pad->members), annotations($1));
       ent->pad.clear();
       clearCurrentState(data);
   }
@@ -2359,7 +2359,7 @@ singleInterfaceBasedServiceDefn:
               }
               ctors.push_back(
                   unoidl::SingleInterfaceBasedServiceEntity::Constructor(
-                      i.name, parms, i.exceptions, i.annotations));
+                      i.name, std::vector(parms), std::vector(i.exceptions), 
std::vector(i.annotations)));
           }
       } else {
           assert(pad->constructors.empty());
@@ -2367,7 +2367,7 @@ singleInterfaceBasedServiceDefn:
               unoidl::SingleInterfaceBasedServiceEntity::Constructor());
       }
       ent->entity = new unoidl::SingleInterfaceBasedServiceEntity(
-          pad->isPublished(), pad->base, ctors, annotations($1));
+          pad->isPublished(), pad->base, std::move(ctors), annotations($1));
       ent->pad.clear();
       clearCurrentState(data);
   }
@@ -2564,9 +2564,9 @@ accumulationBasedServiceDefn:
               ent->pad.get());
       assert(pad != nullptr);
       ent->entity = new unoidl::AccumulationBasedServiceEntity(
-          pad->isPublished(), pad->directMandatoryBaseServices,
-          pad->directOptionalBaseServices, pad->directMandatoryBaseInterfaces,
-          pad->directOptionalBaseInterfaces, pad->directProperties,
+          pad->isPublished(), std::move(pad->directMandatoryBaseServices),
+          std::move(pad->directOptionalBaseServices), 
std::move(pad->directMandatoryBaseInterfaces),
+          std::move(pad->directOptionalBaseInterfaces), 
std::move(pad->directProperties),
           annotations($1));
       ent->pad.clear();
       clearCurrentState(data);
@@ -3941,7 +3941,7 @@ type:
                        + " used in published context"));
                   YYERROR;
               }
-              $$ = new unoidl::detail::SourceProviderType(name, ent, args);
+              $$ = new unoidl::detail::SourceProviderType(name, ent, 
std::move(args));
               ok = true;
           }
           break;
diff --git a/unoidl/source/sourceprovider-scanner.hxx 
b/unoidl/source/sourceprovider-scanner.hxx
index 6cad6a540117..8c973b9db169 100644
--- a/unoidl/source/sourceprovider-scanner.hxx
+++ b/unoidl/source/sourceprovider-scanner.hxx
@@ -109,8 +109,8 @@ public:
         DirectBase(
             OUString const & theName,
             rtl::Reference<unoidl::InterfaceTypeEntity> const & theEntity,
-            std::vector<OUString> const & theAnnotations):
-            name(theName), entity(theEntity), annotations(theAnnotations)
+            std::vector<OUString>&& theAnnotations):
+            name(theName), entity(theEntity), 
annotations(std::move(theAnnotations))
         { assert(theEntity.is()); }
 
         OUString name;
@@ -210,8 +210,8 @@ public:
 
         Constructor(
             OUString const & theName,
-            std::vector< OUString > const & theAnnotations):
-            name(theName), annotations(theAnnotations)
+            std::vector< OUString >&& theAnnotations):
+            name(theName), annotations(std::move(theAnnotations))
         {}
 
         OUString name;
diff --git a/unoidl/source/unoidl-write.cxx b/unoidl/source/unoidl-write.cxx
index b0fbc31e5023..5ddd98468359 100644
--- a/unoidl/source/unoidl-write.cxx
+++ b/unoidl/source/unoidl-write.cxx
@@ -311,8 +311,8 @@ struct Item {
 struct ConstItem {
     ConstItem(
         unoidl::ConstantValue const & theConstant,
-        std::vector< OUString > const & theAnnotations):
-        constant(theConstant), annotations(theAnnotations), nameOffset(0),
+        std::vector< OUString >&& theAnnotations):
+        constant(theConstant), annotations(std::move(theAnnotations)), 
nameOffset(0),
         dataOffset(0)
     {}
 
@@ -637,7 +637,7 @@ sal_uInt64 writeMap(
                 for (auto & j: ent2->getMembers()) {
                     if (!cmap.insert(
                             std::make_pair(
-                                j.name, ConstItem(j.value, j.annotations))).
+                                j.name, ConstItem(j.value, 
std::vector(j.annotations)))).
                         second)
                     {
                         std::cout
diff --git a/unoidl/source/unoidl.cxx b/unoidl/source/unoidl.cxx
index b66a6f45e534..749f9afe4f25 100644
--- a/unoidl/source/unoidl.cxx
+++ b/unoidl/source/unoidl.cxx
@@ -32,9 +32,9 @@ namespace {
 class AggregatingModule: public ModuleEntity {
 public:
     AggregatingModule(
-        std::vector< rtl::Reference< Provider > > const & providers,
+        std::vector< rtl::Reference< Provider > >&& providers,
         OUString const & name):
-        providers_(providers), name_(name)
+        providers_(std::move(providers)), name_(name)
     {}
 
 private:
@@ -64,9 +64,9 @@ std::vector< OUString > AggregatingModule::getMemberNames() 
const {
 class AggregatingCursor: public MapCursor {
 public:
     AggregatingCursor(
-        std::vector< rtl::Reference< Provider > > const & providers,
+        std::vector< rtl::Reference< Provider > >&& providers,
         OUString const & name):
-        providers_(providers), name_(name), iterator_(providers_.begin())
+        providers_(std::move(providers)), name_(name), 
iterator_(providers_.begin())
     { findCursor(); }
 
 private:
@@ -94,7 +94,7 @@ rtl::Reference< Entity > AggregatingCursor::getNext(OUString 
* name) {
                 }
                 return ent->getSort() == Entity::SORT_MODULE
                     ? new AggregatingModule(
-                        providers_, (name_.isEmpty() ? name_ : name_ + ".") + 
n)
+                        std::vector(providers_), (name_.isEmpty() ? name_ : 
name_ + ".") + n)
                     : ent;
             }
         } else {
@@ -120,7 +120,7 @@ void AggregatingCursor::findCursor() {
 }
 
 rtl::Reference< MapCursor > AggregatingModule::createCursor() const {
-    return new AggregatingCursor(providers_, name_);
+    return new AggregatingCursor(std::vector(providers_), name_);
 }
 
 }
@@ -189,7 +189,7 @@ rtl::Reference< Entity > Manager::findEntity(OUString const 
& name) const {
 rtl::Reference< MapCursor > Manager::createCursor(OUString const & name)
     const
 {
-    return new AggregatingCursor(providers_, name);
+    return new AggregatingCursor(std::vector(providers_), name);
 }
 
 Manager::~Manager() noexcept {}
diff --git a/unoidl/source/unoidlprovider.cxx b/unoidl/source/unoidlprovider.cxx
index b1c7788c2a40..217251dca053 100644
--- a/unoidl/source/unoidlprovider.cxx
+++ b/unoidl/source/unoidlprovider.cxx
@@ -649,7 +649,7 @@ ConstantValue readConstant(
 
 rtl::Reference< Entity > readEntity(
     rtl::Reference< MappedFile > const & file, sal_uInt32 offset,
-    std::set<Map> const & trace);
+    std::set<Map> && trace);
 
 class UnoidlModuleEntity;
 
@@ -682,7 +682,7 @@ rtl::Reference< Entity > UnoidlCursor::getNext(OUString * 
name) {
     if (index_ != map_.map.size) {
         *name = 
file_->readNulName(map_.map.begin[index_].name.getUnsigned32());
         ent = readEntity(
-            file_, map_.map.begin[index_].data.getUnsigned32(), map_.trace);
+            file_, map_.map.begin[index_].data.getUnsigned32(), 
std::set(map_.trace));
         ++index_;
     }
     return ent;
@@ -692,14 +692,14 @@ class UnoidlModuleEntity: public ModuleEntity {
 public:
     UnoidlModuleEntity(
         rtl::Reference< MappedFile > const & file, sal_uInt32 mapOffset,
-        sal_uInt32 mapSize, std::set<Map> const & trace):
+        sal_uInt32 mapSize, std::set<Map> && trace):
         file_(file)
     {
         assert(file.is());
         map_.map.begin = reinterpret_cast<MapEntry const *>(
             static_cast<char const *>(file_->address) + mapOffset);
         map_.map.size = mapSize;
-        map_.trace = trace;
+        map_.trace = std::move(trace);
         if (!map_.trace.insert(map_.map).second) {
             throw FileFormatException(
                 file_->uri, "UNOIDL format: recursive map");
@@ -732,7 +732,7 @@ std::vector< OUString > 
UnoidlModuleEntity::getMemberNames() const {
 
 rtl::Reference< Entity > readEntity(
     rtl::Reference< MappedFile > const & file, sal_uInt32 offset,
-    std::set<Map> const & trace)
+    std::set<Map> && trace)
 {
     assert(file.is());
     int v = file->read8(offset);
@@ -761,7 +761,7 @@ rtl::Reference< Entity > readEntity(
                     file->uri,
                     "UNOIDL format: module map offset + size too large");
             }
-            return new UnoidlModuleEntity(file, offset + 5, n, trace);
+            return new UnoidlModuleEntity(file, offset + 5, n, 
std::move(trace));
         }
     case 1: // enum type
         {
@@ -790,7 +790,7 @@ rtl::Reference< Entity > readEntity(
                     readAnnotations(annotated, file, offset, &offset));
             }
             return new EnumTypeEntity(
-                published, mems, readAnnotations(annotated, file, offset));
+                published, std::move(mems), readAnnotations(annotated, file, 
offset));
         }
     case 2: // plain struct type without base
     case 2 | 0x20: // plain struct type with base
@@ -826,7 +826,7 @@ rtl::Reference< Entity > readEntity(
                     readAnnotations(annotated, file, offset, &offset));
             }
             return new PlainStructTypeEntity(
-                published, base, mems,
+                published, base, std::move(mems),
                 readAnnotations(annotated, file, offset));
         }
     case 3: // polymorphic struct type template
@@ -873,7 +873,7 @@ rtl::Reference< Entity > readEntity(
                     readAnnotations(annotated, file, offset, &offset));
             }
             return new PolymorphicStructTypeTemplateEntity(
-                published, params, mems,
+                published, std::move(params), std::move(mems),
                 readAnnotations(annotated, file, offset));
         }
     case 4: // exception type without base
@@ -909,7 +909,7 @@ rtl::Reference< Entity > readEntity(
                     readAnnotations(annotated, file, offset, &offset));
             }
             return new ExceptionTypeEntity(
-                published, base, mems,
+                published, base, std::move(mems),
                 readAnnotations(annotated, file, offset));
         }
     case 5: // interface type
@@ -999,7 +999,7 @@ rtl::Reference< Entity > readEntity(
                 }
                 attrs.emplace_back(
                     attrName, attrType, (v & 0x01) != 0, (v & 0x02) != 0,
-                    getExcs, setExcs,
+                    std::move(getExcs), std::move(setExcs),
                     readAnnotations(annotated, file, offset, &offset));
             }
             sal_uInt32 nMeths = file->read32(offset);
@@ -1072,11 +1072,11 @@ rtl::Reference< Entity > readEntity(
                     excs.push_back(exc);
                 }
                 meths.emplace_back(
-                    methName, methType, params, excs,
+                    methName, methType, std::move(params), std::move(excs),
                     readAnnotations(annotated, file, offset, &offset));
             }
             return new InterfaceTypeEntity(
-                published, mandBases, optBases, attrs, meths,
+                published, std::move(mandBases), std::move(optBases), 
std::move(attrs), std::move(meths),
                 readAnnotations(annotated, file, offset));
         }
     case 6: // typedef
@@ -1115,7 +1115,7 @@ rtl::Reference< Entity > readEntity(
                     readAnnotations(ann, file, off));
             }
             return new ConstantGroupEntity(
-                published, mems,
+                published, std::move(mems),
                 readAnnotations(annotated, file, offset + 5 + 8 * n));
         }
     case 8: // single-interface--based service without default constructor
@@ -1194,12 +1194,12 @@ rtl::Reference< Entity > readEntity(
                     }
                     ctors.push_back(
                         SingleInterfaceBasedServiceEntity::Constructor(
-                            ctorName, params, excs,
+                            ctorName, std::move(params), std::move(excs),
                             readAnnotations(annotated, file, offset, 
&offset)));
                 }
             }
             return new SingleInterfaceBasedServiceEntity(
-                published, base, ctors,
+                published, base, std::move(ctors),
                 readAnnotations(annotated, file, offset));
         }
     case 9: // accumulation-based service
@@ -1295,7 +1295,7 @@ rtl::Reference< Entity > readEntity(
                     readAnnotations(annotated, file, offset, &offset));
             }
             return new AccumulationBasedServiceEntity(
-                published, mandServs, optServs, mandIfcs, optIfcs, props,
+                published, std::move(mandServs), std::move(optServs), 
std::move(mandIfcs), std::move(optIfcs), std::move(props),
                 readAnnotations(annotated, file, offset));
         }
     case 10: // interface-based singleton
@@ -1365,7 +1365,7 @@ rtl::Reference< Entity > 
UnoidlProvider::findEntity(OUString const & name) const
         if (j == name.getLength()) {
             return cgroup
                 ? rtl::Reference< Entity >()
-                : readEntity(file_, off, map.trace);
+                : readEntity(file_, off, std::set(map.trace));
         }
         if (cgroup) {
             return rtl::Reference< Entity >();

Reply via email to