sw/source/ui/vba/vbaformfield.cxx  |    2 +-
 sw/source/ui/vba/vbaformfields.cxx |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit d9c708f78de6f6ef6621b47123a0ff164ddfee93
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Nov 10 18:22:40 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Fri Nov 11 14:31:25 2022 +0100

    Clean up some seeming copy/paste mistakes
    
    ...all introduced with 2a26f136a36791c06caa895d5a25f4633fd10651 "tdf#151548 
vba
    FormFields: Add basic word::XFormField support":
    
    For the SwVbaFormField ctor, std::move of a const lvalue has no effect here.
    (And I just don't bother applying the move-from-pass-by-value-param 
optimization
    here.)
    
    For FormFieldCollectionHelper, consistently make the data members non-const 
(a
    const css::uno::Reference wouldn't make that much sense anyway, as it 
doesn't
    transitively apply const'ness also to the referenced object) and 
non-reference,
    and make the FormFieldCollectionHelper params non-const (and non-reference) 
to
    make the move-from-pass-by-value-param optimization actually work here.
    
    (I came across this code with an upcoming loplugin:constmove that flags
    suspicious uses of std::move involving const-qualified types.)
    
    Change-Id: Ib41d4671b33871eddff41bc20ea38de02d616046
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142568
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/sw/source/ui/vba/vbaformfield.cxx 
b/sw/source/ui/vba/vbaformfield.cxx
index 50008fc9c2b7..35e8927fe02e 100644
--- a/sw/source/ui/vba/vbaformfield.cxx
+++ b/sw/source/ui/vba/vbaformfield.cxx
@@ -45,7 +45,7 @@ SwVbaFormField::SwVbaFormField(const 
uno::Reference<ooo::vba::XHelperInterface>&
                                const uno::Reference<frame::XModel>& xModel,
                                sw::mark::IFieldmark& rFormField)
     : SwVbaFormField_BASE(rParent, rContext)
-    , mxModel(std::move(xModel))
+    , mxModel(xModel)
     , m_rFormField(rFormField)
 {
 }
diff --git a/sw/source/ui/vba/vbaformfields.cxx 
b/sw/source/ui/vba/vbaformfields.cxx
index cf82f72d7a01..d9b7b6200c1d 100644
--- a/sw/source/ui/vba/vbaformfields.cxx
+++ b/sw/source/ui/vba/vbaformfields.cxx
@@ -115,16 +115,16 @@ class FormFieldCollectionHelper
                                     container::XEnumerationAccess>
 {
 private:
-    const uno::Reference<XHelperInterface> mxParent;
-    const uno::Reference<uno::XComponentContext> mxContext;
-    const css::uno::Reference<frame::XModel>& mxModel;
+    uno::Reference<XHelperInterface> mxParent;
+    uno::Reference<uno::XComponentContext> mxContext;
+    css::uno::Reference<frame::XModel> mxModel;
     sw::mark::IFieldmark* m_pCache;
 
 public:
     /// @throws css::uno::RuntimeException
-    FormFieldCollectionHelper(const css::uno::Reference<ov::XHelperInterface> 
xParent,
-                              const 
css::uno::Reference<css::uno::XComponentContext> xContext,
-                              const css::uno::Reference<frame::XModel>& xModel)
+    FormFieldCollectionHelper(css::uno::Reference<ov::XHelperInterface> 
xParent,
+                              css::uno::Reference<css::uno::XComponentContext> 
xContext,
+                              css::uno::Reference<frame::XModel> xModel)
         : mxParent(std::move(xParent))
         , mxContext(std::move(xContext))
         , mxModel(std::move(xModel))

Reply via email to