From 17a2c9e8e2361de27013a25e51f3a3ca729f1b31 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 5 Jun 2017 08:34:22 +0200 Subject: clang-tidy performance-unnecessary-value-param Change-Id: I6ed8c54c7c45931d91709cc818f2483c70197192 Reviewed-on: https://gerrit.libreoffice.org/38400 Tested-by: Jenkins Reviewed-by: Noel Grandin --- oox/inc/drawingml/table/tablecontext.hxx | 2 +- oox/inc/drawingml/textbody.hxx | 2 +- oox/source/core/relationshandler.cxx | 2 +- oox/source/drawingml/connectorshapecontext.cxx | 2 +- oox/source/drawingml/graphicshapecontext.cxx | 8 ++++---- oox/source/drawingml/table/tablecontext.cxx | 2 +- oox/source/drawingml/textbody.cxx | 2 +- oox/source/export/chartexport.cxx | 3 ++- oox/source/export/shapes.cxx | 3 ++- oox/source/ppt/layoutfragmenthandler.cxx | 3 ++- oox/source/ppt/pptgraphicshapecontext.cxx | 2 +- oox/source/ppt/pptimport.cxx | 2 +- oox/source/ppt/pptshapecontext.cxx | 2 +- oox/source/ppt/pptshapegroupcontext.cxx | 4 ++-- oox/source/ppt/slidefragmenthandler.cxx | 2 +- 15 files changed, 22 insertions(+), 19 deletions(-) (limited to 'oox') diff --git a/oox/inc/drawingml/table/tablecontext.hxx b/oox/inc/drawingml/table/tablecontext.hxx index 00545a8e8d64..4157347e73ce 100644 --- a/oox/inc/drawingml/table/tablecontext.hxx +++ b/oox/inc/drawingml/table/tablecontext.hxx @@ -29,7 +29,7 @@ class TableProperties; class TableContext : public ShapeContext { public: - TableContext( ::oox::core::ContextHandler2Helper& rParent, ShapePtr pShapePtr ); + TableContext( ::oox::core::ContextHandler2Helper& rParent, const ShapePtr& pShapePtr ); virtual ~TableContext() override; virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override; diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx index 043529723e76..c2b0c5acc762 100644 --- a/oox/inc/drawingml/textbody.hxx +++ b/oox/inc/drawingml/textbody.hxx @@ -40,7 +40,7 @@ class TextBody { public: TextBody(); - TextBody( TextBodyPtr pBody ); + TextBody( const TextBodyPtr& pBody ); ~TextBody(); const TextParagraphVector& getParagraphs() const { return maParagraphs; } diff --git a/oox/source/core/relationshandler.cxx b/oox/source/core/relationshandler.cxx index b848002f754f..e5228313a690 100644 --- a/oox/source/core/relationshandler.cxx +++ b/oox/source/core/relationshandler.cxx @@ -50,7 +50,7 @@ OUString lclGetRelationsPath( const OUString& rFragmentPath ) } // namespace -RelationsFragment::RelationsFragment( XmlFilterBase& rFilter, RelationsRef xRelations ) : +RelationsFragment::RelationsFragment( XmlFilterBase& rFilter, const RelationsRef& xRelations ) : FragmentHandler( rFilter, lclGetRelationsPath( xRelations->getFragmentPath() ), xRelations ), mxRelations( xRelations ) { diff --git a/oox/source/drawingml/connectorshapecontext.cxx b/oox/source/drawingml/connectorshapecontext.cxx index 284d193a3182..26946dd163c1 100644 --- a/oox/source/drawingml/connectorshapecontext.cxx +++ b/oox/source/drawingml/connectorshapecontext.cxx @@ -42,7 +42,7 @@ using namespace ::com::sun::star::xml::sax; namespace oox { namespace drawingml { ConnectorShapeContext::ConnectorShapeContext( ContextHandler2Helper& rParent, - ShapePtr pMasterShapePtr, ShapePtr pGroupShapePtr ) + const ShapePtr& pMasterShapePtr, const ShapePtr& pGroupShapePtr ) : ShapeContext( rParent, pMasterShapePtr, pGroupShapePtr ) { } diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx index fa59e0a3c046..db77409cb0bb 100644 --- a/oox/source/drawingml/graphicshapecontext.cxx +++ b/oox/source/drawingml/graphicshapecontext.cxx @@ -71,7 +71,7 @@ namespace drawingml { // CT_Picture -GraphicShapeContext::GraphicShapeContext( ContextHandler2Helper& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr ) +GraphicShapeContext::GraphicShapeContext( ContextHandler2Helper& rParent, const ShapePtr& pMasterShapePtr, const ShapePtr& pShapePtr ) : ShapeContext( rParent, pMasterShapePtr, pShapePtr ) { } @@ -121,7 +121,7 @@ ContextHandlerRef GraphicShapeContext::onCreateContext( sal_Int32 aElementToken, // CT_GraphicalObjectFrameContext -GraphicalObjectFrameContext::GraphicalObjectFrameContext( ContextHandler2Helper& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr, bool bEmbedShapesInChart ) : +GraphicalObjectFrameContext::GraphicalObjectFrameContext( ContextHandler2Helper& rParent, const ShapePtr& pMasterShapePtr, const ShapePtr& pShapePtr, bool bEmbedShapesInChart ) : ShapeContext( rParent, pMasterShapePtr, pShapePtr ), mbEmbedShapesInChart( bEmbedShapesInChart ), mpParent(&rParent) @@ -177,7 +177,7 @@ void GraphicalObjectFrameContext::onEndElement() } } -OleObjectGraphicDataContext::OleObjectGraphicDataContext( ContextHandler2Helper& rParent, ShapePtr xShape ) : +OleObjectGraphicDataContext::OleObjectGraphicDataContext( ContextHandler2Helper& rParent, const ShapePtr& xShape ) : ShapeContext( rParent, ShapePtr(), xShape ), mrOleObjectInfo( xShape->setOleObjectType() ) { @@ -237,7 +237,7 @@ ContextHandlerRef OleObjectGraphicDataContext::onCreateContext( sal_Int32 nEleme return nullptr; } -DiagramGraphicDataContext::DiagramGraphicDataContext( ContextHandler2Helper& rParent, ShapePtr pShapePtr ) +DiagramGraphicDataContext::DiagramGraphicDataContext( ContextHandler2Helper& rParent, const ShapePtr& pShapePtr ) : ShapeContext( rParent, ShapePtr(), pShapePtr ) { pShapePtr->setDiagramType(); diff --git a/oox/source/drawingml/table/tablecontext.cxx b/oox/source/drawingml/table/tablecontext.cxx index 93308773d989..2cfe580f8abe 100644 --- a/oox/source/drawingml/table/tablecontext.cxx +++ b/oox/source/drawingml/table/tablecontext.cxx @@ -31,7 +31,7 @@ using namespace ::com::sun::star; namespace oox { namespace drawingml { namespace table { -TableContext::TableContext( ContextHandler2Helper& rParent, ShapePtr pShapePtr ) +TableContext::TableContext( ContextHandler2Helper& rParent, const ShapePtr& pShapePtr ) : ShapeContext( rParent, ShapePtr(), pShapePtr ) , mrTableProperties( *pShapePtr->getTableProperties().get() ) { diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx index 8efb70d1cdd0..306bcf3ba384 100644 --- a/oox/source/drawingml/textbody.cxx +++ b/oox/source/drawingml/textbody.cxx @@ -36,7 +36,7 @@ TextBody::TextBody() { } -TextBody::TextBody( TextBodyPtr pBody ) +TextBody::TextBody( const TextBodyPtr& pBody ) { if( pBody.get() ) { maTextProperties = pBody->maTextProperties; diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index a079566182a4..25d70e8ee442 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -89,6 +89,7 @@ #include #include #include +#include #include #include "ColorPropertySet.hxx" @@ -430,7 +431,7 @@ sal_Int32 lcl_generateRandomValue() } ChartExport::ChartExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, Reference< frame::XModel >& xModel, XmlFilterBase* pFB, DocumentType eDocumentType ) - : DrawingML( pFS, pFB, eDocumentType ) + : DrawingML( std::move(pFS), pFB, eDocumentType ) , mnXmlNamespace( nXmlNamespace ) , mnSeriesCount(0) , mxChartModel( xModel ) diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 7d94310e0a11..7d3090c1cd65 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -81,6 +81,7 @@ #include #include #include +#include #include #include #include @@ -360,7 +361,7 @@ bool URLTransformer::isExternalURL(const OUString& /*rURL*/) const mAny >>= variable; ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, ShapeHashMap* pShapeMap, XmlFilterBase* pFB, DocumentType eDocumentType, DMLTextExport* pTextExport ) - : DrawingML( pFS, pFB, eDocumentType, pTextExport ) + : DrawingML( std::move(pFS), pFB, eDocumentType, pTextExport ) , m_nEmbeddedObjects(0) , mnShapeIdMax( 1 ) , mnPictureIdMax( 1 ) diff --git a/oox/source/ppt/layoutfragmenthandler.cxx b/oox/source/ppt/layoutfragmenthandler.cxx index 09af2df9e1cc..deaaf5387529 100644 --- a/oox/source/ppt/layoutfragmenthandler.cxx +++ b/oox/source/ppt/layoutfragmenthandler.cxx @@ -29,6 +29,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::oox::core; @@ -43,7 +44,7 @@ namespace oox { namespace ppt { LayoutFragmentHandler::LayoutFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, SlidePersistPtr pMasterPersistPtr ) throw() -: SlideFragmentHandler( rFilter, rFragmentPath, pMasterPersistPtr, Layout ) +: SlideFragmentHandler( rFilter, rFragmentPath, std::move(pMasterPersistPtr), Layout ) { } diff --git a/oox/source/ppt/pptgraphicshapecontext.cxx b/oox/source/ppt/pptgraphicshapecontext.cxx index 152872ffbdc8..826fad39ef68 100644 --- a/oox/source/ppt/pptgraphicshapecontext.cxx +++ b/oox/source/ppt/pptgraphicshapecontext.cxx @@ -48,7 +48,7 @@ using namespace ::com::sun::star::xml::sax; namespace oox { namespace ppt { // CT_Shape -PPTGraphicShapeContext::PPTGraphicShapeContext( ContextHandler2Helper& rParent, const SlidePersistPtr& rSlidePersistPtr, oox::drawingml::ShapePtr pMasterShapePtr, oox::drawingml::ShapePtr pShapePtr ) +PPTGraphicShapeContext::PPTGraphicShapeContext( ContextHandler2Helper& rParent, const SlidePersistPtr& rSlidePersistPtr, const oox::drawingml::ShapePtr& pMasterShapePtr, const oox::drawingml::ShapePtr& pShapePtr ) : oox::drawingml::GraphicShapeContext( rParent, pMasterShapePtr, pShapePtr ) , mpSlidePersistPtr( rSlidePersistPtr ) { diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index 474abb6278e2..6e3717fc9f10 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -87,7 +87,7 @@ PowerPointImport::~PowerPointImport() } /// Visits the relations from pRelations which are of type rType. -static void visitRelations(PowerPointImport& rImport, core::RelationsRef pRelations, const OUString& rType, std::vector& rImageFragments) +static void visitRelations(PowerPointImport& rImport, const core::RelationsRef& pRelations, const OUString& rType, std::vector& rImageFragments) { if (core::RelationsRef pRelationsOfType = pRelations->getRelationsFromTypeFromOfficeDoc(rType)) { diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx index 81e0cbb71fa8..d3348dcb1c1c 100644 --- a/oox/source/ppt/pptshapecontext.cxx +++ b/oox/source/ppt/pptshapecontext.cxx @@ -50,7 +50,7 @@ using namespace ::com::sun::star::xml::sax; namespace oox { namespace ppt { // CT_Shape -PPTShapeContext::PPTShapeContext( ContextHandler2Helper& rParent, const SlidePersistPtr& rSlidePersistPtr, oox::drawingml::ShapePtr pMasterShapePtr, oox::drawingml::ShapePtr pShapePtr ) +PPTShapeContext::PPTShapeContext( ContextHandler2Helper& rParent, const SlidePersistPtr& rSlidePersistPtr, const oox::drawingml::ShapePtr& pMasterShapePtr, const oox::drawingml::ShapePtr& pShapePtr ) : oox::drawingml::ShapeContext( rParent, pMasterShapePtr, pShapePtr ) , mpSlidePersistPtr( rSlidePersistPtr ) { diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx index 0847eb8bd331..4ad250a15cff 100644 --- a/oox/source/ppt/pptshapegroupcontext.cxx +++ b/oox/source/ppt/pptshapegroupcontext.cxx @@ -54,8 +54,8 @@ PPTShapeGroupContext::PPTShapeGroupContext( ContextHandler2Helper& rParent, const oox::ppt::SlidePersistPtr& rSlidePersistPtr, const ShapeLocation eShapeLocation, - oox::drawingml::ShapePtr pMasterShapePtr, - oox::drawingml::ShapePtr pGroupShapePtr ) + const oox::drawingml::ShapePtr& pMasterShapePtr, + const oox::drawingml::ShapePtr& pGroupShapePtr ) : ShapeGroupContext( rParent, pMasterShapePtr, pGroupShapePtr ) , mpSlidePersistPtr( rSlidePersistPtr ) , meShapeLocation( eShapeLocation ) diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx index 5b8a8b836377..9d6fcf16aa99 100644 --- a/oox/source/ppt/slidefragmenthandler.cxx +++ b/oox/source/ppt/slidefragmenthandler.cxx @@ -54,7 +54,7 @@ using namespace ::com::sun::star::container; namespace oox { namespace ppt { -SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, SlidePersistPtr pPersistPtr, const ShapeLocation eShapeLocation ) +SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, const SlidePersistPtr& pPersistPtr, const ShapeLocation eShapeLocation ) : FragmentHandler2( rFilter, rFragmentPath ) , mpSlidePersistPtr( pPersistPtr ) , meShapeLocation( eShapeLocation ) -- cgit