From d60d957a680d9c98823aac05facb652bf619a750 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 13 Apr 2016 11:25:07 +0200 Subject: loplugin:passstuffbyref in oox Change-Id: Iec989e9060c77dd5b010224b37633179cee4f7e9 --- include/oox/core/fastparser.hxx | 2 +- include/oox/drawingml/color.hxx | 4 ++-- include/oox/drawingml/shape.hxx | 10 +++++----- include/oox/drawingml/shapecontext.hxx | 2 +- include/oox/export/chartexport.hxx | 2 +- include/oox/export/drawingml.hxx | 2 +- include/oox/export/vmlexport.hxx | 2 +- include/oox/helper/attributelist.hxx | 2 +- include/oox/helper/grabbagstack.hxx | 2 +- include/oox/helper/propertyset.hxx | 2 +- include/oox/ole/axcontrol.hxx | 2 +- include/oox/ole/vbacontrol.hxx | 4 ++-- include/oox/ppt/comments.hxx | 4 ++-- include/oox/ppt/pptimport.hxx | 4 ++-- include/oox/ppt/slidepersist.hxx | 28 ++++++++++++++-------------- oox/inc/drawingml/table/tablecell.hxx | 2 +- oox/source/drawingml/customshapegeometry.cxx | 2 +- oox/source/drawingml/diagram/diagram.hxx | 2 +- oox/source/ole/olehelper.cxx | 4 ++-- oox/source/shape/LockedCanvasContext.hxx | 2 +- oox/source/shape/WpgContext.hxx | 2 +- oox/source/shape/WpsContext.hxx | 2 +- 22 files changed, 44 insertions(+), 44 deletions(-) diff --git a/include/oox/core/fastparser.hxx b/include/oox/core/fastparser.hxx index b1e42947e7ae..d8d2ced7ef08 100644 --- a/include/oox/core/fastparser.hxx +++ b/include/oox/core/fastparser.hxx @@ -74,7 +74,7 @@ public: void parseStream( StorageBase& rStorage, const OUString& rStreamName ) throw( css::xml::sax::SAXException, css::io::IOException, css::uno::RuntimeException ); - css::uno::Reference< css::xml::sax::XFastTokenHandler > + const css::uno::Reference< css::xml::sax::XFastTokenHandler >& getTokenHandler() const { return mxTokenHandler; } private: diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx index 98352cbc11e8..9f94c4d91489 100644 --- a/include/oox/drawingml/color.hxx +++ b/include/oox/drawingml/color.hxx @@ -94,9 +94,9 @@ public: sal_Int16 getTransparency() const; /** Returns the scheme name from the a:schemeClr element for interoperability purposes */ - OUString getSchemeName() const { return msSchemeName; } + const OUString& getSchemeName() const { return msSchemeName; } /** Returns the unaltered list of transformations for interoperability purposes */ - css::uno::Sequence< css::beans::PropertyValue > getTransformations() const { return maInteropTransformations;} + const css::uno::Sequence< css::beans::PropertyValue >& getTransformations() const { return maInteropTransformations;} /** Translates between color transformation tokens and their names */ static OUString getColorTransformationName( sal_Int32 nElement ); diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx index c0c25100fd6a..63c0bbb4507c 100644 --- a/include/oox/drawingml/shape.hxx +++ b/include/oox/drawingml/shape.hxx @@ -94,7 +94,7 @@ public: GraphicProperties& getGraphicProperties() { return *mpGraphicPropertiesPtr; } const GraphicProperties& getGraphicProperties() const { return *mpGraphicPropertiesPtr; } - CustomShapePropertiesPtr getCustomShapeProperties(){ return mpCustomShapePropertiesPtr; } + CustomShapePropertiesPtr& getCustomShapeProperties(){ return mpCustomShapePropertiesPtr; } Shape3DProperties& get3DProperties() { return *mp3DPropertiesPtr; } const Shape3DProperties& get3DProperties() const { return *mp3DPropertiesPtr; } @@ -118,9 +118,9 @@ public: std::vector< ShapePtr >& getChildren() { return maChildren; } void setName( const OUString& rName ) { msName = rName; } - OUString getName( ) { return msName; } + const OUString& getName( ) { return msName; } void setId( const OUString& rId ) { msId = rId; } - OUString getId() { return msId; } + const OUString& getId() { return msId; } void setHidden( bool bHidden ) { mbHidden = bHidden; } void setHiddenMasterShape( bool bHiddenMasterShape ) { mbHiddenMasterShape = bHiddenMasterShape; } void setSubType( sal_Int32 nSubType ) { mnSubType = nSubType; } @@ -137,9 +137,9 @@ public: void setTableType(); void setTextBody(const TextBodyPtr & pTextBody); - TextBodyPtr getTextBody() { return mpTextBody;} + const TextBodyPtr& getTextBody() { return mpTextBody;} void setMasterTextListStyle( const TextListStylePtr& pMasterTextListStyle ); - TextListStylePtr getMasterTextListStyle() const { return mpMasterTextListStyle; } + const TextListStylePtr& getMasterTextListStyle() const { return mpMasterTextListStyle; } ShapeStyleRefMap& getShapeStyleRefs() { return maShapeStyleRefs; } const ShapeStyleRefMap& getShapeStyleRefs() const { return maShapeStyleRefs; } diff --git a/include/oox/drawingml/shapecontext.hxx b/include/oox/drawingml/shapecontext.hxx index 63c3beccf014..8ec0e691d869 100644 --- a/include/oox/drawingml/shapecontext.hxx +++ b/include/oox/drawingml/shapecontext.hxx @@ -36,7 +36,7 @@ public: virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override; - ShapePtr getShape() { return mpShapePtr;} + const ShapePtr& getShape() { return mpShapePtr;} protected: diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx index 7fa4664ab6ed..c813ebf94d6d 100644 --- a/include/oox/export/chartexport.hxx +++ b/include/oox/export/chartexport.hxx @@ -207,7 +207,7 @@ public: virtual ~ChartExport() {} sal_Int32 GetChartID( ); - css::uno::Reference< css::frame::XModel > getModel(){ return mxChartModel; } + const css::uno::Reference< css::frame::XModel >& getModel(){ return mxChartModel; } void WriteChartObj( const css::uno::Reference< css::drawing::XShape >& xShape, sal_Int32 nChartCount ); diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index fe2a8c78bbe7..e406ba75cddd 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -129,7 +129,7 @@ public: DrawingML( ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = nullptr, DocumentType eDocumentType = DOCUMENT_PPTX, DMLTextExport* pTextExport = nullptr ) : meDocumentType( eDocumentType ), mpTextExport(pTextExport), mpFS( pFS ), mpFB( pFB ), mbIsBackgroundDark( false ) {} void SetFS( ::sax_fastparser::FSHelperPtr pFS ) { mpFS = pFS; } - ::sax_fastparser::FSHelperPtr GetFS() { return mpFS; } + const ::sax_fastparser::FSHelperPtr& GetFS() { return mpFS; } ::oox::core::XmlFilterBase* GetFB() { return mpFB; } DocumentType GetDocumentType() { return meDocumentType; } /// The application-specific text exporter callback, if there is one. diff --git a/include/oox/export/vmlexport.hxx b/include/oox/export/vmlexport.hxx index 4855f518da25..1c2053406f05 100644 --- a/include/oox/export/vmlexport.hxx +++ b/include/oox/export/vmlexport.hxx @@ -84,7 +84,7 @@ public: VMLExport( ::sax_fastparser::FSHelperPtr pSerializer, VMLTextExport* pTextExport = nullptr ); virtual ~VMLExport(); - ::sax_fastparser::FSHelperPtr + const ::sax_fastparser::FSHelperPtr& GetFS() { return m_pSerializer; } void SetFS(const ::sax_fastparser::FSHelperPtr& pSerializer); diff --git a/include/oox/helper/attributelist.hxx b/include/oox/helper/attributelist.hxx index 2bde4a8807cc..acb8709020ba 100644 --- a/include/oox/helper/attributelist.hxx +++ b/include/oox/helper/attributelist.hxx @@ -74,7 +74,7 @@ public: const css::uno::Reference< css::xml::sax::XFastAttributeList >& rxAttribs ); /** Returns the wrapped com.sun.star.xml.sax.XFastAttributeList object. */ - css::uno::Reference< css::xml::sax::XFastAttributeList > + const css::uno::Reference< css::xml::sax::XFastAttributeList >& getFastAttributeList() const { return mxAttribs; } /** Returns true, if the specified attribute is present. */ diff --git a/include/oox/helper/grabbagstack.hxx b/include/oox/helper/grabbagstack.hxx index aba5af28dfcc..8ad8bd462d61 100644 --- a/include/oox/helper/grabbagstack.hxx +++ b/include/oox/helper/grabbagstack.hxx @@ -38,7 +38,7 @@ public: virtual ~GrabBagStack(); - OUString getCurrentName() { return mCurrentElement.maElementName;} + const OUString& getCurrentName() { return mCurrentElement.maElementName;} css::beans::PropertyValue getRootProperty(); diff --git a/include/oox/helper/propertyset.hxx b/include/oox/helper/propertyset.hxx index 669472a07b6d..1470cfcf3f51 100644 --- a/include/oox/helper/propertyset.hxx +++ b/include/oox/helper/propertyset.hxx @@ -71,7 +71,7 @@ public: bool is() const { return mxPropSet.is(); } /** Returns the contained XPropertySet interface. */ - css::uno::Reference< css::beans::XPropertySet > + const css::uno::Reference< css::beans::XPropertySet >& getXPropertySet() const { return mxPropSet; } /** Returns true, if the specified property is supported by the property set. */ diff --git a/include/oox/ole/axcontrol.hxx b/include/oox/ole/axcontrol.hxx index 87b8515fa6a9..e8c879a44ea2 100644 --- a/include/oox/ole/axcontrol.hxx +++ b/include/oox/ole/axcontrol.hxx @@ -972,7 +972,7 @@ public: convertAndInsert( const EmbeddedControl& rControl, sal_Int32& rnCtrlIndex ); /** Returns the XIndexContainer interface of the UNO control form, if existing. */ - css::uno::Reference< css::container::XIndexContainer > + const css::uno::Reference< css::container::XIndexContainer >& getXForm() const { return mxFormIC; } private: diff --git a/include/oox/ole/vbacontrol.hxx b/include/oox/ole/vbacontrol.hxx index a50054e5f5c2..daf3f1b150c7 100644 --- a/include/oox/ole/vbacontrol.hxx +++ b/include/oox/ole/vbacontrol.hxx @@ -72,8 +72,8 @@ public: const ControlConverter& rConv, ApiControlType eCtrlType, sal_Int32 nCtrlIndex ) const; - ::rtl::OUString getControlSource() { return maControlSource; } - ::rtl::OUString getRowSource() { return maRowSource; } + const OUString& getControlSource() { return maControlSource; } + const OUString& getRowSource() { return maRowSource; } protected: OUString maName; ///< Name of the control. OUString maTag; ///< User defined tag. diff --git a/include/oox/ppt/comments.hxx b/include/oox/ppt/comments.hxx index 6766df27870c..a722ff3ae0a1 100644 --- a/include/oox/ppt/comments.hxx +++ b/include/oox/ppt/comments.hxx @@ -77,11 +77,11 @@ class Comment { text = _text; } - OUString get_text() + const OUString& get_text() { return text; } - css::util::DateTime getDateTime() + const css::util::DateTime& getDateTime() { return aDateTime; } diff --git a/include/oox/ppt/pptimport.hxx b/include/oox/ppt/pptimport.hxx index 125030381f70..35bfb91a4d36 100644 --- a/include/oox/ppt/pptimport.hxx +++ b/include/oox/ppt/pptimport.hxx @@ -49,9 +49,9 @@ public: virtual const oox::drawingml::table::TableStyleListPtr getTableStyles() override; virtual ::oox::drawingml::chart::ChartConverter* getChartConverter() override; - SlidePersistPtr getActualSlidePersist() const { return mpActualSlidePersist; }; + const SlidePersistPtr& getActualSlidePersist() const { return mpActualSlidePersist; }; void setActualSlidePersist( SlidePersistPtr pActualSlidePersist ){ mpActualSlidePersist = pActualSlidePersist; }; - std::map< OUString, oox::drawingml::ThemePtr >& getThemes(){ return maThemes; }; + std::map< OUString, oox::drawingml::ThemePtr >& getThemes(){ return maThemes; }; std::vector< SlidePersistPtr >& getDrawPages(){ return maDrawPages; }; std::vector< SlidePersistPtr >& getMasterPages(){ return maMasterPages; }; std::vector< SlidePersistPtr >& getNotesPages(){ return maNotesPages; }; diff --git a/include/oox/ppt/slidepersist.hxx b/include/oox/ppt/slidepersist.hxx index 1a61603ae26f..6fd77941d947 100644 --- a/include/oox/ppt/slidepersist.hxx +++ b/include/oox/ppt/slidepersist.hxx @@ -59,31 +59,31 @@ public: oox::drawingml::ShapePtr pShapesPtr, const ::oox::drawingml::TextListStylePtr & ); ~SlidePersist(); - css::uno::Reference< css::drawing::XDrawPage > getPage() const { return mxPage; }; + const css::uno::Reference< css::drawing::XDrawPage >& getPage() const { return mxPage; }; #if OSL_DEBUG_LEVEL > 0 static css::uno::WeakReference< css::drawing::XDrawPage > mxDebugPage; #endif void setMasterPersist( SlidePersistPtr pMasterPersistPtr ){ mpMasterPagePtr = pMasterPersistPtr; } - SlidePersistPtr getMasterPersist() const { return mpMasterPagePtr; } + const SlidePersistPtr& getMasterPersist() const { return mpMasterPagePtr; } void setPath( const OUString& rPath ) { maPath = rPath; } - const OUString getPath() const { return maPath; } + const OUString& getPath() const { return maPath; } void setLayoutPath( const OUString& rLayoutPath ) { maLayoutPath = rLayoutPath; } - const OUString getLayoutPath() const { return maLayoutPath; } + const OUString& getLayoutPath() const { return maLayoutPath; } void setTheme( const oox::drawingml::ThemePtr& rThemePtr ){ mpThemePtr = rThemePtr; } - oox::drawingml::ThemePtr getTheme() const { return mpThemePtr; } + const oox::drawingml::ThemePtr& getTheme() const { return mpThemePtr; } - oox::drawingml::ClrSchemePtr getClrScheme() const { return mpClrSchemePtr; } + const oox::drawingml::ClrSchemePtr& getClrScheme() const { return mpClrSchemePtr; } void setClrMap( const oox::drawingml::ClrMapPtr pClrMapPtr ){ mpClrMapPtr = pClrMapPtr; } - oox::drawingml::ClrMapPtr getClrMap() const { return mpClrMapPtr; } + const oox::drawingml::ClrMapPtr& getClrMap() const { return mpClrMapPtr; } void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr& rFillPropertiesPtr ){ mpBackgroundPropertiesPtr = rFillPropertiesPtr; } - const oox::drawingml::FillPropertiesPtr getBackgroundProperties() const { return mpBackgroundPropertiesPtr; } + const oox::drawingml::FillPropertiesPtr& getBackgroundProperties() const { return mpBackgroundPropertiesPtr; } bool isMasterPage() const { return mbMaster; } bool isNotesPage() const { return mbNotes; } @@ -92,13 +92,13 @@ public: short getLayoutFromValueToken(); - oox::drawingml::TextListStylePtr getDefaultTextStyle() const { return maDefaultTextStylePtr; } - oox::drawingml::TextListStylePtr getTitleTextStyle() const { return maTitleTextStylePtr; } - oox::drawingml::TextListStylePtr getBodyTextStyle() const { return maBodyTextStylePtr; } - oox::drawingml::TextListStylePtr getNotesTextStyle() const { return maNotesTextStylePtr; } - oox::drawingml::TextListStylePtr getOtherTextStyle() const { return maOtherTextStylePtr; } + const oox::drawingml::TextListStylePtr& getDefaultTextStyle() const { return maDefaultTextStylePtr; } + const oox::drawingml::TextListStylePtr& getTitleTextStyle() const { return maTitleTextStylePtr; } + const oox::drawingml::TextListStylePtr& getBodyTextStyle() const { return maBodyTextStylePtr; } + const oox::drawingml::TextListStylePtr& getNotesTextStyle() const { return maNotesTextStylePtr; } + const oox::drawingml::TextListStylePtr& getOtherTextStyle() const { return maOtherTextStylePtr; } - oox::drawingml::ShapePtr getShapes() { return maShapesPtr; } + const oox::drawingml::ShapePtr& getShapes() { return maShapesPtr; } void hideShapesAsMasterShapes(); ::std::list< std::shared_ptr< TimeNode > >& getTimeNodeList() { return maTimeNodeList; } oox::ppt::HeaderFooter& getHeaderFooter(){ return maHeaderFooter; }; diff --git a/oox/inc/drawingml/table/tablecell.hxx b/oox/inc/drawingml/table/tablecell.hxx index e936d0777cdc..313e153e7222 100644 --- a/oox/inc/drawingml/table/tablecell.hxx +++ b/oox/inc/drawingml/table/tablecell.hxx @@ -70,7 +70,7 @@ public: void setHorzOverflowToken( sal_Int32 nToken ){ mnHorzOverflowToken = nToken; }; void setTextBody( const oox::drawingml::TextBodyPtr& pTextBody ){ mpTextBody = pTextBody; }; - oox::drawingml::TextBodyPtr getTextBody(){ return mpTextBody; }; + const oox::drawingml::TextBodyPtr& getTextBody(){ return mpTextBody; }; void pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, const ::oox::drawingml::TextListStylePtr& pMasterTextListStyle, diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx index 88aa8a72961f..a29ea074b220 100644 --- a/oox/source/drawingml/customshapegeometry.cxx +++ b/oox/source/drawingml/customshapegeometry.cxx @@ -596,7 +596,7 @@ ContextHandlerRef GeomGuideListContext::onCreateContext( sal_Int32 aElementToken return this; } -static const OUString GetGeomGuideName( const OUString& rValue ) +static const OUString& GetGeomGuideName( const OUString& rValue ) { return rValue; } diff --git a/oox/source/drawingml/diagram/diagram.hxx b/oox/source/drawingml/diagram/diagram.hxx index 3c88772f0c04..81a14bafb5fc 100644 --- a/oox/source/drawingml/diagram/diagram.hxx +++ b/oox/source/drawingml/diagram/diagram.hxx @@ -262,7 +262,7 @@ class Diagram { public: void setData( const DiagramDataPtr & ); - DiagramDataPtr getData() const + const DiagramDataPtr& getData() const { return mpData; } diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx index 9e7f3caefb7f..7eae88618ebb 100644 --- a/oox/source/ole/olehelper.cxx +++ b/oox/source/ole/olehelper.cxx @@ -359,8 +359,8 @@ public: sResult = maGUID.copy(1, maGUID.getLength() - 2 ); return sResult; } - OUString getFullName() { return maFullName; } - OUString getTypeName() { return maTypeName; } + const OUString& getFullName() { return maFullName; } + const OUString& getTypeName() { return maTypeName; } bool isValid() { return mpModel != nullptr; } void exportName( const Reference< XOutputStream >& rxOut ); void exportCompObj( const Reference< XOutputStream >& rxOut ); diff --git a/oox/source/shape/LockedCanvasContext.hxx b/oox/source/shape/LockedCanvasContext.hxx index a2e430c67938..21dc10f3f804 100644 --- a/oox/source/shape/LockedCanvasContext.hxx +++ b/oox/source/shape/LockedCanvasContext.hxx @@ -27,7 +27,7 @@ public: virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 Element, const ::oox::AttributeList& rAttribs) override; - oox::drawingml::ShapePtr getShape() + const oox::drawingml::ShapePtr& getShape() { return mpShape; } diff --git a/oox/source/shape/WpgContext.hxx b/oox/source/shape/WpgContext.hxx index ed0cebf1e245..a212bef255cd 100644 --- a/oox/source/shape/WpgContext.hxx +++ b/oox/source/shape/WpgContext.hxx @@ -27,7 +27,7 @@ public: virtual oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElementToken, const oox::AttributeList& rAttribs) override; - oox::drawingml::ShapePtr getShape() + const oox::drawingml::ShapePtr& getShape() { return mpShape; } diff --git a/oox/source/shape/WpsContext.hxx b/oox/source/shape/WpsContext.hxx index 90fd3fb9aa21..b7dfb1d95c35 100644 --- a/oox/source/shape/WpsContext.hxx +++ b/oox/source/shape/WpsContext.hxx @@ -27,7 +27,7 @@ public: virtual oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElementToken, const oox::AttributeList& rAttribs) override; - oox::drawingml::ShapePtr getShape() + const oox::drawingml::ShapePtr& getShape() { return mpShape; } -- cgit