From 93bea3531cff7f1e35a4c982836afbabfa587a6f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 29 Jul 2022 09:50:52 +0200 Subject: clang-tidy modernize-pass-by-value in writer* Change-Id: Ib08c971eb3e859e7b04cdd408af7966d83c2955b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137585 Tested-by: Jenkins Reviewed-by: Noel Grandin --- writerperfect/inc/ImportFilter.hxx | 5 +++-- writerperfect/source/calc/MSWorksCalcImportFilter.cxx | 5 +++-- writerperfect/source/common/DirectoryStream.cxx | 7 ++++--- writerperfect/source/common/WPXSvInputStream.cxx | 15 ++++++++------- writerperfect/source/writer/WordPerfectImportFilter.hxx | 6 +++--- 5 files changed, 21 insertions(+), 17 deletions(-) (limited to 'writerperfect') diff --git a/writerperfect/inc/ImportFilter.hxx b/writerperfect/inc/ImportFilter.hxx index f2cfb614d1b4..9923b834625b 100644 --- a/writerperfect/inc/ImportFilter.hxx +++ b/writerperfect/inc/ImportFilter.hxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -43,8 +44,8 @@ class ImportFilterImpl css::lang::XInitialization> { public: - ImportFilterImpl(const css::uno::Reference& rxContext) - : mxContext(rxContext) + ImportFilterImpl(css::uno::Reference xContext) + : mxContext(std::move(xContext)) { } diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx index b0118eaad5b7..bc13f9fc74b5 100644 --- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx +++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx @@ -32,6 +32,7 @@ #include #include +#include using namespace ::com::sun::star; @@ -71,8 +72,8 @@ class FolderStream : public librevenge::RVNGInputStream { public: //! constructor - explicit FolderStream(const css::uno::Reference& xContent) - : m_xContent(xContent) + explicit FolderStream(css::uno::Reference xContent) + : m_xContent(std::move(xContent)) { } diff --git a/writerperfect/source/common/DirectoryStream.cxx b/writerperfect/source/common/DirectoryStream.cxx index 28c38daa686b..9664fbee9750 100644 --- a/writerperfect/source/common/DirectoryStream.cxx +++ b/writerperfect/source/common/DirectoryStream.cxx @@ -39,6 +39,7 @@ #include #include +#include namespace io = com::sun::star::io; namespace sdbc = com::sun::star::sdbc; @@ -93,13 +94,13 @@ uno::Reference findStream(ucbhelper::Content& rContent, std::u struct DirectoryStream::Impl { - explicit Impl(const uno::Reference& rxContent); + explicit Impl(uno::Reference xContent); uno::Reference xContent; }; -DirectoryStream::Impl::Impl(const uno::Reference& rxContent) - : xContent(rxContent) +DirectoryStream::Impl::Impl(uno::Reference _xContent) + : xContent(std::move(_xContent)) { } diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx index 3364b0509d7e..45625927e3a1 100644 --- a/writerperfect/source/common/WPXSvInputStream.cxx +++ b/writerperfect/source/common/WPXSvInputStream.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include namespace writerperfect @@ -96,7 +97,7 @@ OUString concatPath(std::u16string_view lhs, const OUString& rhs) struct OLEStreamData { - OLEStreamData(const OString& rName, const OString& rvngName); + OLEStreamData(OString aName, OString rvngName); tools::SvRef stream; @@ -155,9 +156,9 @@ public: bool mbInitialized; }; -OLEStreamData::OLEStreamData(const OString& rName, const OString& rvngName) - : name(rName) - , RVNGname(rvngName) +OLEStreamData::OLEStreamData(OString aName, OString rvngName) + : name(std::move(aName)) + , RVNGname(std::move(rvngName)) { } @@ -265,7 +266,7 @@ namespace { struct ZipStreamData { - explicit ZipStreamData(const OString& rName); + explicit ZipStreamData(OString aName); Reference xStream; @@ -309,8 +310,8 @@ public: bool mbInitialized; }; -ZipStreamData::ZipStreamData(const OString& rName) - : aName(rName) +ZipStreamData::ZipStreamData(OString _aName) + : aName(std::move(_aName)) { } diff --git a/writerperfect/source/writer/WordPerfectImportFilter.hxx b/writerperfect/source/writer/WordPerfectImportFilter.hxx index a9fc331ae3a9..92a90699d8db 100644 --- a/writerperfect/source/writer/WordPerfectImportFilter.hxx +++ b/writerperfect/source/writer/WordPerfectImportFilter.hxx @@ -16,6 +16,7 @@ #include #include #include +#include /* This component will be instantiated for both import or export. Whether it calls * setSourceDocument or setTargetDocument determines which Impl function the filter @@ -32,9 +33,8 @@ class WordPerfectImportFilter bool importImpl(const css::uno::Sequence& aDescriptor); public: - explicit WordPerfectImportFilter( - const css::uno::Reference& rxContext) - : mxContext(rxContext) + explicit WordPerfectImportFilter(css::uno::Reference xContext) + : mxContext(std::move(xContext)) { } -- cgit