From 2bf2541c6b849a5153462327f8d167a386464dda Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 30 Oct 2017 17:09:51 +0200 Subject: loplugin:finalclasses in reportdesign Change-Id: I6fab8ce7d1c9a5e52a981dc7530fafb2373e27f6 Reviewed-on: https://gerrit.libreoffice.org/44098 Tested-by: Jenkins Reviewed-by: Noel Grandin --- reportdesign/inc/RptObject.hxx | 65 +++++++++++------------- reportdesign/source/filter/xml/xmlComponent.hxx | 3 +- reportdesign/source/filter/xml/xmlFunction.hxx | 3 +- reportdesign/source/filter/xml/xmlGroup.hxx | 3 +- reportdesign/source/ui/inc/ColorChanger.hxx | 3 +- reportdesign/source/ui/inc/DefaultInspection.hxx | 12 ++--- reportdesign/source/ui/inc/metadata.hxx | 20 ++++---- reportdesign/source/ui/inc/propbrw.hxx | 4 +- 8 files changed, 50 insertions(+), 63 deletions(-) (limited to 'reportdesign') diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx index fd4cba36923f..5a8e53d912d2 100644 --- a/reportdesign/inc/RptObject.hxx +++ b/reportdesign/inc/RptObject.hxx @@ -122,30 +122,16 @@ public: // OCustomShape -class REPORTDESIGN_DLLPUBLIC OCustomShape: public SdrObjCustomShape , public OObjectBase +class REPORTDESIGN_DLLPUBLIC OCustomShape final : public SdrObjCustomShape , public OObjectBase { friend class OReportPage; friend class DlgEdFactory; - public: static OCustomShape* Create( const css::uno::Reference< css::report::XReportComponent>& _xComponent ) { return new OCustomShape( _xComponent ); } -protected: - OCustomShape(const css::uno::Reference< css::report::XReportComponent>& _xComponent); - OCustomShape(const OUString& _sComponentName); - - virtual void NbcMove( const Size& rSize ) override; - virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; - virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; - virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; - - virtual SdrPage* GetImplPage() const override; - -public: - virtual ~OCustomShape() override; virtual css::uno::Reference< css::beans::XPropertySet> getAwtComponent() override; @@ -156,39 +142,30 @@ public: private: virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override; + + OCustomShape(const css::uno::Reference< css::report::XReportComponent>& _xComponent); + OCustomShape(const OUString& _sComponentName); + + virtual void NbcMove( const Size& rSize ) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; + + virtual SdrPage* GetImplPage() const override; }; // OOle2Obj -class REPORTDESIGN_DLLPUBLIC OOle2Obj: public SdrOle2Obj , public OObjectBase +class REPORTDESIGN_DLLPUBLIC OOle2Obj final : public SdrOle2Obj , public OObjectBase { friend class OReportPage; friend class DlgEdFactory; - - sal_uInt16 m_nType; - bool m_bOnlyOnce; - void impl_createDataProvider_nothrow( const css::uno::Reference< css::frame::XModel>& _xModel); - virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override; - public: static OOle2Obj* Create( const css::uno::Reference< css::report::XReportComponent>& _xComponent,sal_uInt16 _nType ) { return new OOle2Obj( _xComponent,_nType ); } -protected: - OOle2Obj(const css::uno::Reference< css::report::XReportComponent>& _xComponent,sal_uInt16 _nType); - OOle2Obj(const OUString& _sComponentName,sal_uInt16 _nType); - - - virtual void NbcMove( const Size& rSize ) override; - virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; - virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; - virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; - - virtual SdrPage* GetImplPage() const override; - -public: virtual ~OOle2Obj() override; @@ -204,6 +181,24 @@ public: OOle2Obj& operator=(const OOle2Obj& rObj); void initializeChart( const css::uno::Reference< css::frame::XModel>& _xModel); + +private: + OOle2Obj(const css::uno::Reference< css::report::XReportComponent>& _xComponent,sal_uInt16 _nType); + OOle2Obj(const OUString& _sComponentName,sal_uInt16 _nType); + + + virtual void NbcMove( const Size& rSize ) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; + + virtual SdrPage* GetImplPage() const override; + + void impl_createDataProvider_nothrow( const css::uno::Reference< css::frame::XModel>& _xModel); + virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override; + + sal_uInt16 m_nType; + bool m_bOnlyOnce; }; diff --git a/reportdesign/source/filter/xml/xmlComponent.hxx b/reportdesign/source/filter/xml/xmlComponent.hxx index 1f3abc948006..1ab4d2c8e986 100644 --- a/reportdesign/source/filter/xml/xmlComponent.hxx +++ b/reportdesign/source/filter/xml/xmlComponent.hxx @@ -26,9 +26,8 @@ namespace rptxml { class ORptFilter; - class OXMLComponent : public SvXMLImportContext + class OXMLComponent final : public SvXMLImportContext { - protected: css::uno::Reference< css::report::XReportComponent > m_xComponent; OUString m_sTextStyleName; diff --git a/reportdesign/source/filter/xml/xmlFunction.hxx b/reportdesign/source/filter/xml/xmlFunction.hxx index b327b753c114..6f03bfa58133 100644 --- a/reportdesign/source/filter/xml/xmlFunction.hxx +++ b/reportdesign/source/filter/xml/xmlFunction.hxx @@ -28,9 +28,8 @@ namespace rptxml { class ORptFilter; - class OXMLFunction : public SvXMLImportContext + class OXMLFunction final : public SvXMLImportContext { - protected: css::uno::Reference< css::report::XFunctions > m_xFunctions; css::uno::Reference< css::report::XFunction > m_xFunction; bool m_bAddToReport; diff --git a/reportdesign/source/filter/xml/xmlGroup.hxx b/reportdesign/source/filter/xml/xmlGroup.hxx index ce0667f765e8..ba1fc508dece 100644 --- a/reportdesign/source/filter/xml/xmlGroup.hxx +++ b/reportdesign/source/filter/xml/xmlGroup.hxx @@ -26,9 +26,8 @@ namespace rptxml { class ORptFilter; - class OXMLGroup : public SvXMLImportContext + class OXMLGroup final : public SvXMLImportContext { - protected: css::uno::Reference< css::report::XGroups > m_xGroups; css::uno::Reference< css::report::XGroup > m_xGroup; diff --git a/reportdesign/source/ui/inc/ColorChanger.hxx b/reportdesign/source/ui/inc/ColorChanger.hxx index 06ecf7cd7bae..16cf429f24f5 100644 --- a/reportdesign/source/ui/inc/ColorChanger.hxx +++ b/reportdesign/source/ui/inc/ColorChanger.hxx @@ -24,9 +24,8 @@ namespace rptui //= ColorChanger - class ColorChanger + class ColorChanger final { - protected: VclPtr m_pDev; public: diff --git a/reportdesign/source/ui/inc/DefaultInspection.hxx b/reportdesign/source/ui/inc/DefaultInspection.hxx index 0dfbb46af1cb..e11e366d8b13 100644 --- a/reportdesign/source/ui/inc/DefaultInspection.hxx +++ b/reportdesign/source/ui/inc/DefaultInspection.hxx @@ -39,7 +39,7 @@ namespace rptui , css::lang::XServiceInfo , css::lang::XInitialization > DefaultComponentInspectorModel_Base; - class DefaultComponentInspectorModel : public DefaultComponentInspectorModel_Base + class DefaultComponentInspectorModel final : public DefaultComponentInspectorModel_Base { private: ::osl::Mutex m_aMutex; @@ -53,7 +53,7 @@ namespace rptui DefaultComponentInspectorModel(const DefaultComponentInspectorModel&) = delete; DefaultComponentInspectorModel& operator=(const DefaultComponentInspectorModel&) = delete; - protected: + virtual ~DefaultComponentInspectorModel() override; // XServiceInfo @@ -75,6 +75,9 @@ namespace rptui // XInitialization virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; + // Service constructors + void createWithHelpSection( sal_Int32 _nMinHelpTextLines, sal_Int32 _nMaxHelpTextLines ); + public: // XServiceInfo - static versions /// @throws css::uno::RuntimeException @@ -84,12 +87,7 @@ namespace rptui static css::uno::Reference< css::uno::XInterface > SAL_CALL create(const css::uno::Reference< css::uno::XComponentContext >&); - public: DefaultComponentInspectorModel( const css::uno::Reference< css::uno::XComponentContext >& _rxContext); - - protected: - // Service constructors - void createWithHelpSection( sal_Int32 _nMinHelpTextLines, sal_Int32 _nMaxHelpTextLines ); }; diff --git a/reportdesign/source/ui/inc/metadata.hxx b/reportdesign/source/ui/inc/metadata.hxx index 812a4bc0c9f0..fd2594c11c14 100644 --- a/reportdesign/source/ui/inc/metadata.hxx +++ b/reportdesign/source/ui/inc/metadata.hxx @@ -45,16 +45,8 @@ namespace rptui //= OPropertyInfoService - class OPropertyInfoService + class OPropertyInfoService final { - OPropertyInfoService(const OPropertyInfoService&) = delete; - void operator =(const OPropertyInfoService&) = delete; - OPropertyInfoService() = delete; - protected: - static sal_uInt16 s_nCount; - static OPropertyInfoImpl* s_pPropertyInfos; - // TODO: a real structure which allows quick access by name as well as by id - public: // IPropertyInfoService static sal_Int32 getPropertyId(const OUString& _rName); @@ -68,11 +60,19 @@ namespace rptui const css::uno::Reference< css::inspection::XPropertyHandler >& _xFormComponentHandler ); - protected: + private: static const OPropertyInfoImpl* getPropertyInfo(); static const OPropertyInfoImpl* getPropertyInfo(const OUString& _rName); static const OPropertyInfoImpl* getPropertyInfo(sal_Int32 _nId); + + OPropertyInfoService(const OPropertyInfoService&) = delete; + void operator =(const OPropertyInfoService&) = delete; + OPropertyInfoService() = delete; + + static sal_uInt16 s_nCount; + static OPropertyInfoImpl* s_pPropertyInfos; + // TODO: a real structure which allows quick access by name as well as by id }; diff --git a/reportdesign/source/ui/inc/propbrw.hxx b/reportdesign/source/ui/inc/propbrw.hxx index 6d4c6351704a..2fce13d76dc0 100644 --- a/reportdesign/source/ui/inc/propbrw.hxx +++ b/reportdesign/source/ui/inc/propbrw.hxx @@ -40,9 +40,8 @@ class OObjectBase; // PropBrw -class PropBrw : public DockingWindow , public SfxListener, public SfxBroadcaster +class PropBrw final : public DockingWindow , public SfxListener, public SfxBroadcaster { -private: css::uno::Reference< css::uno::XComponentContext > m_xInspectorContext; css::uno::Reference< css::uno::XComponentContext > @@ -62,7 +61,6 @@ private: PropBrw(PropBrw&) = delete; void operator =(PropBrw&) = delete; -protected: virtual void Resize() override; virtual bool Close() override; -- cgit