diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-28 09:49:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-28 10:42:37 +0200 |
commit | 44a11bb8c99e02ac3ac16b405377ea61ffa8841b (patch) | |
tree | fb7bac949b877c90518a35bd0278ef3dd51a2779 /xmlscript/source/xmldlg_imexp | |
parent | 7091a5416e6e1d5ff8c3b40646de30fe1458db24 (diff) |
clang-tidy modernize-pass-by-value in xml*
Change-Id: I9bd5f6adfd138c391d76aebfe08ba01e6b3ab3bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137550
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlscript/source/xmldlg_imexp')
-rw-r--r-- | xmlscript/source/xmldlg_imexp/exp_share.hxx | 13 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/imp_share.hxx | 27 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 5 |
3 files changed, 24 insertions, 21 deletions
diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx index 919950c79bef..55a53bcc13b8 100644 --- a/xmlscript/source/xmldlg_imexp/exp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx @@ -19,6 +19,7 @@ #pragma once +#include <utility> #include <xmlscript/xmldlg_imexp.hxx> #include <xmlscript/xml_helper.hxx> #include <osl/diagnose.h> @@ -93,13 +94,13 @@ class ElementDescriptor public: ElementDescriptor( - css::uno::Reference< css::beans::XPropertySet > const & xProps, - css::uno::Reference< css::beans::XPropertyState > const & xPropState, - OUString const & name, css::uno::Reference< css::frame::XModel > const & xDocument ) + css::uno::Reference< css::beans::XPropertySet > xProps, + css::uno::Reference< css::beans::XPropertyState > xPropState, + OUString const & name, css::uno::Reference< css::frame::XModel > xDocument ) : XMLElement( name ) - , _xProps( xProps ) - , _xPropState( xPropState ) - , _xDocument( xDocument ) + , _xProps(std::move( xProps )) + , _xPropState(std::move( xPropState )) + , _xDocument(std::move( xDocument )) {} explicit ElementDescriptor( OUString const & name ) diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index 12da217242de..ef418446998a 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -19,6 +19,7 @@ #pragma once +#include <utility> #include <xmlscript/xmldlg_imexp.hxx> #include <cppuhelper/implbase.hxx> #include <com/sun/star/uno/XComponentContext.hpp> @@ -143,16 +144,16 @@ public: const & getNumberFormatsSupplier(); DialogImport( - css::uno::Reference<css::uno::XComponentContext> const & xContext, + css::uno::Reference<css::uno::XComponentContext> xContext, css::uno::Reference<css::container::XNameContainer> const & xDialogModel, - std::shared_ptr< std::vector< OUString > > const & pStyleNames, - std::shared_ptr< std::vector< css::uno::Reference< css::xml::input::XElement > > > const & pStyles, - css::uno::Reference<css::frame::XModel> const & xDoc ) - : _xContext( xContext ) - , _pStyleNames( pStyleNames ) - , _pStyles( pStyles ) - , _xDoc( xDoc ) + std::shared_ptr< std::vector< OUString > > pStyleNames, + std::shared_ptr< std::vector< css::uno::Reference< css::xml::input::XElement > > > pStyles, + css::uno::Reference<css::frame::XModel> xDoc ) + : _xContext(std::move( xContext )) + , _pStyleNames(std::move( pStyleNames )) + , _pStyles(std::move( pStyles )) + , _xDoc(std::move( xDoc )) , _xDialogModel( xDialogModel ) , _xDialogModelFactory( xDialogModel, css::uno::UNO_QUERY_THROW ) , XMLNS_DIALOGS_UID( 0 ) @@ -204,7 +205,7 @@ protected: public: ElementBase( - sal_Int32 nUid, OUString const & rLocalName, + sal_Int32 nUid, OUString aLocalName, css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, ElementBase * pParent, DialogImport * pImport ); virtual ~ElementBase() override; @@ -371,11 +372,11 @@ protected: public: ImportContext( DialogImport * pImport, - css::uno::Reference< css::beans::XPropertySet > const & xControlModel_, - OUString const & id ) + css::uno::Reference< css::beans::XPropertySet > xControlModel_, + OUString id ) : _pImport( pImport ), - _xControlModel( xControlModel_ ), - _aId( id ) + _xControlModel(std::move( xControlModel_ )), + _aId(std::move( id )) { OSL_ASSERT( _xControlModel.is() ); } const css::uno::Reference< css::beans::XPropertySet >& getControlModel() const diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 5cac12605faf..ffe491405b92 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -19,6 +19,7 @@ #include "common.hxx" #include "imp_share.hxx" +#include <utility> #include <xml_import.hxx> #include <xmlscript/xmlns.h> @@ -1659,13 +1660,13 @@ Reference< xml::input::XElement > ElementBase::startChildElement( } ElementBase::ElementBase( - sal_Int32 nUid, OUString const & rLocalName, + sal_Int32 nUid, OUString aLocalName, Reference< xml::input::XAttributes > const & xAttributes, ElementBase * pParent, DialogImport * pImport ) : m_pImport( pImport ) , m_pParent( pParent ) , _nUid( nUid ) - , _aLocalName( rLocalName ) + , _aLocalName(std::move(aLocalName )) , _xAttributes( xAttributes ) { } |