From 2c7aa60b69967a80b7874503f0e9e85546a04cde Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 3 Sep 2019 16:17:03 +0200 Subject: [PATCH] loplugin:constmethod in filter Change-Id: Ib337c45c0ee7de881313b000bf2f8d816fd17884 Reviewed-on: https://gerrit.libreoffice.org/78565 Tested-by: Jenkins Reviewed-by: Noel Grandin --- filter/source/flash/swfwriter.hxx | 2 +- filter/source/graphicfilter/icgm/cgm.cxx | 2 +- filter/source/graphicfilter/icgm/cgm.hxx | 2 +- filter/source/graphicfilter/icgm/chart.cxx | 2 +- filter/source/graphicfilter/icgm/chart.hxx | 2 +- filter/source/graphicfilter/ios2met/ios2met.cxx | 4 ++-- filter/source/msfilter/mstoolbar.cxx | 4 ++-- filter/source/msfilter/svdfppt.cxx | 2 +- filter/source/svg/svgwriter.hxx | 2 +- filter/source/xsltfilter/LibXSLTTransformer.hxx | 6 +++--- include/filter/msfilter/escherex.hxx | 6 +++--- include/filter/msfilter/mstoolbar.hxx | 20 ++++++++++---------- include/filter/msfilter/svdfppt.hxx | 2 +- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/filter/source/flash/swfwriter.hxx b/filter/source/flash/swfwriter.hxx index 7d65a21a20fa..ecb04e9dd0ce 100644 --- a/filter/source/flash/swfwriter.hxx +++ b/filter/source/flash/swfwriter.hxx @@ -145,7 +145,7 @@ public: void write( SvStream& out ); sal_uInt16 getID() const { return mnId; } - const vcl::Font& getFont() { return maFont; } + const vcl::Font& getFont() const { return maFont; } private: const vcl::Font maFont; diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index 22240779768d..8122d399eaa6 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -75,7 +75,7 @@ CGM::~CGM() maDefRepSizeList.clear(); }; -sal_uInt32 CGM::GetBackGroundColor() +sal_uInt32 CGM::GetBackGroundColor() const { return pElement ? pElement->aColorTable[ 0 ] : 0; } diff --git a/filter/source/graphicfilter/icgm/cgm.hxx b/filter/source/graphicfilter/icgm/cgm.hxx index 388b5eea3dcc..19773b9117c1 100644 --- a/filter/source/graphicfilter/icgm/cgm.hxx +++ b/filter/source/graphicfilter/icgm/cgm.hxx @@ -133,7 +133,7 @@ class CGM ~CGM(); CGM(css::uno::Reference< css::frame::XModel > const & rModel); - sal_uInt32 GetBackGroundColor(); + sal_uInt32 GetBackGroundColor() const; bool IsValid() const { return mbStatus; }; bool IsFinished() const { return mbIsFinished; }; bool Write( SvStream& rIStm ); diff --git a/filter/source/graphicfilter/icgm/chart.cxx b/filter/source/graphicfilter/icgm/chart.cxx index 845fab4e0d77..439d941c33ad 100644 --- a/filter/source/graphicfilter/icgm/chart.cxx +++ b/filter/source/graphicfilter/icgm/chart.cxx @@ -50,7 +50,7 @@ void CGMChart::ResetAnnotation() mDataNode[ 0 ].nZoneEnum = 0; } -bool CGMChart::IsAnnotation() +bool CGMChart::IsAnnotation() const { return ( mDataNode[ 0 ].nZoneEnum == 0 ); } diff --git a/filter/source/graphicfilter/icgm/chart.hxx b/filter/source/graphicfilter/icgm/chart.hxx index 837015614696..839be2e4a196 100644 --- a/filter/source/graphicfilter/icgm/chart.hxx +++ b/filter/source/graphicfilter/icgm/chart.hxx @@ -74,7 +74,7 @@ class CGMChart final void InsertTextEntry( std::unique_ptr ); void ResetAnnotation(); - bool IsAnnotation(); + bool IsAnnotation() const; }; #endif diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index f1d8e5661083..236506aff7cc 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -378,7 +378,7 @@ private: Color GetPaletteColor(sal_uInt32 nIndex); - bool IsLineInfo(); + bool IsLineInfo() const; void DrawPolyLine( const tools::Polygon& rPolygon ); void DrawPolygon( const tools::Polygon& rPolygon ); void DrawPolyPolygon( const tools::PolyPolygon& rPolygon ); @@ -491,7 +491,7 @@ OS2METReader::~OS2METReader() } } -bool OS2METReader::IsLineInfo() +bool OS2METReader::IsLineInfo() const { return ( ! ( aLineInfo.IsDefault() || ( aLineInfo.GetStyle() == LineStyle::NONE ) || ( pVirDev->GetLineColor() == COL_TRANSPARENT ) ) ); } diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx index d8ddc076caec..7d8e25cbdeed 100644 --- a/filter/source/msfilter/mstoolbar.cxx +++ b/filter/source/msfilter/mstoolbar.cxx @@ -437,7 +437,7 @@ TBCExtraInfo::Print( FILE* fp ) #endif OUString const & -TBCExtraInfo::getOnAction() +TBCExtraInfo::getOnAction() const { return wstrOnAction.getString(); } @@ -764,7 +764,7 @@ bool TB::Read(SvStream &rS) } -bool TB::IsEnabled() +bool TB::IsEnabled() const { return ( bFlags & 0x01 ) != 0x01; } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index a9db1f9bfec4..3d47c924bc66 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -5456,7 +5456,7 @@ PPTPortionObj::~PPTPortionObj() { } -bool PPTPortionObj::HasTabulator() +bool PPTPortionObj::HasTabulator() const { bool bRetValue = false; sal_Int32 nCount; diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index f6ea72fd539c..f0271ed4090b 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -265,7 +265,7 @@ class SVGTextWriter final bool nextParagraph(); bool nextTextPortion(); - bool isTextShapeStarted() { return mbIsTextShapeStarted; } + bool isTextShapeStarted() const { return mbIsTextShapeStarted; } void startTextShape(); void endTextShape(); void startTextParagraph(); diff --git a/filter/source/xsltfilter/LibXSLTTransformer.hxx b/filter/source/xsltfilter/LibXSLTTransformer.hxx index 2b31a87914bd..d646d5dbfc43 100644 --- a/filter/source/xsltfilter/LibXSLTTransformer.hxx +++ b/filter/source/xsltfilter/LibXSLTTransformer.hxx @@ -162,13 +162,13 @@ namespace XSLT error(const OUString& msg); const OString& - getStyleSheetURL() { return m_styleSheetURL; } + getStyleSheetURL() const { return m_styleSheetURL; } const ::std::map& - getParameters() { return m_parameters; } + getParameters() const { return m_parameters; } const css::uno::Reference& - getComponentContext() { + getComponentContext() const { return m_xContext; } diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx index 729e98835a63..c723318ebff6 100644 --- a/include/filter/msfilter/escherex.hxx +++ b/include/filter/msfilter/escherex.hxx @@ -600,7 +600,7 @@ public: bool GetPrefSize( const sal_uInt32 nBlibId, Size& rSize, MapMode& rMapMode ); void SetBaseURI( const OUString& rBaseURI ) { maBaseURI = rBaseURI; }; - const OUString& GetBaseURI() { return maBaseURI; }; + const OUString& GetBaseURI() const { return maBaseURI; }; EscherGraphicProvider( EscherGraphicProviderFlags nFlags = EscherGraphicProviderFlags::NONE ); virtual ~EscherGraphicProvider(); @@ -922,7 +922,7 @@ public: { mpHyperlinkRecord.reset( pStream ); } - const std::unique_ptr< SvMemoryStream >& getHyperlinkRecord() { return mpHyperlinkRecord; } + const std::unique_ptr< SvMemoryStream >& getHyperlinkRecord() const { return mpHyperlinkRecord; } }; class EscherExHostAppData @@ -1125,7 +1125,7 @@ public: void InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue ); // nValue is being inserted into the Stream where it's appropriate (overwrite mode), without that the // current StreamPosition changes void SetEditAs( const OUString& rEditAs ); - const OUString& GetEditAs() { return mEditAs; } + const OUString& GetEditAs() const { return mEditAs; } SvStream& GetStream() const { return *mpOutStrm; } sal_uLong GetStreamPos() const { return mpOutStrm->Tell(); } diff --git a/include/filter/msfilter/mstoolbar.hxx b/include/filter/msfilter/mstoolbar.hxx index 810306149b89..3e546c8dcdb1 100644 --- a/include/filter/msfilter/mstoolbar.hxx +++ b/include/filter/msfilter/mstoolbar.hxx @@ -58,7 +58,7 @@ public: void setMSOCommandMap( MSOCommandConvertor* pCnvtr ) { pMSOCmdConvertor.reset( pCnvtr ); } css::uno::Reference< css::ui::XUIConfigurationManager > getCfgManager(); - const css::uno::Reference< css::ui::XUIConfigurationManager >& getAppCfgManager() { return m_xAppCfgMgr;} + const css::uno::Reference< css::ui::XUIConfigurationManager >& getAppCfgManager() const { return m_xAppCfgMgr;} static css::uno::Any createCommandFromMacro( const OUString& sCmd ); @@ -93,7 +93,7 @@ public: #ifdef DEBUG_FILTER_MSTOOLBAR virtual void Print( FILE* ) {} // #FIXME remove this an implement the debug routines in all the classes below to enable some sort of readable output #endif - sal_uInt32 GetOffset() { return nOffSet; } + sal_uInt32 GetOffset() const { return nOffSet; } }; class Indent @@ -117,7 +117,7 @@ class MSFILTER_DLLPUBLIC WString : public TBBase public: WString(){}; bool Read(SvStream &rS) override; - const OUString& getString(){ return sString; } + const OUString& getString() const { return sString; } }; class MSFILTER_DLLPUBLIC TBCExtraInfo : public TBBase @@ -138,7 +138,7 @@ public: #ifdef DEBUG_FILTER_MSTOOLBAR virtual void Print( FILE* ) override; #endif - OUString const & getOnAction(); + OUString const & getOnAction() const; }; class MSFILTER_DLLPUBLIC TBCGeneralInfo : public TBBase @@ -267,13 +267,13 @@ public: sal_uInt8 getTct() const { return tct; } sal_uInt16 getTcID() const { return tcid; } - bool isVisible() { return !( bFlagsTCR & 0x1 ); } - bool isBeginGroup() { return ( bFlagsTCR & 0x2 ) != 0; } + bool isVisible() const { return !( bFlagsTCR & 0x1 ); } + bool isBeginGroup() const { return ( bFlagsTCR & 0x2 ) != 0; } bool Read(SvStream &rS) override; #ifdef DEBUG_FILTER_MSTOOLBAR virtual void Print( FILE* ) override; #endif - sal_uInt32 getTbct() { return tbct; }; + sal_uInt32 getTbct() const { return tbct; }; }; class MSFILTER_DLLPUBLIC TBCData : public TBBase @@ -310,10 +310,10 @@ public: #ifdef DEBUG_FILTER_MSTOOLBAR virtual void Print( FILE* ) override; #endif - sal_Int16 getcCL(){ return cCL; } + sal_Int16 getcCL() const { return cCL; } WString& getName(){ return name; } - bool IsEnabled(); - bool IsMenuToolbar(){ return ( ( ltbtr & 0x2000000 ) == 0x2000000 ); } + bool IsEnabled() const; + bool IsMenuToolbar() const { return ( ( ltbtr & 0x2000000 ) == 0x2000000 ); } }; class MSFILTER_DLLPUBLIC SRECT : public TBBase diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx index 3261c25f4a8c..7252edf58dcb 100644 --- a/include/filter/msfilter/svdfppt.hxx +++ b/include/filter/msfilter/svdfppt.hxx @@ -1131,7 +1131,7 @@ public: const PPTTextObj* pTextObj ); sal_uInt32 Count() const { return mpFieldItem ? 1 : maString.getLength(); }; - bool HasTabulator(); + bool HasTabulator() const; }; class MSFILTER_DLLPUBLIC PPTParagraphObj -- 2.11.4.GIT