summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-11-10 18:22:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-11-11 14:31:25 +0100
commitd9c708f78de6f6ef6621b47123a0ff164ddfee93 (patch)
tree6e187f2b45b936f101a6a96f29f53781c03b0a3a /sw
parent5db9d8356c8fdc732942357cd2171ba27eda8647 (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/vba/vbaformfield.cxx2
-rw-r--r--sw/source/ui/vba/vbaformfields.cxx12
2 files changed, 7 insertions, 7 deletions
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))