[Libreoffice-commits] core.git: include/toolkit include/tools toolkit/inc

Noel Grandin noel.grandin at collabora.co.uk
Fri Oct 20 18:35:52 UTC 2017


 include/toolkit/awt/vclxbitmap.hxx                    |    4 -
 include/toolkit/awt/vclxfont.hxx                      |    4 -
 include/toolkit/awt/vclxpointer.hxx                   |    4 -
 include/toolkit/awt/vclxregion.hxx                    |    4 -
 include/toolkit/controls/accessiblecontrolcontext.hxx |   43 +++++++--------
 include/toolkit/controls/formattedcontrol.hxx         |   49 ++++++++----------
 include/toolkit/controls/roadmapentry.hxx             |   17 +-----
 include/toolkit/controls/stdtabcontroller.hxx         |    3 -
 include/toolkit/controls/stdtabcontrollermodel.hxx    |    4 -
 include/toolkit/controls/unocontrols.hxx              |    5 -
 include/tools/b3dtrans.hxx                            |   18 +++---
 include/tools/color.hxx                               |    3 -
 toolkit/inc/helper/unopropertyarrayhelper.hxx         |    4 -
 13 files changed, 66 insertions(+), 96 deletions(-)

New commits:
commit 22fa30c2f6aa541f6b1db002d276459d137490c8
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Oct 20 13:44:12 2017 +0200

    loplugin:finalclasses in toolkit,tools
    
    Change-Id: I365d9a5057b35bf0441ac8fbfef4447a25652760
    Reviewed-on: https://gerrit.libreoffice.org/43601
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/toolkit/awt/vclxbitmap.hxx b/include/toolkit/awt/vclxbitmap.hxx
index 891a8b42b536..cc83653e751a 100644
--- a/include/toolkit/awt/vclxbitmap.hxx
+++ b/include/toolkit/awt/vclxbitmap.hxx
@@ -32,17 +32,15 @@
 //  class VCLXBitmap
 
 
-class VCLXBitmap :  public css::awt::XBitmap,
+class VCLXBitmap final : public css::awt::XBitmap,
                     public css::awt::XDisplayBitmap,
                     public css::lang::XTypeProvider,
                     public css::lang::XUnoTunnel,
                     public ::cppu::OWeakObject
 {
-private:
     ::osl::Mutex    maMutex;
     BitmapEx        maBitmap;
 
-protected:
     ::osl::Mutex&   GetMutex() { return maMutex; }
 
 
diff --git a/include/toolkit/awt/vclxfont.hxx b/include/toolkit/awt/vclxfont.hxx
index 080f9feacc64..9b12b496a21b 100644
--- a/include/toolkit/awt/vclxfont.hxx
+++ b/include/toolkit/awt/vclxfont.hxx
@@ -34,19 +34,17 @@
 //  class VCLXFont
 
 
-class TOOLKIT_DLLPUBLIC VCLXFont :  public css::awt::XFont2,
+class TOOLKIT_DLLPUBLIC VCLXFont final : public css::awt::XFont2,
                     public css::lang::XTypeProvider,
                     public css::lang::XUnoTunnel,
                     public ::cppu::OWeakObject
 {
-private:
     ::osl::Mutex    maMutex;
     css::uno::Reference< css::awt::XDevice> mxDevice;
     vcl::Font       maFont;
     std::unique_ptr<FontMetric>
                     mpFontMetric;
 
-protected:
     bool            ImplAssertValidFontMetric();
     ::osl::Mutex&   GetMutex() { return maMutex; }
 
diff --git a/include/toolkit/awt/vclxpointer.hxx b/include/toolkit/awt/vclxpointer.hxx
index 23bcb1c122a0..951efeb7457c 100644
--- a/include/toolkit/awt/vclxpointer.hxx
+++ b/include/toolkit/awt/vclxpointer.hxx
@@ -33,14 +33,12 @@
 //  class VCLXPointer
 
 
-class VCLXPointer: public cppu::WeakImplHelper<
+class VCLXPointer final : public cppu::WeakImplHelper<
     css::awt::XPointer, css::lang::XUnoTunnel, css::lang::XServiceInfo>
 {
-private:
     ::osl::Mutex    maMutex;
     Pointer         maPointer;
 
-protected:
     ::osl::Mutex&   GetMutex() { return maMutex; }
 
 public:
diff --git a/include/toolkit/awt/vclxregion.hxx b/include/toolkit/awt/vclxregion.hxx
index 86dc44d4eaca..82ec095be43a 100644
--- a/include/toolkit/awt/vclxregion.hxx
+++ b/include/toolkit/awt/vclxregion.hxx
@@ -33,16 +33,14 @@
 //  class VCLXRegion
 
 
-class VCLXRegion :  public css::awt::XRegion,
+class VCLXRegion final : public css::awt::XRegion,
                     public css::lang::XTypeProvider,
                     public css::lang::XUnoTunnel,
                     public ::cppu::OWeakObject
 {
-private:
     ::osl::Mutex    maMutex;
     vcl::Region          maRegion;
 
-protected:
     ::osl::Mutex&   GetMutex() { return maMutex; }
 
 public:
diff --git a/include/toolkit/controls/accessiblecontrolcontext.hxx b/include/toolkit/controls/accessiblecontrolcontext.hxx
index cbd304a1334d..180fd538551c 100644
--- a/include/toolkit/controls/accessiblecontrolcontext.hxx
+++ b/include/toolkit/controls/accessiblecontrolcontext.hxx
@@ -47,31 +47,11 @@ namespace toolkit
         control model, and a weak reference to the control. The reference to the model is freed when the model
         is being disposed.</p>
     */
-    class OAccessibleControlContext
+    class OAccessibleControlContext final
             :public ::comphelper::OAccessibleImplementationAccess
             ,public OAccessibleControlContext_Base
             ,public OAccessibleControlContext_IBase
     {
-    private:
-        css::uno::Reference< css::beans::XPropertySet >
-                    m_xControlModel;        // the model of the control which's context we implement
-        css::uno::Reference< css::beans::XPropertySetInfo >
-                    m_xModelPropsInfo;      // the cached property set info of the model
-
-    protected:
-        /// ctor. @see Init
-        OAccessibleControlContext();
-        virtual ~OAccessibleControlContext() override;
-
-        /** late ctor
-        */
-        void Init(
-            const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator
-        );
-
-        // OCommonAccessibleComponent overridables
-        virtual css::awt::Rectangle implGetBounds(  ) override;
-
     public:
         /** creates an accessible context for an uno control
         @param _rxCreator
@@ -82,7 +62,7 @@ namespace toolkit
             const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator
         );
 
-    protected:
+    private:
         // XInterface
         DECLARE_XINTERFACE( )
         DECLARE_XTYPEPROVIDER( )
@@ -107,7 +87,6 @@ namespace toolkit
         using comphelper::OAccessibleContextHelper::disposing;
         virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
 
-    private:
         // retrieves the value of a string property from the model, if the property is present
         OUString getModelStringProperty( const sal_Char* _pPropertyName );
 
@@ -117,6 +96,24 @@ namespace toolkit
         void stopModelListening( );
 
         VclPtr< vcl::Window > implGetWindow( css::uno::Reference< css::awt::XWindow >* _pxUNOWindow = nullptr ) const;
+
+        /// ctor. @see Init
+        OAccessibleControlContext();
+        virtual ~OAccessibleControlContext() override;
+
+        /** late ctor
+        */
+        void Init(
+            const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator
+        );
+
+        // OCommonAccessibleComponent overridables
+        virtual css::awt::Rectangle implGetBounds(  ) override;
+
+        css::uno::Reference< css::beans::XPropertySet >
+                    m_xControlModel;        // the model of the control which's context we implement
+        css::uno::Reference< css::beans::XPropertySetInfo >
+                    m_xModelPropsInfo;      // the cached property set info of the model
     };
 
 
diff --git a/include/toolkit/controls/formattedcontrol.hxx b/include/toolkit/controls/formattedcontrol.hxx
index 0e9e87781ed5..f600702b3027 100644
--- a/include/toolkit/controls/formattedcontrol.hxx
+++ b/include/toolkit/controls/formattedcontrol.hxx
@@ -33,30 +33,8 @@ namespace toolkit
 
     // = UnoControlFormattedFieldModel
 
-    class UnoControlFormattedFieldModel : public UnoControlModel
+    class UnoControlFormattedFieldModel final : public UnoControlModel
     {
-    protected:
-        css::uno::Any      ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
-        ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
-        css::uno::Any      m_aCachedFormat;
-        bool                            m_bRevokedAsClient;
-        bool                            m_bSettingValueAndText;
-        css::uno::Reference< css::util::XNumberFormatter >
-                                        m_xCachedFormatter;
-
-    protected:
-        sal_Bool SAL_CALL convertFastPropertyValue(
-                    css::uno::Any& rConvertedValue,
-                    css::uno::Any& rOldValue,
-                    sal_Int32 nPropId,
-                    const css::uno::Any& rValue
-                ) override;
-
-        void SAL_CALL setFastPropertyValue_NoBroadcast(
-                    sal_Int32 nHandle,
-                    const css::uno::Any& rValue
-                ) override;
-
     public:
         UnoControlFormattedFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
         UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel )
@@ -80,11 +58,11 @@ namespace toolkit
 
         css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
 
-    protected:
+    private:
         virtual ~UnoControlFormattedFieldModel() override;
 
         // XComponent
-        void SAL_CALL dispose(  ) override;
+        void SAL_CALL dispose() override;
 
         // XPropertySet
         void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& PropertyNames, const css::uno::Sequence< css::uno::Any >& Values ) override;
@@ -96,10 +74,29 @@ namespace toolkit
                         css::uno::Any*     _pValues,       /// the values of the properties to set
                         sal_Int32*                      _pValidHandles  /// pointer to the valid handles, allowed to be adjusted
                     )   const override;
-    private:
         void    impl_updateTextFromValue_nothrow();
         void    impl_updateCachedFormatter_nothrow();
         void    impl_updateCachedFormatKey_nothrow();
+
+        css::uno::Any      ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+        ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+        sal_Bool SAL_CALL convertFastPropertyValue(
+                    css::uno::Any& rConvertedValue,
+                    css::uno::Any& rOldValue,
+                    sal_Int32 nPropId,
+                    const css::uno::Any& rValue
+                ) override;
+
+        void SAL_CALL setFastPropertyValue_NoBroadcast(
+                    sal_Int32 nHandle,
+                    const css::uno::Any& rValue
+                ) override;
+
+        css::uno::Any      m_aCachedFormat;
+        bool               m_bRevokedAsClient;
+        bool               m_bSettingValueAndText;
+        css::uno::Reference< css::util::XNumberFormatter >
+                           m_xCachedFormatter;
     };
 
 
diff --git a/include/toolkit/controls/roadmapentry.hxx b/include/toolkit/controls/roadmapentry.hxx
index 64b95886798a..7695ecffdcba 100644
--- a/include/toolkit/controls/roadmapentry.hxx
+++ b/include/toolkit/controls/roadmapentry.hxx
@@ -34,7 +34,7 @@
 
 typedef cppu::WeakImplHelper< css::lang::XServiceInfo > ORoadmapEntry_Base;
 
-class ORoadmapEntry :public ORoadmapEntry_Base
+class ORoadmapEntry final : public ORoadmapEntry_Base
             ,public ::comphelper::OMutexAndBroadcastHelper
             ,public ::comphelper::OPropertyContainer
             ,public ::comphelper::OPropertyArrayUsageHelper< ORoadmapEntry >
@@ -43,7 +43,7 @@ class ORoadmapEntry :public ORoadmapEntry_Base
 public:
        ORoadmapEntry();
 
-protected:
+private:
     DECLARE_XINTERFACE()        // merge XInterface implementations
     DECLARE_XTYPEPROVIDER()     // merge XTypeProvider implementations
 
@@ -61,19 +61,10 @@ protected:
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) override;
 
-
-    // other stuff
-
-    // (e.g. DECLARE_SERVICE_INFO();)
-
-protected:
-    // <properties>
-    OUString     m_sLabel;
-    sal_Int32           m_nID;
+    OUString        m_sLabel;
+    sal_Int32       m_nID;
     bool            m_bEnabled;
     bool            m_bInteractive;
-
-    // </properties>
 };
 
 #endif
diff --git a/include/toolkit/controls/stdtabcontroller.hxx b/include/toolkit/controls/stdtabcontroller.hxx
index 69ce7482196c..c39c2da70871 100644
--- a/include/toolkit/controls/stdtabcontroller.hxx
+++ b/include/toolkit/controls/stdtabcontroller.hxx
@@ -32,7 +32,7 @@
 #include <toolkit/helper/servicenames.hxx>
 
 
-class StdTabController :    public css::awt::XTabController,
+class StdTabController final : public css::awt::XTabController,
                             public css::lang::XServiceInfo,
                             public css::lang::XTypeProvider,
                             public ::cppu::OWeakAggObject
@@ -42,7 +42,6 @@ private:
     css::uno::Reference< css::awt::XTabControllerModel >  mxModel;
     css::uno::Reference< css::awt::XControlContainer >    mxControlContainer;
 
-protected:
     ::osl::Mutex&               GetMutex() { return maMutex; }
     static bool                 ImplCreateComponentSequence( css::uno::Sequence< css::uno::Reference< css::awt::XControl > >& rControls, const css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& rModels, css::uno::Sequence< css::uno::Reference< css::awt::XWindow > >& rComponents, css::uno::Sequence< css::uno::Any>* pTabStops, bool bPeerComponent );
     // if sequence length of rModels is less than rControls, return only the matching elements in rModels sequence and remove corresponding elements from rControls
diff --git a/include/toolkit/controls/stdtabcontrollermodel.hxx b/include/toolkit/controls/stdtabcontrollermodel.hxx
index def33673d567..19884f505229 100644
--- a/include/toolkit/controls/stdtabcontrollermodel.hxx
+++ b/include/toolkit/controls/stdtabcontrollermodel.hxx
@@ -79,18 +79,16 @@ typedef ::std::vector< ComponentEntry* > ComponentEntryList;
 
 #define CONTROLPOS_NOTFOUND 0xFFFFFFFF
 
-class StdTabControllerModel :   public css::awt::XTabControllerModel,
+class StdTabControllerModel final : public css::awt::XTabControllerModel,
                                 public css::lang::XServiceInfo,
                                 public css::io::XPersistObject,
                                 public css::lang::XTypeProvider,
                                 public ::cppu::OWeakAggObject
 {
-private:
     ::osl::Mutex                maMutex;
     UnoControlModelEntryList    maControls;
     bool                    mbGroupControl;
 
-protected:
     ::osl::Mutex&           GetMutex() { return maMutex; }
     sal_uInt32              ImplGetControlCount( const UnoControlModelEntryList& rList ) const;
     void                    ImplGetControlModels( css::uno::Reference< css::awt::XControlModel > ** pRefs, const UnoControlModelEntryList& rList ) const;
diff --git a/include/toolkit/controls/unocontrols.hxx b/include/toolkit/controls/unocontrols.hxx
index 54082d8324b6..7da16557cde3 100644
--- a/include/toolkit/controls/unocontrols.hxx
+++ b/include/toolkit/controls/unocontrols.hxx
@@ -859,7 +859,7 @@ typedef ::cppu::AggImplInheritanceHelper5   <   UnoControlBase
                                             ,   css::awt::XTextLayoutConstrains
                                             ,   css::awt::XItemListListener
                                             >   UnoListBoxControl_Base;
-class TOOLKIT_DLLPUBLIC UnoListBoxControl : public UnoListBoxControl_Base
+class TOOLKIT_DLLPUBLIC UnoListBoxControl final : public UnoListBoxControl_Base
 {
 public:
                         UnoListBoxControl();
@@ -919,12 +919,11 @@ public:
     OUString SAL_CALL getImplementationName(  ) override;
     css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
 
-protected:
+private:
     void                ImplUpdateSelectedItemsProperty();
     virtual void        ImplSetPeerProperty( const OUString& rPropName, const css::uno::Any& rVal ) override;
     virtual void        updateFromModel() override;
 
-private:
     ActionListenerMultiplexer   maActionListeners;
     ItemListenerMultiplexer     maItemListeners;
 };
diff --git a/include/tools/b3dtrans.hxx b/include/tools/b3dtrans.hxx
index eca70105b248..64d273bcbfc0 100644
--- a/include/tools/b3dtrans.hxx
+++ b/include/tools/b3dtrans.hxx
@@ -174,15 +174,8 @@ protected:
 
 // B3D camera
 
-class SAL_WARN_UNUSED TOOLS_DLLPUBLIC B3dCamera : public B3dViewport
+class SAL_WARN_UNUSED TOOLS_DLLPUBLIC B3dCamera final : public B3dViewport
 {
-private:
-    basegfx::B3DPoint       aPosition;
-    basegfx::B3DPoint       aCorrectedPosition;
-    basegfx::B3DVector  aLookAt;
-    double                  fFocalLength;
-    double                  fBankAngle;
-
 public:
     B3dCamera(
         const basegfx::B3DPoint& rPos = basegfx::B3DPoint(0.0, 0.0, 1.0),
@@ -190,11 +183,18 @@ public:
         double fFocLen = 35.0, double fBnkAng = 0.0);
     virtual ~B3dCamera() override;
 
-protected:
+private:
     void CalcNewViewportValues();
     bool CalcFocalLength();
 
     virtual void DeviceRectangleChange() override;
+
+    basegfx::B3DPoint       aPosition;
+    basegfx::B3DPoint       aCorrectedPosition;
+    basegfx::B3DVector  aLookAt;
+    double                  fFocalLength;
+    double                  fBankAngle;
+
 };
 
 #endif
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index 592d69ad458d..0173840d80ff 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -28,9 +28,8 @@ class SvStream;
 
 // Color
 
-class SAL_WARN_UNUSED TOOLS_DLLPUBLIC Color
+class SAL_WARN_UNUSED TOOLS_DLLPUBLIC Color final
 {
-protected:
     ColorData mnColor;
 
 public:
diff --git a/toolkit/inc/helper/unopropertyarrayhelper.hxx b/toolkit/inc/helper/unopropertyarrayhelper.hxx
index a8dee674a308..99884d843243 100644
--- a/toolkit/inc/helper/unopropertyarrayhelper.hxx
+++ b/toolkit/inc/helper/unopropertyarrayhelper.hxx
@@ -29,12 +29,10 @@
 
 //  class UnoPropertyArrayHelper
 
-class TOOLKIT_DLLPUBLIC UnoPropertyArrayHelper : public ::cppu::IPropertyArrayHelper
+class TOOLKIT_DLLPUBLIC UnoPropertyArrayHelper final : public ::cppu::IPropertyArrayHelper
 {
-private:
     std::set<sal_Int32>       maIDs;
 
-protected:
     bool    ImplHasProperty( sal_uInt16 nPropId ) const;
 
 public:


More information about the Libreoffice-commits mailing list