basic/source/comp/exprtree.cxx | 4 +-- compilerplugins/clang/constparams.cxx | 20 ++++++++------- desktop/inc/lib/init.hxx | 2 - desktop/source/lib/init.cxx | 2 - include/svtools/valueset.hxx | 2 - include/svx/FileExportedDialog.hxx | 2 - include/vcl/filter/SvmReader.hxx | 1 include/vcl/filter/SvmWriter.hxx | 1 include/xmloff/XMLEventExport.hxx | 2 - oox/inc/drawingml/colorchoicecontext.hxx | 2 - oox/inc/drawingml/table/tablecellcontext.hxx | 2 - oox/inc/drawingml/textbody.hxx | 2 - oox/inc/drawingml/textparagraphproperties.hxx | 2 - reportdesign/inc/RptObject.hxx | 3 -- reportdesign/inc/UndoEnv.hxx | 5 +-- reportdesign/source/core/inc/FixedLine.hxx | 3 -- reportdesign/source/core/inc/FixedText.hxx | 3 -- reportdesign/source/core/inc/FormatCondition.hxx | 3 -- reportdesign/source/core/inc/FormattedField.hxx | 3 -- sc/qa/unit/ucalc_formula.cxx | 2 - sd/inc/sdpage.hxx | 4 +-- sd/source/core/sdpage_animations.cxx | 4 +-- sd/source/filter/html/htmlex.cxx | 2 - sdext/source/pdfimport/inc/genericelements.hxx | 25 +++++++------------ sdext/source/pdfimport/inc/pdfiprocessor.hxx | 2 - sdext/source/pdfimport/inc/pdfparse.hxx | 28 +++++++++++----------- sfx2/inc/templateviewitem.hxx | 2 - starmath/inc/mathml/element.hxx | 4 +-- starmath/inc/mathml/import.hxx | 2 - starmath/inc/mathml/mathmlimport.hxx | 2 - starmath/inc/parse5.hxx | 2 - svgio/inc/svgclippathnode.hxx | 2 - svgio/inc/svggradientnode.hxx | 2 - svgio/inc/svgmarkernode.hxx | 2 - svgio/inc/svgmasknode.hxx | 2 - svgio/inc/svgpatternnode.hxx | 2 - svtools/source/control/toolbarmenu.cxx | 2 - svtools/source/control/valueset.cxx | 2 - svx/source/inc/gridcell.hxx | 4 --- svx/source/svdraw/svdotextpathdecomposition.cxx | 2 - sw/source/uibase/inc/regionsw.hxx | 2 - vcl/backendtest/outputdevice/common.cxx | 2 - vcl/inc/test/outputdevice.hxx | 2 - writerfilter/source/dmapper/DomainMapper_Impl.cxx | 2 - xmloff/source/draw/ximpcustomshape.cxx | 2 - xmloff/source/script/XMLEventExport.cxx | 2 - 46 files changed, 79 insertions(+), 96 deletions(-)
New commits: commit 5da6c31a76a95a19bd15ebdb0d1321b7d1240cc7 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Nov 2 15:33:13 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Nov 3 07:54:27 2021 +0100 loplugin:finalclasses Change-Id: I10ff73f89c965beb3cfb5fc3a40dd959d8f77aaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124600 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/svx/FileExportedDialog.hxx b/include/svx/FileExportedDialog.hxx index 0fae918486d3..748c0f377e45 100644 --- a/include/svx/FileExportedDialog.hxx +++ b/include/svx/FileExportedDialog.hxx @@ -10,7 +10,7 @@ #include <vcl/weld.hxx> #include <svx/svxdllapi.h> -class SVX_DLLPUBLIC FileExportedDialog : public weld::GenericDialogController +class SVX_DLLPUBLIC FileExportedDialog final : public weld::GenericDialogController { private: std::unique_ptr<weld::Label> m_xFileLabel; diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx index 3cabcd9c66b4..cac9ffdab52c 100644 --- a/include/vcl/filter/SvmReader.hxx +++ b/include/vcl/filter/SvmReader.hxx @@ -29,7 +29,6 @@ class VCL_DLLPUBLIC SvmReader private: SvStream& mrStream; -protected: void ReadColor(::Color& rColor); public: diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx index ea58db938d3f..4d0a15ed6078 100644 --- a/include/vcl/filter/SvmWriter.hxx +++ b/include/vcl/filter/SvmWriter.hxx @@ -30,7 +30,6 @@ class VCL_DLLPUBLIC SvmWriter private: SvStream& mrStream; -protected: void WriteColor(::Color aColor); public: diff --git a/oox/inc/drawingml/colorchoicecontext.hxx b/oox/inc/drawingml/colorchoicecontext.hxx index 0e93c704c55c..6e82ee3224b4 100644 --- a/oox/inc/drawingml/colorchoicecontext.hxx +++ b/oox/inc/drawingml/colorchoicecontext.hxx @@ -67,7 +67,7 @@ private: }; /// Same as ColorContext, but handles multiple colors. -class ColorsContext : public ::oox::core::ContextHandler2 +class ColorsContext final : public ::oox::core::ContextHandler2 { public: explicit ColorsContext(::oox::core::ContextHandler2Helper const& rParent, diff --git a/oox/inc/drawingml/table/tablecellcontext.hxx b/oox/inc/drawingml/table/tablecellcontext.hxx index a70ad2475e6e..24a8a2830493 100644 --- a/oox/inc/drawingml/table/tablecellcontext.hxx +++ b/oox/inc/drawingml/table/tablecellcontext.hxx @@ -25,7 +25,7 @@ namespace oox::drawingml::table { -class TableCellContext : public ::oox::core::ContextHandler2 +class TableCellContext final : public ::oox::core::ContextHandler2 { public: TableCellContext(::oox::core::ContextHandler2Helper const& rParent, diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx index 2ac96011f3c8..245589e86ac3 100644 --- a/oox/inc/drawingml/textbody.hxx +++ b/oox/inc/drawingml/textbody.hxx @@ -88,7 +88,7 @@ public: const css::uno::Reference < css::text::XText > & xText, const TextCharacterProperties& rTextStyleProperties, const TextListStylePtr& pMasterTextListStylePtr) const; -protected: +private: TextParagraphVector maParagraphs; TextBodyProperties maTextProperties; /// Set if bodyPr tag in this textbody is non-empty during import diff --git a/oox/inc/drawingml/textparagraphproperties.hxx b/oox/inc/drawingml/textparagraphproperties.hxx index dd508179c13d..7bda257d445e 100644 --- a/oox/inc/drawingml/textparagraphproperties.hxx +++ b/oox/inc/drawingml/textparagraphproperties.hxx @@ -113,7 +113,7 @@ public: void dump() const; #endif -protected: +private: TextCharacterProperties maTextCharacterProperties; PropertyMap maTextParagraphPropertyMap; diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx index fe8b49d08738..732d70947654 100644 --- a/reportdesign/inc/RptObject.hxx +++ b/reportdesign/inc/RptObject.hxx @@ -221,7 +221,7 @@ private: // OUnoObject -class REPORTDESIGN_DLLPUBLIC OUnoObject: public SdrUnoObj , public OObjectBase +class REPORTDESIGN_DLLPUBLIC OUnoObject final : public SdrUnoObj , public OObjectBase { friend class OReportPage; friend class OObjectBase; @@ -231,7 +231,6 @@ class REPORTDESIGN_DLLPUBLIC OUnoObject: public SdrUnoObj , public OObjectBase // tdf#118730 remember if this object was created interactively (due to ::EndCreate being called) bool m_bSetDefaultLabel; -protected: OUnoObject(SdrModel& rSdrModel, const OUString& _sComponentName, const OUString& rModelName, diff --git a/reportdesign/inc/UndoEnv.hxx b/reportdesign/inc/UndoEnv.hxx index 80807048c625..af893f68d671 100644 --- a/reportdesign/inc/UndoEnv.hxx +++ b/reportdesign/inc/UndoEnv.hxx @@ -37,7 +37,7 @@ namespace rptui class OXUndoEnvironmentImpl; - class REPORTDESIGN_DLLPUBLIC OXUndoEnvironment + class REPORTDESIGN_DLLPUBLIC OXUndoEnvironment final : public ::cppu::WeakImplHelper< css::beans::XPropertyChangeListener , css::container::XContainerListener , css::util::XModifyListener @@ -49,7 +49,6 @@ namespace rptui OXUndoEnvironment(const OXUndoEnvironment&) = delete; OXUndoEnvironment& operator=(const OXUndoEnvironment&) = delete; - protected: virtual ~OXUndoEnvironment() override; void SetUndoMode(bool _bUndo); @@ -112,7 +111,7 @@ namespace rptui */ void RemoveSection(OReportPage const * _pPage); - protected: + private: // XEventListener virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; diff --git a/reportdesign/source/core/inc/FixedLine.hxx b/reportdesign/source/core/inc/FixedLine.hxx index 5d726a85ed97..4b1c44d71722 100644 --- a/reportdesign/source/core/inc/FixedLine.hxx +++ b/reportdesign/source/core/inc/FixedLine.hxx @@ -39,7 +39,7 @@ namespace reportdesign * \ingroup reportdesign_api * */ - class OFixedLine : public cppu::BaseMutex, + class OFixedLine final : public cppu::BaseMutex, public FixedLineBase, public FixedLinePropertySet { @@ -68,7 +68,6 @@ namespace reportdesign } l.notify(); } - protected: virtual ~OFixedLine() override; public: explicit OFixedLine(css::uno::Reference< css::uno::XComponentContext > const & _xContext); diff --git a/reportdesign/source/core/inc/FixedText.hxx b/reportdesign/source/core/inc/FixedText.hxx index 03126ab30e5f..815bc56390b1 100644 --- a/reportdesign/source/core/inc/FixedText.hxx +++ b/reportdesign/source/core/inc/FixedText.hxx @@ -40,7 +40,7 @@ namespace reportdesign * \ingroup reportdesign_api * */ - class OFixedText : public cppu::BaseMutex, + class OFixedText final : public cppu::BaseMutex, public FixedTextBase, public FixedTextPropertySet { @@ -97,7 +97,6 @@ namespace reportdesign } l.notify(); } - protected: virtual ~OFixedText() override; public: explicit OFixedText(css::uno::Reference< css::uno::XComponentContext > const & _xContext); diff --git a/reportdesign/source/core/inc/FormatCondition.hxx b/reportdesign/source/core/inc/FormatCondition.hxx index 409b1198f7ef..dcff84d48b20 100644 --- a/reportdesign/source/core/inc/FormatCondition.hxx +++ b/reportdesign/source/core/inc/FormatCondition.hxx @@ -38,7 +38,7 @@ namespace reportdesign * \ingroup reportdesign_api * */ - class OFormatCondition : public cppu::BaseMutex, + class OFormatCondition final : public cppu::BaseMutex, public FormatConditionBase, public FormatConditionPropertySet { @@ -95,7 +95,6 @@ namespace reportdesign } l.notify(); } - protected: virtual ~OFormatCondition() override; public: explicit OFormatCondition(css::uno::Reference< css::uno::XComponentContext > const & _xContext diff --git a/reportdesign/source/core/inc/FormattedField.hxx b/reportdesign/source/core/inc/FormattedField.hxx index 040b6af2dfbb..9a6378dca6e6 100644 --- a/reportdesign/source/core/inc/FormattedField.hxx +++ b/reportdesign/source/core/inc/FormattedField.hxx @@ -39,7 +39,7 @@ namespace reportdesign * \ingroup reportdesign_api * */ - class OFormattedField : public cppu::BaseMutex, + class OFormattedField final : public cppu::BaseMutex, public FormattedFieldBase, public FormattedFieldPropertySet { @@ -100,7 +100,6 @@ namespace reportdesign } l.notify(); } - protected: virtual ~OFormattedField() override; public: explicit OFormattedField(css::uno::Reference< css::uno::XComponentContext > const & _xContext); diff --git a/sdext/source/pdfimport/inc/genericelements.hxx b/sdext/source/pdfimport/inc/genericelements.hxx index ff0ba6f52d84..63325213f59a 100644 --- a/sdext/source/pdfimport/inc/genericelements.hxx +++ b/sdext/source/pdfimport/inc/genericelements.hxx @@ -107,16 +107,15 @@ namespace pdfi std::list<std::unique_ptr<Element>> Children; }; - struct ListElement : public Element + struct ListElement final : public Element { ListElement() : Element( nullptr ) {} virtual void visitedBy( ElementTreeVisitor&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override; }; - struct HyperlinkElement : public Element + struct HyperlinkElement final : public Element { friend class ElementFactory; - protected: HyperlinkElement( Element* pParent, const OUString& rURI ) : Element( pParent ), URI( rURI ) {} public: @@ -157,10 +156,9 @@ namespace pdfi sal_Int32 ZOrder; }; - struct FrameElement : public DrawElement + struct FrameElement final : public DrawElement { friend class ElementFactory; - protected: FrameElement( Element* pParent, sal_Int32 nGCId ) : DrawElement( pParent, nGCId ) {} @@ -168,10 +166,9 @@ namespace pdfi virtual void visitedBy( ElementTreeVisitor&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override; }; - struct TextElement : public GraphicalElement + struct TextElement final : public GraphicalElement { friend class ElementFactory; - protected: TextElement( Element* pParent, sal_Int32 nGCId, sal_Int32 nFontId ) : GraphicalElement( pParent, nGCId ), FontId( nFontId ) {} @@ -182,10 +179,9 @@ namespace pdfi sal_Int32 FontId; }; - struct ParagraphElement : public Element + struct ParagraphElement final : public Element { friend class ElementFactory; - protected: explicit ParagraphElement( Element* pParent ) : Element( pParent ), Type( Normal ), bRtl( false ) {} public: @@ -204,10 +200,9 @@ namespace pdfi bool bRtl; }; - struct PolyPolyElement : public DrawElement + struct PolyPolyElement final : public DrawElement { friend class ElementFactory; - protected: PolyPolyElement( Element* pParent, sal_Int32 nGCId, const basegfx::B2DPolyPolygon& rPolyPoly, sal_Int8 nAction ); @@ -224,10 +219,9 @@ namespace pdfi sal_Int8 Action; }; - struct ImageElement : public DrawElement + struct ImageElement final : public DrawElement { friend class ElementFactory; - protected: ImageElement( Element* pParent, sal_Int32 nGCId, ImageId nImage ) : DrawElement( pParent, nGCId ), Image( nImage ) {} @@ -237,10 +231,9 @@ namespace pdfi ImageId Image; }; - struct PageElement : public Element + struct PageElement final : public Element { friend class ElementFactory; - protected: PageElement( Element* pParent, sal_Int32 nPageNr ) : Element( pParent ), PageNumber( nPageNr ), Hyperlinks(), TopMargin( 0.0 ), BottomMargin( 0.0 ), LeftMargin( 0.0 ), RightMargin( 0.0 ) @@ -267,7 +260,7 @@ namespace pdfi std::unique_ptr<Element> FooterElement; }; - struct DocumentElement : public Element + struct DocumentElement final : public Element { friend class ElementFactory; public: diff --git a/sdext/source/pdfimport/inc/pdfiprocessor.hxx b/sdext/source/pdfimport/inc/pdfiprocessor.hxx index 3305f0bf715e..c872ead78917 100644 --- a/sdext/source/pdfimport/inc/pdfiprocessor.hxx +++ b/sdext/source/pdfimport/inc/pdfiprocessor.hxx @@ -52,7 +52,7 @@ namespace pdfi Creates the internal DOM tree from the render calls */ - class PDFIProcessor : public ContentSink + class PDFIProcessor final : public ContentSink { public: css::uno::Reference< diff --git a/sdext/source/pdfimport/inc/pdfparse.hxx b/sdext/source/pdfimport/inc/pdfparse.hxx index abb674a48d22..9d74085aba03 100644 --- a/sdext/source/pdfimport/inc/pdfparse.hxx +++ b/sdext/source/pdfimport/inc/pdfparse.hxx @@ -68,7 +68,7 @@ protected: static void setEmitData( EmitContext& rContext, EmitImplData* pNewEmitData ); }; -struct PDFComment : public PDFEntry +struct PDFComment final : public PDFEntry { OString m_aComment; @@ -86,7 +86,7 @@ struct PDFValue : public PDFEntry virtual ~PDFValue() override; }; -struct PDFName : public PDFValue +struct PDFName final : public PDFValue { OString m_aName; @@ -99,7 +99,7 @@ struct PDFName : public PDFValue OUString getFilteredName() const; }; -struct PDFString : public PDFValue +struct PDFString final : public PDFValue { OString m_aString; @@ -112,7 +112,7 @@ struct PDFString : public PDFValue OString getFilteredString() const; }; -struct PDFNumber : public PDFValue +struct PDFNumber final : public PDFValue { double m_fValue; @@ -123,7 +123,7 @@ struct PDFNumber : public PDFValue virtual PDFEntry* clone() const override; }; -struct PDFBool : public PDFValue +struct PDFBool final : public PDFValue { bool m_bValue; @@ -134,7 +134,7 @@ struct PDFBool : public PDFValue virtual PDFEntry* clone() const override; }; -struct PDFObjectRef : public PDFValue +struct PDFObjectRef final : public PDFValue { unsigned int m_nNumber; unsigned int m_nGeneration; @@ -146,7 +146,7 @@ struct PDFObjectRef : public PDFValue virtual PDFEntry* clone() const override; }; -struct PDFNull : public PDFValue +struct PDFNull final : public PDFValue { PDFNull() {} virtual ~PDFNull() override; @@ -172,7 +172,7 @@ struct PDFContainer : public PDFEntry { return findObject( pRef->m_nNumber, pRef->m_nGeneration ); } }; -struct PDFArray : public PDFContainer +struct PDFArray final : public PDFContainer { PDFArray() {} virtual ~PDFArray() override; @@ -180,7 +180,7 @@ struct PDFArray : public PDFContainer virtual PDFEntry* clone() const override; }; -struct PDFDict : public PDFContainer +struct PDFDict final : public PDFContainer { typedef std::unordered_map<OString,PDFEntry*> Map; Map m_aMap; @@ -200,7 +200,7 @@ struct PDFDict : public PDFContainer PDFEntry* buildMap(); }; -struct PDFStream : public PDFEntry +struct PDFStream final : public PDFEntry { unsigned int m_nBeginOffset; unsigned int m_nEndOffset; // offset of the byte after the stream @@ -215,7 +215,7 @@ struct PDFStream : public PDFEntry unsigned int getDictLength( const PDFContainer* pObjectContainer ) const; // get contents of the "Length" entry of the dict }; -struct PDFTrailer : public PDFContainer +struct PDFTrailer final : public PDFContainer { PDFDict* m_pDict; @@ -226,7 +226,7 @@ struct PDFTrailer : public PDFContainer }; struct PDFFileImplData; -struct PDFFile : public PDFContainer +struct PDFFile final : public PDFContainer { private: mutable std::unique_ptr<PDFFileImplData> m_pData; @@ -255,7 +255,7 @@ public: unsigned int nObject, unsigned int nGeneration ) const; }; -struct PDFObject : public PDFContainer +struct PDFObject final : public PDFContainer { PDFEntry* m_pObject; PDFStream* m_pStream; @@ -279,7 +279,7 @@ private: bool getDeflatedStream( std::unique_ptr<char[]>& rpStream, unsigned int* pBytes, const PDFContainer* pObjectContainer, EmitContext& rContext ) const; }; -struct PDFPart : public PDFContainer +struct PDFPart final : public PDFContainer { PDFPart() : PDFContainer() {} virtual ~PDFPart() override; diff --git a/sfx2/inc/templateviewitem.hxx b/sfx2/inc/templateviewitem.hxx index 41c77b060f80..25f73b9d8eaa 100644 --- a/sfx2/inc/templateviewitem.hxx +++ b/sfx2/inc/templateviewitem.hxx @@ -11,7 +11,7 @@ #include <sfx2/thumbnailviewitem.hxx> -class TemplateViewItem : public ThumbnailViewItem +class TemplateViewItem final : public ThumbnailViewItem { public: diff --git a/starmath/inc/mathml/element.hxx b/starmath/inc/mathml/element.hxx index 8f510f57a72b..901e0021daa3 100644 --- a/starmath/inc/mathml/element.hxx +++ b/starmath/inc/mathml/element.hxx @@ -15,7 +15,7 @@ #include <editeng/editdata.hxx> -class SmMlElement : public SmRect +class SmMlElement final : public SmRect { /* Technical stuff */ @@ -187,7 +187,7 @@ public: // attributes */ bool isAttributeSet(SmMlAttributeValueType aAttributeType) const; -protected: // attributes +private: // attributes /** * Gets a given attribute. * If no available returns empty attribute. diff --git a/starmath/inc/mathml/import.hxx b/starmath/inc/mathml/import.hxx index 6266b5ede6c0..f14682bdfb8b 100644 --- a/starmath/inc/mathml/import.hxx +++ b/starmath/inc/mathml/import.hxx @@ -83,7 +83,7 @@ public: css::uno::Reference<css::beans::XPropertySet> const& rPropSet); }; -class SmMLImport : public SvXMLImport +class SmMLImport final : public SvXMLImport { private: SmMlElement* m_pElementTree = new SmMlElement(SmMlElementType::NMlEmpty); diff --git a/starmath/inc/mathml/mathmlimport.hxx b/starmath/inc/mathml/mathmlimport.hxx index 4e5444945f7e..0a963a1b01d3 100644 --- a/starmath/inc/mathml/mathmlimport.hxx +++ b/starmath/inc/mathml/mathmlimport.hxx @@ -70,7 +70,7 @@ public: const char* pFilterName, bool bUseHTMLMLEntities); }; -class SmXMLImport : public SvXMLImport +class SmXMLImport final : public SvXMLImport { SmNodeStack aNodeStack; bool bSuccess; diff --git a/starmath/inc/parse5.hxx b/starmath/inc/parse5.hxx index bfc09a139e5a..69528c403c0a 100644 --- a/starmath/inc/parse5.hxx +++ b/starmath/inc/parse5.hxx @@ -25,7 +25,7 @@ #include "parsebase.hxx" -class SmParser5 : public AbstractSmParser +class SmParser5 final : public AbstractSmParser { OUString m_aBufferString; SmToken m_aCurToken; diff --git a/svgio/inc/svgclippathnode.hxx b/svgio/inc/svgclippathnode.hxx index 6f4ab5b4b97d..9d64db06eaff 100644 --- a/svgio/inc/svgclippathnode.hxx +++ b/svgio/inc/svgclippathnode.hxx @@ -26,7 +26,7 @@ namespace svgio::svgreader { - class SvgClipPathNode : public SvgNode + class SvgClipPathNode final : public SvgNode { private: /// use styles diff --git a/svgio/inc/svggradientnode.hxx b/svgio/inc/svggradientnode.hxx index 3267256d0524..b672a3b45ae4 100644 --- a/svgio/inc/svggradientnode.hxx +++ b/svgio/inc/svggradientnode.hxx @@ -26,7 +26,7 @@ namespace svgio::svgreader { - class SvgGradientNode : public SvgNode + class SvgGradientNode final : public SvgNode { private: /// use styles diff --git a/svgio/inc/svgmarkernode.hxx b/svgio/inc/svgmarkernode.hxx index dc9f13d81f7a..41c2d71efe41 100644 --- a/svgio/inc/svgmarkernode.hxx +++ b/svgio/inc/svgmarkernode.hxx @@ -25,7 +25,7 @@ namespace svgio::svgreader { - class SvgMarkerNode : public SvgNode + class SvgMarkerNode final : public SvgNode { public: enum class MarkerUnits diff --git a/svgio/inc/svgmasknode.hxx b/svgio/inc/svgmasknode.hxx index 199a258f9643..820d0e335dae 100644 --- a/svgio/inc/svgmasknode.hxx +++ b/svgio/inc/svgmasknode.hxx @@ -26,7 +26,7 @@ namespace svgio::svgreader { - class SvgMaskNode : public SvgNode + class SvgMaskNode final : public SvgNode { private: /// use styles diff --git a/svgio/inc/svgpatternnode.hxx b/svgio/inc/svgpatternnode.hxx index 1da003c085d1..60c6b7f7ced8 100644 --- a/svgio/inc/svgpatternnode.hxx +++ b/svgio/inc/svgpatternnode.hxx @@ -26,7 +26,7 @@ namespace svgio::svgreader { - class SvgPatternNode : public SvgNode + class SvgPatternNode final : public SvgNode { private: /// buffered decomposition diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index b2aa1140006f..07e45e3cbbfe 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -75,11 +75,7 @@ class DbGridColumn // this is positioned by the DbBrowseBox on the respective // cells of a column rtl::Reference<FmXGridCell> m_pCell; - -protected: DbGridControl& m_rParent; - -private: sal_Int32 m_nLastVisibleWidth; // only valid if m_bHidden == sal_True sal_Int32 m_nFormatKey; sal_Int16 m_nFieldType; diff --git a/sw/source/uibase/inc/regionsw.hxx b/sw/source/uibase/inc/regionsw.hxx index b9e1165e3197..e766e3a1a924 100644 --- a/sw/source/uibase/inc/regionsw.hxx +++ b/sw/source/uibase/inc/regionsw.hxx @@ -168,7 +168,7 @@ public: const SfxItemSet* rAttrSet); }; -class SwSectionFootnoteEndTabPage : public SfxTabPage +class SwSectionFootnoteEndTabPage final : public SfxTabPage { std::unique_ptr<weld::CheckButton> m_xFootnoteNtAtTextEndCB; std::unique_ptr<weld::CheckButton> m_xFootnoteNtNumCB; commit 6299c8cae923198c55d47320fa8a89bbcd5b0f2b Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Nov 2 14:32:10 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Nov 3 07:54:12 2021 +0100 loplugin:constparams Change-Id: Iebeb531fad5cc819b536788925cf8508737198b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index a18a740447ec..6b101ce81ca6 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -74,7 +74,7 @@ SbiExpression::~SbiExpression() { } // Are there parameters without brackets following? This may be a number, // a string, a symbol or also a comma (if the 1st parameter is missing) -static bool DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken eTok ) +static bool DoParametersFollow( const SbiParser* p, SbiExprType eCurExpr, SbiToken eTok ) { if( eTok == LPAREN ) { @@ -92,7 +92,7 @@ static bool DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken eTo } else // check for default params with reserved names ( e.g. names of tokens ) { - SbiTokenizer tokens( *static_cast<SbiTokenizer*>(p) ); + SbiTokenizer tokens( *static_cast<const SbiTokenizer*>(p) ); // Urk the Next() / Peek() semantics are... weird tokens.Next(); if ( tokens.Peek() == ASSIGN ) diff --git a/compilerplugins/clang/constparams.cxx b/compilerplugins/clang/constparams.cxx index b7c13750eb5b..950ae91e0b27 100644 --- a/compilerplugins/clang/constparams.cxx +++ b/compilerplugins/clang/constparams.cxx @@ -291,9 +291,11 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const ParmVarDecl* parmVar { // check if we're inside a CXXCtorInitializer auto parentsRange = compiler.getASTContext().getParents(*stmt); + auto it = parentsRange.begin(); if ( parentsRange.begin() != parentsRange.end()) { - if (auto cxxConstructorDecl = dyn_cast_or_null<CXXConstructorDecl>(parentsRange.begin()->get<Decl>())) + const Decl *decl = it->get<Decl>(); + if (auto cxxConstructorDecl = dyn_cast_or_null<CXXConstructorDecl>(decl)) { for ( auto cxxCtorInitializer : cxxConstructorDecl->inits()) { @@ -317,18 +319,18 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const ParmVarDecl* parmVar } } } - if (auto varDecl = dyn_cast_or_null<VarDecl>(parentsRange.begin()->get<Decl>())) + if (auto varDecl = dyn_cast_or_null<VarDecl>(decl)) { return isOkForParameter(varDecl->getType()); } } - parmVarDecl->dump(); - stmt->dump(); - report( - DiagnosticsEngine::Warning, - "no parent?", - compat::getBeginLoc(stmt)) - << stmt->getSourceRange(); +// parmVarDecl->dump(); +// stmt->dump(); +// report( +// DiagnosticsEngine::Warning, +// "no parent?", +// compat::getBeginLoc(stmt)) +// << stmt->getSourceRange(); return false; } diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx index 337c0f23340c..b8918729cff9 100644 --- a/desktop/inc/lib/init.hxx +++ b/desktop/inc/lib/init.hxx @@ -175,7 +175,7 @@ namespace desktop { queue_type2::reverse_iterator toQueue2(queue_type1::reverse_iterator); void queue(const int type, CallbackData& data); void enqueueUpdatedTypes(); - void enqueueUpdatedType( int type, SfxViewShell* sourceViewShell, int viewId ); + void enqueueUpdatedType( int type, const SfxViewShell* sourceViewShell, int viewId ); /** we frequently want to scan the queue, and mostly when we do so, we only care about the element type so we split the queue in 2 to make the scanning cache friendly. */ diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4ab45c346697..fe6fd88b1c7b 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2189,7 +2189,7 @@ void CallbackFlushHandler::enqueueUpdatedTypes() } } -void CallbackFlushHandler::enqueueUpdatedType( int type, SfxViewShell* viewShell, int viewId ) +void CallbackFlushHandler::enqueueUpdatedType( int type, const SfxViewShell* viewShell, int viewId ) { OString payload = viewShell->getLOKPayload( type, viewId ); if(payload.isEmpty()) diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx index baee0108af9e..9fe1b885e686 100644 --- a/include/svtools/valueset.hxx +++ b/include/svtools/valueset.hxx @@ -233,7 +233,7 @@ private: // selected is returned SVT_DLLPRIVATE ValueSetItem* ImplGetDrawSelectItem(sal_uInt16 nItemId, const bool bFocus, tools::Rectangle& rRect); SVT_DLLPRIVATE void ImplDrawSelect(vcl::RenderContext& rRenderContext, - const tools::Rectangle& rRect, ValueSetItem* pItem, + const tools::Rectangle& rRect, const ValueSetItem* pItem, const bool bFocus, const bool bDrawSel, const bool bSelected, const bool bHover); SVT_DLLPRIVATE void ImplDrawSelect(vcl::RenderContext& rRenderContext); diff --git a/include/xmloff/XMLEventExport.hxx b/include/xmloff/XMLEventExport.hxx index 48198032377f..ad83390b6dc9 100644 --- a/include/xmloff/XMLEventExport.hxx +++ b/include/xmloff/XMLEventExport.hxx @@ -103,7 +103,7 @@ public: /// export a single event (writes <office:events> element) void ExportSingleEvent( - css::uno::Sequence<css::beans::PropertyValue>& rEventValues, + const css::uno::Sequence<css::beans::PropertyValue>& rEventValues, const OUString& rApiEventName, bool bUseWhitespace = true ); diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index af8d708279a2..9ad8705c0c45 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -95,7 +95,7 @@ void setExpandRefs(bool bExpand) pMod->SetInputOptions(aOpt); } -void testFormulaRefUpdateNameCopySheetCheckTab( ScDocument* pDoc, SCTAB nTab, bool bCheckNames ) +void testFormulaRefUpdateNameCopySheetCheckTab( const ScDocument* pDoc, SCTAB nTab, bool bCheckNames ) { if (bCheckNames) { diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx index ae97ff0b18e1..16315c219603 100644 --- a/sd/inc/sdpage.hxx +++ b/sd/inc/sdpage.hxx @@ -334,10 +334,10 @@ public: bool bEdit ) override; /** callback from the sd::View when a new paragraph for one object on this page is created */ - void onParagraphInserted( ::Outliner* pOutliner, Paragraph const * pPara, SdrObject* pObj ); + void onParagraphInserted( const ::Outliner* pOutliner, Paragraph const * pPara, SdrObject* pObj ); /** callback from the sd::View when a paragraph from one object on this page is removed */ - void onParagraphRemoving( ::Outliner* pOutliner, Paragraph const * pPara, SdrObject* pObj ); + void onParagraphRemoving( const ::Outliner* pOutliner, Paragraph const * pPara, SdrObject* pObj ); /** callback from the sd::View when an object just left text edit mode */ void onEndTextEdit( SdrObject* pObj ); diff --git a/sd/source/core/sdpage_animations.cxx b/sd/source/core/sdpage_animations.cxx index bb16cacdbb7a..34a049c3dc60 100644 --- a/sd/source/core/sdpage_animations.cxx +++ b/sd/source/core/sdpage_animations.cxx @@ -106,7 +106,7 @@ FadeEffect SdPage::GetFadeEffect() const } /** callback from the sd::View when a new paragraph for one object on this page is created */ -void SdPage::onParagraphInserted( ::Outliner* pOutliner, Paragraph const * pPara, SdrObject* pObj ) +void SdPage::onParagraphInserted( const ::Outliner* pOutliner, Paragraph const * pPara, SdrObject* pObj ) { if( mxAnimationNode.is() ) { @@ -121,7 +121,7 @@ void SdPage::onParagraphInserted( ::Outliner* pOutliner, Paragraph const * pPara } /** callback from the sd::View when a paragraph from one object on this page is removed */ -void SdPage::onParagraphRemoving( ::Outliner* pOutliner, Paragraph const * pPara, SdrObject* pObj ) +void SdPage::onParagraphRemoving( const ::Outliner* pOutliner, Paragraph const * pPara, SdrObject* pObj ) { if( mxAnimationNode.is() ) { diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 13f12dc69c2f..3e06c07fed38 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -304,7 +304,7 @@ OUString HtmlState::SetLink( const OUString& aLink, const OUString& aTarget ) namespace { -OUString getParagraphStyle( SdrOutliner* pOutliner, sal_Int32 nPara ) +OUString getParagraphStyle( const SdrOutliner* pOutliner, sal_Int32 nPara ) { SfxItemSet aParaSet( pOutliner->GetParaAttribs( nPara ) ); diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index 3c95a6410d64..86edb4613c2d 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -35,7 +35,7 @@ using namespace ::com::sun::star::accessibility; namespace { -SystemWindow* GetTopMostParentSystemWindow(vcl::Window& rWindow) +SystemWindow* GetTopMostParentSystemWindow(const vcl::Window& rWindow) { // ->manually search topmost system window // required because their might be another system window between this and the top window diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index f8b0267316aa..b3bd235ef249 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1233,7 +1233,7 @@ ValueSetItem* ValueSet::ImplGetDrawSelectItem(sal_uInt16 nItemId, const bool bFo } void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, - const tools::Rectangle& rRect, ValueSetItem* pItem, + const tools::Rectangle& rRect, const ValueSetItem* pItem, const bool bFocus, const bool bDrawSel, const bool bSelected, const bool bHover) { diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index 4f3144d25851..8f04b356cef7 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -69,7 +69,7 @@ namespace bool mbRTL : 1; public: - explicit impPathTextPortion(DrawPortionInfo& rInfo) + explicit impPathTextPortion(const DrawPortionInfo& rInfo) : maOffset(rInfo.mrStartPos.X(), rInfo.mrStartPos.Y()), maText(rInfo.maText), mnTextStart(rInfo.mnTextStart), diff --git a/vcl/backendtest/outputdevice/common.cxx b/vcl/backendtest/outputdevice/common.cxx index 8a5b80cb8dec..c8e291f787ec 100644 --- a/vcl/backendtest/outputdevice/common.cxx +++ b/vcl/backendtest/outputdevice/common.cxx @@ -720,7 +720,7 @@ tools::Polygon OutputDeviceTestCommon::createClosedBezierLoop(const tools::Recta return aPolygon; } -basegfx::B2DPolygon OutputDeviceTestCommon::createOpenPolygon(tools::Rectangle& rRect, int nOffset) +basegfx::B2DPolygon OutputDeviceTestCommon::createOpenPolygon(const tools::Rectangle& rRect, int nOffset) { int nMidOffset = rRect.GetWidth() / 2; basegfx::B2DPolygon aPolygon{ diff --git a/vcl/inc/test/outputdevice.hxx b/vcl/inc/test/outputdevice.hxx index c63c97a1e48c..e205dfb80909 100644 --- a/vcl/inc/test/outputdevice.hxx +++ b/vcl/inc/test/outputdevice.hxx @@ -71,7 +71,7 @@ public: static tools::Polygon createDropShapePolygon(); static basegfx::B2DPolygon createHalfEllipsePolygon(); static tools::Polygon createClosedBezierLoop(const tools::Rectangle& rRect); - static basegfx::B2DPolygon createOpenPolygon(tools::Rectangle& rRect, int nOffset = 4); + static basegfx::B2DPolygon createOpenPolygon(const tools::Rectangle& rRect, int nOffset = 4); static void createHorizontalVerticalDiagonalLinePoints(tools::Rectangle rRect, Point& rHorizontalLinePoint1, Point& rHorizontalLinePoint2, diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index fd54128f5cc5..9bc82dfb6c92 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -4171,7 +4171,7 @@ static bool lcl_FindInCommand( return bRet; } -static OUString lcl_trim(OUString& sValue) +static OUString lcl_trim(const OUString& sValue) { // it seems, all kind of quotation marks are allowed around index type identifiers // TODO apply this on bookmarks, too, if needed diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index ebaf15651950..cf794da63df6 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -426,7 +426,7 @@ static bool GetNextParameter( css::drawing::EnhancedCustomShapeParameter& rParam static void GetPosition3D( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:extrusion-viewpoint std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp, - SvXMLUnitConverter& rUnitConverter ) + const SvXMLUnitConverter& rUnitConverter ) { drawing::Position3D aPosition3D; if ( rUnitConverter.convertPosition3D( aPosition3D, rValue ) ) diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx index 285bd487c35b..5aed1c76c330 100644 --- a/xmloff/source/script/XMLEventExport.cxx +++ b/xmloff/source/script/XMLEventExport.cxx @@ -150,7 +150,7 @@ void XMLEventExport::ExportExt( Reference<XNameAccess> const & rAccess ) /// export a singular event and write <office:events> container void XMLEventExport::ExportSingleEvent( - Sequence<PropertyValue>& rEventValues, + const Sequence<PropertyValue>& rEventValues, const OUString& rApiEventName, bool bUseWhitespace ) {