From 81002bc718edad94613b20c2480719979b443b99 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 2 Aug 2022 13:42:33 +0200 Subject: clang-tidy modernize-pass-by-value in oox Change-Id: Ia553a24693f2ffc0f580c9869b82f0d01a1a0ffb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137693 Tested-by: Jenkins Reviewed-by: Noel Grandin --- oox/source/ppt/extdrawingfragmenthandler.cxx | 13 +++++++------ oox/source/ppt/extdrawingfragmenthandler.hxx | 6 +++--- oox/source/ppt/pptgraphicshapecontext.cxx | 5 +++-- oox/source/ppt/pptshapecontext.cxx | 5 +++-- oox/source/ppt/pptshapegroupcontext.cxx | 5 +++-- oox/source/ppt/slidemastertextstylescontext.cxx | 5 +++-- oox/source/ppt/slidepersist.cxx | 7 ++++--- oox/source/ppt/timenodelistcontext.cxx | 5 +++-- oox/source/ppt/timetargetelementcontext.cxx | 5 +++-- oox/source/ppt/timetargetelementcontext.hxx | 2 +- 10 files changed, 33 insertions(+), 25 deletions(-) (limited to 'oox/source/ppt') diff --git a/oox/source/ppt/extdrawingfragmenthandler.cxx b/oox/source/ppt/extdrawingfragmenthandler.cxx index 9aad170c1c4c..96cc02c1a32b 100644 --- a/oox/source/ppt/extdrawingfragmenthandler.cxx +++ b/oox/source/ppt/extdrawingfragmenthandler.cxx @@ -12,6 +12,7 @@ #include #include #include +#include using namespace ::oox::core; using namespace ::com::sun::star::xml::sax; @@ -21,15 +22,15 @@ namespace oox::ppt { ExtDrawingFragmentHandler::ExtDrawingFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, - const oox::ppt::SlidePersistPtr& rSlidePersistPtr, + oox::ppt::SlidePersistPtr pSlidePersistPtr, const oox::ppt::ShapeLocation eShapeLocation, - oox::drawingml::ShapePtr const & pGroupShapePtr, - oox::drawingml::ShapePtr const & pShapePtr) + oox::drawingml::ShapePtr pGroupShapePtr, + oox::drawingml::ShapePtr pShapePtr) : FragmentHandler2( rFilter, rFragmentPath ), - mpSlidePersistPtr (rSlidePersistPtr ), + mpSlidePersistPtr (std::move(pSlidePersistPtr )), meShapeLocation( eShapeLocation ), - mpGroupShapePtr( pGroupShapePtr ), - mpShapePtr( pShapePtr ) + mpGroupShapePtr(std::move( pGroupShapePtr )), + mpShapePtr(std::move( pShapePtr )) { } diff --git a/oox/source/ppt/extdrawingfragmenthandler.hxx b/oox/source/ppt/extdrawingfragmenthandler.hxx index 22406f3d998f..ddc828af4cfc 100644 --- a/oox/source/ppt/extdrawingfragmenthandler.hxx +++ b/oox/source/ppt/extdrawingfragmenthandler.hxx @@ -19,10 +19,10 @@ class ExtDrawingFragmentHandler : public ::oox::core::FragmentHandler2 { public: ExtDrawingFragmentHandler( oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, - const oox::ppt::SlidePersistPtr& rSlidePersistPtr, + oox::ppt::SlidePersistPtr pSlidePersistPtr, const oox::ppt::ShapeLocation eShapeLocation, - oox::drawingml::ShapePtr const & pGroupShapePtr, - oox::drawingml::ShapePtr const & pShapePtr ); + oox::drawingml::ShapePtr pGroupShapePtr, + oox::drawingml::ShapePtr pShapePtr ); virtual ~ExtDrawingFragmentHandler() noexcept override; virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const AttributeList& rAttribs ) override; diff --git a/oox/source/ppt/pptgraphicshapecontext.cxx b/oox/source/ppt/pptgraphicshapecontext.cxx index 3a29d1c76ed5..ff6b56a60184 100644 --- a/oox/source/ppt/pptgraphicshapecontext.cxx +++ b/oox/source/ppt/pptgraphicshapecontext.cxx @@ -28,6 +28,7 @@ #include #include #include +#include using namespace oox::core; using namespace ::com::sun::star; @@ -37,9 +38,9 @@ using namespace ::com::sun::star::text; namespace oox::ppt { // CT_Shape -PPTGraphicShapeContext::PPTGraphicShapeContext( ContextHandler2Helper const & rParent, const SlidePersistPtr& rSlidePersistPtr, const oox::drawingml::ShapePtr& pMasterShapePtr, const oox::drawingml::ShapePtr& pShapePtr ) +PPTGraphicShapeContext::PPTGraphicShapeContext( ContextHandler2Helper const & rParent, SlidePersistPtr pSlidePersistPtr, const oox::drawingml::ShapePtr& pMasterShapePtr, const oox::drawingml::ShapePtr& pShapePtr ) : oox::drawingml::GraphicShapeContext( rParent, pMasterShapePtr, pShapePtr ) -, mpSlidePersistPtr( rSlidePersistPtr ) +, mpSlidePersistPtr(std::move( pSlidePersistPtr )) { } diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx index 82d6908ef036..f127c3a2a23f 100644 --- a/oox/source/ppt/pptshapecontext.cxx +++ b/oox/source/ppt/pptshapecontext.cxx @@ -31,6 +31,7 @@ #include #include #include +#include using namespace oox::core; using namespace ::com::sun::star; @@ -40,9 +41,9 @@ using namespace ::com::sun::star::text; namespace oox::ppt { // CT_Shape -PPTShapeContext::PPTShapeContext( ContextHandler2Helper const & rParent, const SlidePersistPtr& rSlidePersistPtr, const oox::drawingml::ShapePtr& pMasterShapePtr, const oox::drawingml::ShapePtr& pShapePtr ) +PPTShapeContext::PPTShapeContext( ContextHandler2Helper const & rParent, SlidePersistPtr pSlidePersistPtr, const oox::drawingml::ShapePtr& pMasterShapePtr, const oox::drawingml::ShapePtr& pShapePtr ) : oox::drawingml::ShapeContext( rParent, pMasterShapePtr, pShapePtr ) -, mpSlidePersistPtr( rSlidePersistPtr ) +, mpSlidePersistPtr(std::move( pSlidePersistPtr )) { } diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx index 6c6a340a9f8a..dcce466fefd2 100644 --- a/oox/source/ppt/pptshapegroupcontext.cxx +++ b/oox/source/ppt/pptshapegroupcontext.cxx @@ -35,6 +35,7 @@ #include "extdrawingfragmenthandler.hxx" #include #include +#include using namespace oox::core; using namespace ::com::sun::star; @@ -47,12 +48,12 @@ namespace oox::ppt { PPTShapeGroupContext::PPTShapeGroupContext( FragmentHandler2 const & rParent, - const oox::ppt::SlidePersistPtr& rSlidePersistPtr, + oox::ppt::SlidePersistPtr pSlidePersistPtr, const ShapeLocation eShapeLocation, const oox::drawingml::ShapePtr& pMasterShapePtr, const oox::drawingml::ShapePtr& pGroupShapePtr ) : ShapeGroupContext( rParent, pMasterShapePtr, pGroupShapePtr ) -, mpSlidePersistPtr( rSlidePersistPtr ) +, mpSlidePersistPtr(std::move( pSlidePersistPtr )) , meShapeLocation( eShapeLocation ) { } diff --git a/oox/source/ppt/slidemastertextstylescontext.cxx b/oox/source/ppt/slidemastertextstylescontext.cxx index de326c9bb8a1..a069bbe28c8d 100644 --- a/oox/source/ppt/slidemastertextstylescontext.cxx +++ b/oox/source/ppt/slidemastertextstylescontext.cxx @@ -21,6 +21,7 @@ #include #include #include +#include using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -28,9 +29,9 @@ using namespace ::com::sun::star::xml::sax; namespace oox::ppt { -SlideMasterTextStylesContext::SlideMasterTextStylesContext( FragmentHandler2 const & rParent, SlidePersistPtr const & pSlidePersistPtr ) +SlideMasterTextStylesContext::SlideMasterTextStylesContext( FragmentHandler2 const & rParent, SlidePersistPtr pSlidePersistPtr ) : FragmentHandler2( rParent ) -, mpSlidePersistPtr( pSlidePersistPtr ) +, mpSlidePersistPtr(std::move( pSlidePersistPtr )) { } diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index 8d45bcdb7947..4b590e38cbd0 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -44,6 +44,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::oox::core; @@ -57,14 +58,14 @@ namespace oox::ppt { SlidePersist::SlidePersist( XmlFilterBase& rFilter, bool bMaster, bool bNotes, const css::uno::Reference< css::drawing::XDrawPage >& rxPage, - oox::drawingml::ShapePtr const & pShapesPtr, const drawingml::TextListStylePtr & pDefaultTextStyle ) + oox::drawingml::ShapePtr pShapesPtr, drawingml::TextListStylePtr pDefaultTextStyle ) : mpDrawingPtr( std::make_shared( rFilter, rxPage, oox::vml::VMLDRAWING_POWERPOINT ) ) , mxPage( rxPage ) -, maShapesPtr( pShapesPtr ) +, maShapesPtr(std::move( pShapesPtr )) , mnLayoutValueToken( 0 ) , mbMaster( bMaster ) , mbNotes ( bNotes ) -, maDefaultTextStylePtr( pDefaultTextStyle ) +, maDefaultTextStylePtr(std::move( pDefaultTextStyle )) , maTitleTextStylePtr( std::make_shared() ) , maBodyTextStylePtr( std::make_shared() ) , maNotesTextStylePtr( std::make_shared() ) diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx index 3be3fea7ff9d..728cbb5b970b 100644 --- a/oox/source/ppt/timenodelistcontext.cxx +++ b/oox/source/ppt/timenodelistcontext.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include "animvariantcontext.hxx" #include "commonbehaviorcontext.hxx" @@ -960,10 +961,10 @@ namespace oox::ppt { } TimeNodeContext::TimeNodeContext( FragmentHandler2 const & rParent, sal_Int32 aElement, - const TimeNodePtr & pNode ) noexcept + TimeNodePtr pNode ) noexcept : FragmentHandler2( rParent ) , mnElement( aElement ) - , mpNode( pNode ) + , mpNode(std::move( pNode )) { } diff --git a/oox/source/ppt/timetargetelementcontext.cxx b/oox/source/ppt/timetargetelementcontext.cxx index a6ced3ea90b4..a4003ee1ad37 100644 --- a/oox/source/ppt/timetargetelementcontext.cxx +++ b/oox/source/ppt/timetargetelementcontext.cxx @@ -31,6 +31,7 @@ #include #include #include +#include using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; @@ -100,9 +101,9 @@ namespace oox::ppt { } - TimeTargetElementContext::TimeTargetElementContext( FragmentHandler2 const & rParent, const AnimTargetElementPtr & pValue ) + TimeTargetElementContext::TimeTargetElementContext( FragmentHandler2 const & rParent, AnimTargetElementPtr pValue ) : FragmentHandler2( rParent ), - mpTarget( pValue ) + mpTarget(std::move( pValue )) { OSL_ENSURE( mpTarget, "no valid target passed" ); } diff --git a/oox/source/ppt/timetargetelementcontext.hxx b/oox/source/ppt/timetargetelementcontext.hxx index 29fed88b6aa1..d420c9e73595 100644 --- a/oox/source/ppt/timetargetelementcontext.hxx +++ b/oox/source/ppt/timetargetelementcontext.hxx @@ -30,7 +30,7 @@ namespace oox::ppt { : public ::oox::core::FragmentHandler2 { public: - TimeTargetElementContext( ::oox::core::FragmentHandler2 const & rParent, const AnimTargetElementPtr & aValue ); + TimeTargetElementContext( ::oox::core::FragmentHandler2 const & rParent, AnimTargetElementPtr aValue ); virtual ~TimeTargetElementContext( ) noexcept override; virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) override; -- cgit