Kaydet (Commit) 22fa30c2 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:finalclasses in toolkit,tools

Change-Id: I365d9a5057b35bf0441ac8fbfef4447a25652760
Reviewed-on: https://gerrit.libreoffice.org/43601Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 0dacfe29
...@@ -32,17 +32,15 @@ ...@@ -32,17 +32,15 @@
// class VCLXBitmap // class VCLXBitmap
class VCLXBitmap : public css::awt::XBitmap, class VCLXBitmap final : public css::awt::XBitmap,
public css::awt::XDisplayBitmap, public css::awt::XDisplayBitmap,
public css::lang::XTypeProvider, public css::lang::XTypeProvider,
public css::lang::XUnoTunnel, public css::lang::XUnoTunnel,
public ::cppu::OWeakObject public ::cppu::OWeakObject
{ {
private:
::osl::Mutex maMutex; ::osl::Mutex maMutex;
BitmapEx maBitmap; BitmapEx maBitmap;
protected:
::osl::Mutex& GetMutex() { return maMutex; } ::osl::Mutex& GetMutex() { return maMutex; }
......
...@@ -34,19 +34,17 @@ ...@@ -34,19 +34,17 @@
// class VCLXFont // 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::XTypeProvider,
public css::lang::XUnoTunnel, public css::lang::XUnoTunnel,
public ::cppu::OWeakObject public ::cppu::OWeakObject
{ {
private:
::osl::Mutex maMutex; ::osl::Mutex maMutex;
css::uno::Reference< css::awt::XDevice> mxDevice; css::uno::Reference< css::awt::XDevice> mxDevice;
vcl::Font maFont; vcl::Font maFont;
std::unique_ptr<FontMetric> std::unique_ptr<FontMetric>
mpFontMetric; mpFontMetric;
protected:
bool ImplAssertValidFontMetric(); bool ImplAssertValidFontMetric();
::osl::Mutex& GetMutex() { return maMutex; } ::osl::Mutex& GetMutex() { return maMutex; }
......
...@@ -33,14 +33,12 @@ ...@@ -33,14 +33,12 @@
// class VCLXPointer // class VCLXPointer
class VCLXPointer: public cppu::WeakImplHelper< class VCLXPointer final : public cppu::WeakImplHelper<
css::awt::XPointer, css::lang::XUnoTunnel, css::lang::XServiceInfo> css::awt::XPointer, css::lang::XUnoTunnel, css::lang::XServiceInfo>
{ {
private:
::osl::Mutex maMutex; ::osl::Mutex maMutex;
Pointer maPointer; Pointer maPointer;
protected:
::osl::Mutex& GetMutex() { return maMutex; } ::osl::Mutex& GetMutex() { return maMutex; }
public: public:
......
...@@ -33,16 +33,14 @@ ...@@ -33,16 +33,14 @@
// class VCLXRegion // class VCLXRegion
class VCLXRegion : public css::awt::XRegion, class VCLXRegion final : public css::awt::XRegion,
public css::lang::XTypeProvider, public css::lang::XTypeProvider,
public css::lang::XUnoTunnel, public css::lang::XUnoTunnel,
public ::cppu::OWeakObject public ::cppu::OWeakObject
{ {
private:
::osl::Mutex maMutex; ::osl::Mutex maMutex;
vcl::Region maRegion; vcl::Region maRegion;
protected:
::osl::Mutex& GetMutex() { return maMutex; } ::osl::Mutex& GetMutex() { return maMutex; }
public: public:
......
...@@ -47,31 +47,11 @@ namespace toolkit ...@@ -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 control model, and a weak reference to the control. The reference to the model is freed when the model
is being disposed.</p> is being disposed.</p>
*/ */
class OAccessibleControlContext class OAccessibleControlContext final
:public ::comphelper::OAccessibleImplementationAccess :public ::comphelper::OAccessibleImplementationAccess
,public OAccessibleControlContext_Base ,public OAccessibleControlContext_Base
,public OAccessibleControlContext_IBase ,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: public:
/** creates an accessible context for an uno control /** creates an accessible context for an uno control
@param _rxCreator @param _rxCreator
...@@ -82,7 +62,7 @@ namespace toolkit ...@@ -82,7 +62,7 @@ namespace toolkit
const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator
); );
protected: private:
// XInterface // XInterface
DECLARE_XINTERFACE( ) DECLARE_XINTERFACE( )
DECLARE_XTYPEPROVIDER( ) DECLARE_XTYPEPROVIDER( )
...@@ -107,7 +87,6 @@ namespace toolkit ...@@ -107,7 +87,6 @@ namespace toolkit
using comphelper::OAccessibleContextHelper::disposing; using comphelper::OAccessibleContextHelper::disposing;
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; 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 // retrieves the value of a string property from the model, if the property is present
OUString getModelStringProperty( const sal_Char* _pPropertyName ); OUString getModelStringProperty( const sal_Char* _pPropertyName );
...@@ -117,6 +96,24 @@ namespace toolkit ...@@ -117,6 +96,24 @@ namespace toolkit
void stopModelListening( ); void stopModelListening( );
VclPtr< vcl::Window > implGetWindow( css::uno::Reference< css::awt::XWindow >* _pxUNOWindow = nullptr ) const; 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
}; };
......
...@@ -33,30 +33,8 @@ namespace toolkit ...@@ -33,30 +33,8 @@ namespace toolkit
// = UnoControlFormattedFieldModel // = 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: public:
UnoControlFormattedFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); UnoControlFormattedFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel ) UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel )
...@@ -80,11 +58,11 @@ namespace toolkit ...@@ -80,11 +58,11 @@ namespace toolkit
css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
protected: private:
virtual ~UnoControlFormattedFieldModel() override; virtual ~UnoControlFormattedFieldModel() override;
// XComponent // XComponent
void SAL_CALL dispose( ) override; void SAL_CALL dispose() override;
// XPropertySet // XPropertySet
void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& PropertyNames, const css::uno::Sequence< css::uno::Any >& Values ) override; 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 ...@@ -96,10 +74,29 @@ namespace toolkit
css::uno::Any* _pValues, /// the values of the properties to set css::uno::Any* _pValues, /// the values of the properties to set
sal_Int32* _pValidHandles /// pointer to the valid handles, allowed to be adjusted sal_Int32* _pValidHandles /// pointer to the valid handles, allowed to be adjusted
) const override; ) const override;
private:
void impl_updateTextFromValue_nothrow(); void impl_updateTextFromValue_nothrow();
void impl_updateCachedFormatter_nothrow(); void impl_updateCachedFormatter_nothrow();
void impl_updateCachedFormatKey_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;
}; };
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
typedef cppu::WeakImplHelper< css::lang::XServiceInfo > ORoadmapEntry_Base; typedef cppu::WeakImplHelper< css::lang::XServiceInfo > ORoadmapEntry_Base;
class ORoadmapEntry :public ORoadmapEntry_Base class ORoadmapEntry final : public ORoadmapEntry_Base
,public ::comphelper::OMutexAndBroadcastHelper ,public ::comphelper::OMutexAndBroadcastHelper
,public ::comphelper::OPropertyContainer ,public ::comphelper::OPropertyContainer
,public ::comphelper::OPropertyArrayUsageHelper< ORoadmapEntry > ,public ::comphelper::OPropertyArrayUsageHelper< ORoadmapEntry >
...@@ -43,7 +43,7 @@ class ORoadmapEntry :public ORoadmapEntry_Base ...@@ -43,7 +43,7 @@ class ORoadmapEntry :public ORoadmapEntry_Base
public: public:
ORoadmapEntry(); ORoadmapEntry();
protected: private:
DECLARE_XINTERFACE() // merge XInterface implementations DECLARE_XINTERFACE() // merge XInterface implementations
DECLARE_XTYPEPROVIDER() // merge XTypeProvider implementations DECLARE_XTYPEPROVIDER() // merge XTypeProvider implementations
...@@ -61,19 +61,10 @@ protected: ...@@ -61,19 +61,10 @@ protected:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
OUString m_sLabel;
// other stuff sal_Int32 m_nID;
// (e.g. DECLARE_SERVICE_INFO();)
protected:
// <properties>
OUString m_sLabel;
sal_Int32 m_nID;
bool m_bEnabled; bool m_bEnabled;
bool m_bInteractive; bool m_bInteractive;
// </properties>
}; };
#endif #endif
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <toolkit/helper/servicenames.hxx> #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::XServiceInfo,
public css::lang::XTypeProvider, public css::lang::XTypeProvider,
public ::cppu::OWeakAggObject public ::cppu::OWeakAggObject
...@@ -42,7 +42,6 @@ private: ...@@ -42,7 +42,6 @@ private:
css::uno::Reference< css::awt::XTabControllerModel > mxModel; css::uno::Reference< css::awt::XTabControllerModel > mxModel;
css::uno::Reference< css::awt::XControlContainer > mxControlContainer; css::uno::Reference< css::awt::XControlContainer > mxControlContainer;
protected:
::osl::Mutex& GetMutex() { return maMutex; } ::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 ); 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 // if sequence length of rModels is less than rControls, return only the matching elements in rModels sequence and remove corresponding elements from rControls
......
...@@ -79,18 +79,16 @@ typedef ::std::vector< ComponentEntry* > ComponentEntryList; ...@@ -79,18 +79,16 @@ typedef ::std::vector< ComponentEntry* > ComponentEntryList;
#define CONTROLPOS_NOTFOUND 0xFFFFFFFF #define CONTROLPOS_NOTFOUND 0xFFFFFFFF
class StdTabControllerModel : public css::awt::XTabControllerModel, class StdTabControllerModel final : public css::awt::XTabControllerModel,
public css::lang::XServiceInfo, public css::lang::XServiceInfo,
public css::io::XPersistObject, public css::io::XPersistObject,
public css::lang::XTypeProvider, public css::lang::XTypeProvider,
public ::cppu::OWeakAggObject public ::cppu::OWeakAggObject
{ {
private:
::osl::Mutex maMutex; ::osl::Mutex maMutex;
UnoControlModelEntryList maControls; UnoControlModelEntryList maControls;
bool mbGroupControl; bool mbGroupControl;
protected:
::osl::Mutex& GetMutex() { return maMutex; } ::osl::Mutex& GetMutex() { return maMutex; }
sal_uInt32 ImplGetControlCount( const UnoControlModelEntryList& rList ) const; sal_uInt32 ImplGetControlCount( const UnoControlModelEntryList& rList ) const;
void ImplGetControlModels( css::uno::Reference< css::awt::XControlModel > ** pRefs, const UnoControlModelEntryList& rList ) const; void ImplGetControlModels( css::uno::Reference< css::awt::XControlModel > ** pRefs, const UnoControlModelEntryList& rList ) const;
......
...@@ -859,7 +859,7 @@ typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase ...@@ -859,7 +859,7 @@ typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase
, css::awt::XTextLayoutConstrains , css::awt::XTextLayoutConstrains
, css::awt::XItemListListener , css::awt::XItemListListener
> UnoListBoxControl_Base; > UnoListBoxControl_Base;
class TOOLKIT_DLLPUBLIC UnoListBoxControl : public UnoListBoxControl_Base class TOOLKIT_DLLPUBLIC UnoListBoxControl final : public UnoListBoxControl_Base
{ {
public: public:
UnoListBoxControl(); UnoListBoxControl();
...@@ -919,12 +919,11 @@ public: ...@@ -919,12 +919,11 @@ public:
OUString SAL_CALL getImplementationName( ) override; OUString SAL_CALL getImplementationName( ) override;
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
protected: private:
void ImplUpdateSelectedItemsProperty(); void ImplUpdateSelectedItemsProperty();
virtual void ImplSetPeerProperty( const OUString& rPropName, const css::uno::Any& rVal ) override; virtual void ImplSetPeerProperty( const OUString& rPropName, const css::uno::Any& rVal ) override;
virtual void updateFromModel() override; virtual void updateFromModel() override;
private:
ActionListenerMultiplexer maActionListeners; ActionListenerMultiplexer maActionListeners;
ItemListenerMultiplexer maItemListeners; ItemListenerMultiplexer maItemListeners;
}; };
......
...@@ -174,15 +174,8 @@ protected: ...@@ -174,15 +174,8 @@ protected:
// B3D camera // 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: public:
B3dCamera( B3dCamera(
const basegfx::B3DPoint& rPos = basegfx::B3DPoint(0.0, 0.0, 1.0), const basegfx::B3DPoint& rPos = basegfx::B3DPoint(0.0, 0.0, 1.0),
...@@ -190,11 +183,18 @@ public: ...@@ -190,11 +183,18 @@ public:
double fFocLen = 35.0, double fBnkAng = 0.0); double fFocLen = 35.0, double fBnkAng = 0.0);
virtual ~B3dCamera() override; virtual ~B3dCamera() override;
protected: private:
void CalcNewViewportValues(); void CalcNewViewportValues();
bool CalcFocalLength(); bool CalcFocalLength();
virtual void DeviceRectangleChange() override; virtual void DeviceRectangleChange() override;
basegfx::B3DPoint aPosition;
basegfx::B3DPoint aCorrectedPosition;
basegfx::B3DVector aLookAt;
double fFocalLength;
double fBankAngle;
}; };
#endif #endif
......
...@@ -28,9 +28,8 @@ class SvStream; ...@@ -28,9 +28,8 @@ class SvStream;
// Color // Color
class SAL_WARN_UNUSED TOOLS_DLLPUBLIC Color class SAL_WARN_UNUSED TOOLS_DLLPUBLIC Color final
{ {
protected:
ColorData mnColor; ColorData mnColor;
public: public:
......
...@@ -29,12 +29,10 @@ ...@@ -29,12 +29,10 @@
// class UnoPropertyArrayHelper // class UnoPropertyArrayHelper
class TOOLKIT_DLLPUBLIC UnoPropertyArrayHelper : public ::cppu::IPropertyArrayHelper class TOOLKIT_DLLPUBLIC UnoPropertyArrayHelper final : public ::cppu::IPropertyArrayHelper
{ {
private:
std::set<sal_Int32> maIDs; std::set<sal_Int32> maIDs;
protected:
bool ImplHasProperty( sal_uInt16 nPropId ) const; bool ImplHasProperty( sal_uInt16 nPropId ) const;
public: public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment