From 570eed8ce4761cea0aa74efc85c182bc4af45493 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 1 Nov 2017 17:32:31 +0200 Subject: loplugin:finalclasses in forms Change-Id: I0f849fd104699e2861aaba2d4be38168e80703b0 Reviewed-on: https://gerrit.libreoffice.org/44189 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- forms/source/component/CheckBox.hxx | 5 ++--- forms/source/component/ComboBox.hxx | 7 ++----- forms/source/component/Currency.hxx | 5 ++--- forms/source/component/Edit.hxx | 8 +++----- forms/source/component/Filter.hxx | 5 ++--- forms/source/component/FormattedField.hxx | 6 +----- forms/source/component/FormattedFieldWrapper.hxx | 7 ++----- forms/source/component/Grid.hxx | 7 ++----- forms/source/component/ImageControl.hxx | 6 ++---- forms/source/component/ListBox.hxx | 8 ++------ forms/source/component/RadioButton.hxx | 6 ++---- forms/source/richtext/richtextcontrol.hxx | 4 ++-- forms/source/richtext/richtextengine.hxx | 6 ++---- forms/source/solar/component/navbarcontrol.hxx | 16 +++++++--------- forms/source/solar/inc/navtoolbar.hxx | 4 ++-- forms/source/xforms/pathexpression.hxx | 3 +-- forms/source/xforms/submission/submission.hxx | 6 ++---- 17 files changed, 38 insertions(+), 71 deletions(-) (limited to 'forms') diff --git a/forms/source/component/CheckBox.hxx b/forms/source/component/CheckBox.hxx index 98421e1599e9..8b13a018afcb 100644 --- a/forms/source/component/CheckBox.hxx +++ b/forms/source/component/CheckBox.hxx @@ -26,9 +26,8 @@ namespace frm { -class OCheckBoxModel :public OReferenceValueComponent +class OCheckBoxModel final : public OReferenceValueComponent { -protected: bool DbUseBool(); public: @@ -52,7 +51,7 @@ public: css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps ) const override; -protected: +private: virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; // OBoundControlModel overridables diff --git a/forms/source/component/ComboBox.hxx b/forms/source/component/ComboBox.hxx index ba840bc592c2..6e84fba4b57d 100644 --- a/forms/source/component/ComboBox.hxx +++ b/forms/source/component/ComboBox.hxx @@ -42,7 +42,7 @@ namespace frm { -class OComboBoxModel +class OComboBoxModel final :public OBoundControlModel ,public OEntryListHelper ,public OErrorBroadcaster @@ -63,8 +63,6 @@ class OComboBoxModel ::std::unique_ptr< ::dbtools::FormattedColumnValue > m_pValueFormatter; - -protected: virtual css::uno::Sequence< css::uno::Type> _getTypes() override; public: @@ -112,7 +110,7 @@ public: // prevent method hiding using OBoundControlModel::getFastPropertyValue; -protected: +private: // OBoundControlModel overridables virtual css::uno::Any translateDbColumnToControlValue( ) override; virtual bool commitControlValueToDbColumn( bool _bPostReset ) override; @@ -130,7 +128,6 @@ protected: virtual void disconnectedExternalListSource( ) override; virtual void refreshInternalEntryList() override; -protected: void loadData( bool _bForce ); virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; diff --git a/forms/source/component/Currency.hxx b/forms/source/component/Currency.hxx index 61e60ac00e2b..df7b36328298 100644 --- a/forms/source/component/Currency.hxx +++ b/forms/source/component/Currency.hxx @@ -26,7 +26,7 @@ namespace frm { -class OCurrencyModel +class OCurrencyModel final :public OEditBaseModel { css::uno::Any m_aSaveValue; @@ -48,7 +48,7 @@ public: css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps ) const override; -protected: +private: // OBoundControlModel overridables virtual css::uno::Any translateDbColumnToControlValue( ) override; virtual bool commitControlValueToDbColumn( bool _bPostReset ) override; @@ -57,7 +57,6 @@ protected: virtual void resetNoBroadcast() override; -protected: virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; void implConstruct(); diff --git a/forms/source/component/Edit.hxx b/forms/source/component/Edit.hxx index f202959f6bc0..af552528333c 100644 --- a/forms/source/component/Edit.hxx +++ b/forms/source/component/Edit.hxx @@ -32,7 +32,7 @@ struct ImplSVEvent; namespace frm { -class OEditModel : public OEditBaseModel +class OEditModel final : public OEditBaseModel { ::std::unique_ptr< ::dbtools::FormattedColumnValue > m_pValueFormatter; @@ -43,7 +43,7 @@ class OEditModel : public OEditBaseModel public: DECLARE_DEFAULT_LEAF_XTOR( OEditModel ); -protected: +private: void enableFormattedWriteFake() { m_bWritingFormattedFake = true; } void disableFormattedWriteFake() { m_bWritingFormattedFake = false; } bool lastReadWasFormattedFake() const { return (getLastReadVersion() & PF_FAKE_FORMATTED_FIELD) != 0; } @@ -85,7 +85,7 @@ public: // XEventListener using OBoundControlModel::disposing; -protected: +private: // OControlModel overridables virtual void writeAggregate( const css::uno::Reference< css::io::XObjectOutputStream >& _rxOutStream ) const override; virtual void readAggregate( const css::uno::Reference< css::io::XObjectInputStream >& _rxInStream ) override; @@ -101,12 +101,10 @@ protected: virtual bool approveDbColumnType( sal_Int32 _nColumnType ) override; -protected: virtual sal_uInt16 getPersistenceFlags() const override; virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; -private: bool implActsAsRichText( ) const; }; diff --git a/forms/source/component/Filter.hxx b/forms/source/component/Filter.hxx index ff7225114714..453e9c52f7bd 100644 --- a/forms/source/component/Filter.hxx +++ b/forms/source/component/Filter.hxx @@ -53,7 +53,7 @@ namespace frm , css::lang::XInitialization > OFilterControl_BASE; - class OFilterControl :public UnoControl + class OFilterControl final :public UnoControl ,public OFilterControl_BASE ,public ::svxform::OParseContextClient { @@ -74,7 +74,6 @@ namespace frm bool m_bMultiLine : 1; bool m_bFilterListFilled : 1; - private: void implInitFilterList(); void initControlModel(css::uno::Reference< css::beans::XPropertySet > const & xControlModel); @@ -127,7 +126,7 @@ namespace frm virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - protected: + private: virtual void PrepareWindowDescriptor( css::awt::WindowDescriptor& rDesc ) override; virtual void ImplSetPeerProperty( const OUString& rPropName, const css::uno::Any& rVal ) override; diff --git a/forms/source/component/FormattedField.hxx b/forms/source/component/FormattedField.hxx index 317f18a608ce..f64a5c94ff44 100644 --- a/forms/source/component/FormattedField.hxx +++ b/forms/source/component/FormattedField.hxx @@ -30,7 +30,7 @@ struct ImplSVEvent; namespace frm { -class OFormattedModel +class OFormattedModel final :public OEditBaseModel ,public OErrorBroadcaster { @@ -46,7 +46,6 @@ class OFormattedModel bool m_bOriginalNumeric : 1, m_bNumeric : 1; // analogous for the TreatAsNumeric-property - protected: css::uno::Reference< css::util::XNumberFormatsSupplier> calcDefaultFormatsSupplier() const; css::uno::Reference< css::util::XNumberFormatsSupplier> calcFormFormatsSupplier() const; css::uno::Reference< css::util::XNumberFormatsSupplier> calcFormatsSupplier() const; @@ -55,7 +54,6 @@ class OFormattedModel friend class OFormattedFieldWrapper; - protected: // XInterface DECLARE_UNO3_AGG_DEFAULTS( OFormattedModel, OEditBaseModel ) @@ -104,7 +102,6 @@ class OFormattedModel using OEditBaseModel::disposing; using OEditBaseModel::getFastPropertyValue; - protected: virtual sal_uInt16 getPersistenceFlags() const override; // as we have an own version handling for persistence @@ -128,7 +125,6 @@ class OFormattedModel virtual void onConnectedDbColumn( const css::uno::Reference< css::uno::XInterface >& _rxForm ) override; virtual void onDisconnectedDbColumn() override; - private: virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; void implConstruct(); diff --git a/forms/source/component/FormattedFieldWrapper.hxx b/forms/source/component/FormattedFieldWrapper.hxx index a66ddc997e16..77e196d5855f 100644 --- a/forms/source/component/FormattedFieldWrapper.hxx +++ b/forms/source/component/FormattedFieldWrapper.hxx @@ -37,21 +37,18 @@ typedef ::cppu::WeakAggImplHelper3 < css::io::XPersistObject , css::util::XCloneable > OFormattedFieldWrapper_Base; -class OFormattedFieldWrapper : public OFormattedFieldWrapper_Base +class OFormattedFieldWrapper final : public OFormattedFieldWrapper_Base { css::uno::Reference< css::uno::XComponentContext> m_xContext; -protected: css::uno::Reference< css::uno::XAggregation> m_xAggregate; rtl::Reference< OEditModel > m_pEditPart; // if we act as formatted this is used to write the EditModel part css::uno::Reference< css::io::XPersistObject> m_xFormattedPart; -private: OFormattedFieldWrapper(const css::uno::Reference< css::uno::XComponentContext>& _rxFactory); -protected: virtual ~OFormattedFieldWrapper() override; public: @@ -78,7 +75,7 @@ public: // XCloneable virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; -protected: +private: /// ensure we're in a defined state, which means a FormattedModel _OR_ an EditModel void ensureAggregate(); }; diff --git a/forms/source/component/Grid.hxx b/forms/source/component/Grid.hxx index a844b87a9dd2..2e8e77ad1e02 100644 --- a/forms/source/component/Grid.hxx +++ b/forms/source/component/Grid.hxx @@ -51,7 +51,7 @@ typedef ::cppu::ImplHelper7 < css::awt::XControlModel , css::sdb::XRowSetChangeBroadcaster > OGridControlModel_BASE; -class OGridControlModel :public OControlModel +class OGridControlModel final :public OControlModel ,public OInterfaceContainer ,public OErrorBroadcaster ,public FontControlModel @@ -87,7 +87,6 @@ class OGridControlModel :public OControlModel bool m_bDisplaySynchron : 1; // transient // [properties] -protected: void _reset(); public: @@ -164,10 +163,9 @@ public: using OControlModel::disposing; using OControlModel::getFastPropertyValue; -protected: +private: virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; -protected: virtual void approveNewElement( const css::uno::Reference< css::beans::XPropertySet >& _rxObject, ElementDescription* _pElement @@ -179,7 +177,6 @@ protected: virtual ElementDescription* createElementMetaData( ) override; -protected: virtual void implRemoved(const css::uno::Reference& _rxObject) override; virtual void implInserted( const ElementDescription* _pElement ) override; virtual void impl_replacedElement( diff --git a/forms/source/component/ImageControl.hxx b/forms/source/component/ImageControl.hxx index 07689b802b26..920a459200f9 100644 --- a/forms/source/component/ImageControl.hxx +++ b/forms/source/component/ImageControl.hxx @@ -43,7 +43,7 @@ typedef ::cppu::ImplHelper2 < css::form::XImageProducerSupplier , css::awt::XImageProducer > OImageControlModel_Base; -class OImageControlModel +class OImageControlModel final :public OImageControlModel_Base ,public OBoundControlModel { @@ -55,7 +55,6 @@ class OImageControlModel m_xGraphicObject; OUString m_sDocumentURL; -protected: // UNO binding virtual css::uno::Sequence< css::uno::Type> _getTypes() override; @@ -104,7 +103,7 @@ public: using OBoundControlModel::disposing; using OBoundControlModel::getFastPropertyValue; -protected: +private: // OBoundControlModel overridables virtual void onConnectedDbColumn( const css::uno::Reference< css::uno::XInterface >& _rxForm ) override; virtual void onDisconnectedDbColumn() override; @@ -118,7 +117,6 @@ protected: virtual void resetNoBroadcast() override; -protected: virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; void implConstruct(); diff --git a/forms/source/component/ListBox.hxx b/forms/source/component/ListBox.hxx index 2a0f76e669d1..d0c9173e2468 100644 --- a/forms/source/component/ListBox.hxx +++ b/forms/source/component/ListBox.hxx @@ -97,7 +97,7 @@ namespace frm typedef ::std::vector< ::connectivity::ORowSetValue > ValueList; -class OListBoxModel :public OBoundControlModel +class OListBoxModel final :public OBoundControlModel ,public OEntryListHelper ,public OErrorBroadcaster { @@ -145,7 +145,7 @@ public: virtual sal_Bool SAL_CALL convertFastPropertyValue( css::uno::Any& _rConvertedValue, css::uno::Any& _rOldValue, sal_Int32 _nHandle, const css::uno::Any& _rValue ) override; -protected: +private: static const ::connectivity::ORowSetValue s_aEmptyValue; static const ::connectivity::ORowSetValue s_aEmptyStringValue; @@ -177,7 +177,6 @@ protected: using OBoundControlModel::getFastPropertyValue; using OBoundControlModel::setPropertyValues; -protected: // OBoundControlModel overridables virtual css::uno::Any translateDbColumnToControlValue( ) override; virtual css::uno::Sequence< css::uno::Type > @@ -201,7 +200,6 @@ protected: virtual void disconnectedExternalListSource( ) override; virtual void refreshInternalEntryList() override; -protected: virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; void init(); @@ -214,8 +212,6 @@ protected: const ::connectivity::ORowSetValue &aValue) const; - -private: void loadData( bool _bForce ); /** refreshes the list boxes list data diff --git a/forms/source/component/RadioButton.hxx b/forms/source/component/RadioButton.hxx index 3a3a4a6e53dd..be671f616b48 100644 --- a/forms/source/component/RadioButton.hxx +++ b/forms/source/component/RadioButton.hxx @@ -26,7 +26,7 @@ namespace frm { -class ORadioButtonModel :public OReferenceValueComponent +class ORadioButtonModel final : public OReferenceValueComponent { public: DECLARE_DEFAULT_LEAF_XTOR( ORadioButtonModel ); @@ -55,18 +55,16 @@ public: css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps ) const override; -protected: +private: // OBoundControlModel overridables virtual css::uno::Any translateDbColumnToControlValue( ) override; virtual bool commitControlValueToDbColumn( bool _bPostReset ) override; virtual css::uno::Any translateExternalValueToControlValue( const css::uno::Any& _rExternalValue ) const override; -protected: void SetSiblingPropsTo(const OUString& rPropName, const css::uno::Any& rValue); virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; -private: void setControlSource(); }; diff --git a/forms/source/richtext/richtextcontrol.hxx b/forms/source/richtext/richtextcontrol.hxx index c48fa618da62..0c552848df5b 100644 --- a/forms/source/richtext/richtextcontrol.hxx +++ b/forms/source/richtext/richtextcontrol.hxx @@ -75,7 +75,7 @@ namespace frm typedef ::cppu::ImplHelper1 < css::frame::XDispatchProvider > ORichTextPeer_Base; - class ORichTextPeer :public VCLXWindow + class ORichTextPeer final :public VCLXWindow ,public ORichTextPeer_Base ,public ITextSelectionListener { @@ -96,7 +96,7 @@ namespace frm // XInterface DECLARE_XINTERFACE( ) - protected: + private: ORichTextPeer(); virtual ~ORichTextPeer() override; diff --git a/forms/source/richtext/richtextengine.hxx b/forms/source/richtext/richtextengine.hxx index a6ce40624793..e71189907e4f 100644 --- a/forms/source/richtext/richtextengine.hxx +++ b/forms/source/richtext/richtextengine.hxx @@ -39,7 +39,7 @@ namespace frm ~IEngineStatusListener() {} }; - class RichTextEngine : public EditEngine + class RichTextEngine final : public EditEngine { private: SfxItemPool* m_pEnginePool; @@ -57,16 +57,14 @@ namespace frm SfxItemPool* getPool() { return m_pEnginePool; } - protected: + private: /** constructs a new RichTextEngine. The instances takes the ownership of the given SfxItemPool */ explicit RichTextEngine( SfxItemPool* _pPool ); - private: RichTextEngine( const RichTextEngine& ) = delete; RichTextEngine& operator=( const RichTextEngine& ) = delete; - private: DECL_LINK( EditEngineStatusChanged, EditStatus&, void ); }; diff --git a/forms/source/solar/component/navbarcontrol.hxx b/forms/source/solar/component/navbarcontrol.hxx index 052cceedc8d7..bab88d1076a5 100644 --- a/forms/source/solar/component/navbarcontrol.hxx +++ b/forms/source/solar/component/navbarcontrol.hxx @@ -72,7 +72,7 @@ namespace frm virtual void SAL_CALL releaseDispatchProviderInterceptor( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& Interceptor ) override; }; - class ONavigationBarPeer + class ONavigationBarPeer final :public VCLXWindow ,public OFormNavigationHelper { @@ -85,13 +85,6 @@ namespace frm const css::uno::Reference< css::awt::XControlModel >& _rxModel ); - protected: - explicit ONavigationBarPeer( - const css::uno::Reference< css::uno::XComponentContext >& _rxORB - ); - virtual ~ONavigationBarPeer() override; - - public: // XInterface DECLARE_XINTERFACE( ) @@ -101,7 +94,12 @@ namespace frm // XWindow2 using VCLXWindow::isEnabled; - protected: + private: + explicit ONavigationBarPeer( + const css::uno::Reference< css::uno::XComponentContext >& _rxORB + ); + virtual ~ONavigationBarPeer() override; + // XTypeProvider DECLARE_XTYPEPROVIDER( ) diff --git a/forms/source/solar/inc/navtoolbar.hxx b/forms/source/solar/inc/navtoolbar.hxx index b8fb4f6030b7..47347b9dc087 100644 --- a/forms/source/solar/inc/navtoolbar.hxx +++ b/forms/source/solar/inc/navtoolbar.hxx @@ -36,7 +36,7 @@ namespace frm class ImplNavToolBar; - class NavigationToolBar : public vcl::Window + class NavigationToolBar final : public vcl::Window { public: enum ImageSize @@ -115,7 +115,7 @@ namespace frm void SetTextLineColor( ); void SetTextLineColor( const Color& rColor ); - protected: + private: // Window overridables virtual void Resize() override; virtual void StateChanged( StateChangedType nType ) override; diff --git a/forms/source/xforms/pathexpression.hxx b/forms/source/xforms/pathexpression.hxx index 4204bfe5223b..44d9630df4ac 100644 --- a/forms/source/xforms/pathexpression.hxx +++ b/forms/source/xforms/pathexpression.hxx @@ -39,7 +39,7 @@ namespace xforms { /** PathExpression represents an XPath Expression and caches results */ -class PathExpression : public ComputedExpression +class PathExpression final : public ComputedExpression { public: typedef std::vector > NodeVector_t; @@ -48,7 +48,6 @@ private: /// the node-list result from the last bind (cached from mxResult) NodeVector_t maNodes; -protected: /// get expression for evaluation const OUString _getExpressionForEvaluation() const; diff --git a/forms/source/xforms/submission/submission.hxx b/forms/source/xforms/submission/submission.hxx index facbc64d5be7..7d726392c736 100644 --- a/forms/source/xforms/submission/submission.hxx +++ b/forms/source/xforms/submission/submission.hxx @@ -50,14 +50,13 @@ class CSubmissionPut; class CSubmissionPost; class CSubmissionGet; -class CCommandEnvironmentHelper : public cppu::WeakImplHelper< css::ucb::XCommandEnvironment > +class CCommandEnvironmentHelper final : public cppu::WeakImplHelper< css::ucb::XCommandEnvironment > { friend class CSubmissionPut; friend class CSubmissionPost; friend class CSubmissionGet; friend class CSubmission; -protected: css::uno::Reference< css::task::XInteractionHandler > m_aInteractionHandler; css::uno::Reference< css::ucb::XProgressHandler > m_aProgressHandler; @@ -72,12 +71,11 @@ public: } }; -class CProgressHandlerHelper : public cppu::WeakImplHelper< css::ucb::XProgressHandler > +class CProgressHandlerHelper final : public cppu::WeakImplHelper< css::ucb::XProgressHandler > { friend class CSubmissionPut; friend class CSubmissionPost; friend class CSubmissionGet; -protected: osl::Condition m_cFinished; osl::Mutex m_mLock; sal_Int32 m_count; -- cgit