diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-28 10:48:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-28 12:43:04 +0200 |
commit | 86ec14169cd0811a1ce8ee1e32cd7cad43cb0653 (patch) | |
tree | 7685f6bb7644bfbf9c8a7199a0d3ed505d5fbf17 /include | |
parent | 2bf18879d77b6f4e7e8b54267157741f11fb8c5b (diff) |
clang-tidy modernize-pass-by-value in vbahelper
Change-Id: I7f2a7dd3e8f0a791496f5e021bd802dba89d7643
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136559
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/vbahelper/vbacollectionimpl.hxx | 13 | ||||
-rw-r--r-- | include/vbahelper/vbadialogbase.hxx | 3 | ||||
-rw-r--r-- | include/vbahelper/vbadialogsbase.hxx | 3 | ||||
-rw-r--r-- | include/vbahelper/vbadocumentbase.hxx | 2 | ||||
-rw-r--r-- | include/vbahelper/vbahelper.hxx | 2 | ||||
-rw-r--r-- | include/vbahelper/vbahelperinterface.hxx | 3 | ||||
-rw-r--r-- | include/vbahelper/vbashape.hxx | 2 | ||||
-rw-r--r-- | include/vbahelper/vbashaperange.hxx | 2 | ||||
-rw-r--r-- | include/vbahelper/vbashapes.hxx | 2 | ||||
-rw-r--r-- | include/vbahelper/vbatextframe.hxx | 2 |
10 files changed, 19 insertions, 15 deletions
diff --git a/include/vbahelper/vbacollectionimpl.hxx b/include/vbahelper/vbacollectionimpl.hxx index 7b3af3e55511..90bfb51d59a5 100644 --- a/include/vbahelper/vbacollectionimpl.hxx +++ b/include/vbahelper/vbacollectionimpl.hxx @@ -21,6 +21,7 @@ #define INCLUDED_VBAHELPER_VBACOLLECTIONIMPL_HXX #include <exception> +#include <utility> #include <vector> #include <com/sun/star/container/NoSuchElementException.hpp> @@ -71,8 +72,8 @@ class VBAHELPER_DLLPUBLIC SimpleIndexAccessToEnumeration final : public Enumerat public: /// @throws css::uno::RuntimeException explicit SimpleIndexAccessToEnumeration( - const css::uno::Reference< css::container::XIndexAccess >& rxIndexAccess ) : - mxIndexAccess( rxIndexAccess ), mnIndex( 0 ) {} + css::uno::Reference< css::container::XIndexAccess > xIndexAccess ) : + mxIndexAccess(std::move( xIndexAccess )), mnIndex( 0 ) {} virtual sal_Bool SAL_CALL hasMoreElements() override { @@ -135,7 +136,7 @@ protected: css::uno::Reference< css::container::XEnumeration > m_xEnumeration; public: /// @throws css::uno::RuntimeException - EnumerationHelperImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XEnumeration >& xEnumeration ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration ) { } + EnumerationHelperImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, css::uno::Reference< css::uno::XComponentContext > xContext, css::uno::Reference< css::container::XEnumeration > xEnumeration ) : m_xParent( xParent ), m_xContext(std::move( xContext )), m_xEnumeration(std::move( xEnumeration )) { } virtual sal_Bool SAL_CALL hasMoreElements( ) override { return m_xEnumeration->hasMoreElements(); } }; @@ -157,7 +158,7 @@ private: XNamedVec mXNamedVec; typename XNamedVec::iterator mIt; public: - XNamedEnumerationHelper( const XNamedVec& sMap ) : mXNamedVec( sMap ), mIt( mXNamedVec.begin() ) {} + XNamedEnumerationHelper( XNamedVec sMap ) : mXNamedVec(std::move( sMap )), mIt( mXNamedVec.begin() ) {} virtual sal_Bool SAL_CALL hasMoreElements( ) override { @@ -175,7 +176,7 @@ private: XNamedVec mXNamedVec; typename XNamedVec::iterator cachePos; public: - XNamedObjectCollectionHelper( const XNamedVec& sMap ) : mXNamedVec( sMap ), cachePos(mXNamedVec.begin()) {} + XNamedObjectCollectionHelper( XNamedVec sMap ) : mXNamedVec(std::move( sMap )), cachePos(mXNamedVec.begin()) {} // XElementAccess virtual css::uno::Type SAL_CALL getElementType( ) override { return cppu::UnoType< OneIfc >::get(); } virtual sal_Bool SAL_CALL hasElements( ) override { return ( mXNamedVec.size() > 0 ); } @@ -283,7 +284,7 @@ protected: } public: - ScVbaCollectionBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, bool bIgnoreCase = false ) : BaseColBase( xParent, xContext ), m_xIndexAccess( xIndexAccess ), mbIgnoreCase( bIgnoreCase ) { m_xNameAccess.set(m_xIndexAccess, css::uno::UNO_QUERY); } + ScVbaCollectionBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::container::XIndexAccess > xIndexAccess, bool bIgnoreCase = false ) : BaseColBase( xParent, xContext ), m_xIndexAccess(std::move( xIndexAccess )), mbIgnoreCase( bIgnoreCase ) { m_xNameAccess.set(m_xIndexAccess, css::uno::UNO_QUERY); } //XCollection virtual ::sal_Int32 SAL_CALL getCount() override diff --git a/include/vbahelper/vbadialogbase.hxx b/include/vbahelper/vbadialogbase.hxx index 3125e5da2d59..751429cd4531 100644 --- a/include/vbahelper/vbadialogbase.hxx +++ b/include/vbahelper/vbadialogbase.hxx @@ -27,6 +27,7 @@ #include <rtl/ustring.hxx> #include <sal/types.h> #include <vbahelper/vbadllapi.h> +#include <utility> #include <vbahelper/vbahelper.hxx> #include <vbahelper/vbahelperinterface.hxx> @@ -48,7 +49,7 @@ protected: sal_Int32 mnIndex; css::uno::Reference< css::frame::XModel > m_xModel; public: - VbaDialogBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel, sal_Int32 nIndex ):VbaDialogBase_BASE( xParent, xContext ), mnIndex( nIndex ), m_xModel( xModel ) {} + VbaDialogBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::frame::XModel > xModel, sal_Int32 nIndex ):VbaDialogBase_BASE( xParent, xContext ), mnIndex( nIndex ), m_xModel(std::move( xModel )) {} // Methods virtual void SAL_CALL Show() override; diff --git a/include/vbahelper/vbadialogsbase.hxx b/include/vbahelper/vbadialogsbase.hxx index 9b04b40cf906..6f44d825bec9 100644 --- a/include/vbahelper/vbadialogsbase.hxx +++ b/include/vbahelper/vbadialogsbase.hxx @@ -27,6 +27,7 @@ #include <ooo/vba/XDialogsBase.hpp> #include <sal/types.h> #include <vbahelper/vbadllapi.h> +#include <utility> #include <vbahelper/vbahelper.hxx> #include <vbahelper/vbahelperinterface.hxx> @@ -47,7 +48,7 @@ class VBAHELPER_DLLPUBLIC VbaDialogsBase : public VbaDialogsBase_BASE protected: css::uno::Reference< css::frame::XModel > m_xModel; public: - VbaDialogsBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel ): VbaDialogsBase_BASE( xParent, xContext ), m_xModel( xModel ) {} + VbaDialogsBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, css::uno::Reference< css::frame::XModel > xModel ): VbaDialogsBase_BASE( xParent, xContext ), m_xModel(std::move( xModel )) {} // XCollection virtual ::sal_Int32 SAL_CALL getCount() override; diff --git a/include/vbahelper/vbadocumentbase.hxx b/include/vbahelper/vbadocumentbase.hxx index 60a0bbed9158..c26ae30d8188 100644 --- a/include/vbahelper/vbadocumentbase.hxx +++ b/include/vbahelper/vbadocumentbase.hxx @@ -54,7 +54,7 @@ protected: const css::uno::Reference< css::frame::XModel >& getModel() const { return mxModel; } public: VbaDocumentBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, - css::uno::Reference< css::frame::XModel > const & xModel ); + css::uno::Reference< css::frame::XModel > xModel ); VbaDocumentBase( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ); // Attributes diff --git a/include/vbahelper/vbahelper.hxx b/include/vbahelper/vbahelper.hxx index fd4549cf99a8..07c5fce6ec6b 100644 --- a/include/vbahelper/vbahelper.hxx +++ b/include/vbahelper/vbahelper.hxx @@ -178,7 +178,7 @@ class VBAHELPER_DLLPUBLIC ShapeHelper public: /// @throws css::script::BasicErrorException /// @throws css::uno::RuntimeException - ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xShape); + ShapeHelper( css::uno::Reference< css::drawing::XShape > _xShape); double getHeight() const; void setHeight(double _fheight); diff --git a/include/vbahelper/vbahelperinterface.hxx b/include/vbahelper/vbahelperinterface.hxx index c7fb615b1f5a..315fcd4f900b 100644 --- a/include/vbahelper/vbahelperinterface.hxx +++ b/include/vbahelper/vbahelperinterface.hxx @@ -30,6 +30,7 @@ #include <ooo/vba/XHelperInterface.hpp> #include <rtl/ustring.hxx> #include <sal/types.h> +#include <utility> #include <vbahelper/vbahelper.hxx> // use this class when you have an object like @@ -66,7 +67,7 @@ protected: css::uno::WeakReference< ov::XHelperInterface > mxParent; css::uno::Reference< css::uno::XComponentContext > mxContext; public: - InheritedHelperInterfaceImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : mxParent( xParent ), mxContext( xContext ) {} + InheritedHelperInterfaceImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, css::uno::Reference< css::uno::XComponentContext > xContext ) : mxParent( xParent ), mxContext(std::move( xContext )) {} virtual OUString getServiceImplName() = 0; virtual css::uno::Sequence<OUString> getServiceNames() = 0; diff --git a/include/vbahelper/vbashape.hxx b/include/vbahelper/vbashape.hxx index d6a79968bbfb..11ac68780193 100644 --- a/include/vbahelper/vbashape.hxx +++ b/include/vbahelper/vbashape.hxx @@ -76,7 +76,7 @@ protected: public: /// @throws css::lang::IllegalArgumentException /// @throws css::uno::RuntimeException - ScVbaShape( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::drawing::XShapes >& xShapes, const css::uno::Reference< css::frame::XModel >& xModel, sal_Int32 nType ); + ScVbaShape( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::drawing::XShape > xShape, css::uno::Reference< css::drawing::XShapes > xShapes, css::uno::Reference< css::frame::XModel > xModel, sal_Int32 nType ); virtual ~ScVbaShape() override; /// @throws css::uno::RuntimeException diff --git a/include/vbahelper/vbashaperange.hxx b/include/vbahelper/vbashaperange.hxx index 54a052cac0dd..dfcca6c82549 100644 --- a/include/vbahelper/vbashaperange.hxx +++ b/include/vbahelper/vbashaperange.hxx @@ -62,7 +62,7 @@ private: /// @throws css::uno::RuntimeException css::uno::Reference< css::drawing::XShapes > const & getShapes() ; public: - ScVbaShapeRange( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xShapes, const css::uno::Reference< css::drawing::XDrawPage>& xDrawShape, const css::uno::Reference< css::frame::XModel >& xModel ); + ScVbaShapeRange( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xShapes, css::uno::Reference< css::drawing::XDrawPage> xDrawShape, css::uno::Reference< css::frame::XModel > xModel ); // Methods virtual void SAL_CALL Select( ) override; diff --git a/include/vbahelper/vbashapes.hxx b/include/vbahelper/vbashapes.hxx index 16d40566a686..7131d8118031 100644 --- a/include/vbahelper/vbashapes.hxx +++ b/include/vbahelper/vbashapes.hxx @@ -77,7 +77,7 @@ private: //css::awt::Point calculateTopLeftMargin( css::uno::Reference< ov::XHelperInterface > xDocument ); public: - ScVbaShapes( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xShapes, const css::uno::Reference< css::frame::XModel >& xModel ); + ScVbaShapes( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xShapes, css::uno::Reference< css::frame::XModel > xModel ); /// @throws css::uno::RuntimeException static void setDefaultShapeProperties( const css::uno::Reference< css::drawing::XShape >& xShape ); static void setShape_NameProperty( const css::uno::Reference< css::drawing::XShape >& xShape, const OUString& sName ); diff --git a/include/vbahelper/vbatextframe.hxx b/include/vbahelper/vbatextframe.hxx index a93c511a8a39..3c8651bc4704 100644 --- a/include/vbahelper/vbatextframe.hxx +++ b/include/vbahelper/vbatextframe.hxx @@ -56,7 +56,7 @@ protected: sal_Int32 getMargin( const OUString& sMarginType ); void setMargin( const OUString& sMarginType, float fMargin ); public: - VbaTextFrame( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext , css::uno::Reference< css::drawing::XShape > const & xShape); + VbaTextFrame( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext , css::uno::Reference< css::drawing::XShape > xShape); // Attributes virtual sal_Bool SAL_CALL getAutoSize() override; virtual void SAL_CALL setAutoSize( sal_Bool _autosize ) override; |