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 @@
// 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; }
......
......@@ -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; }
......
......@@ -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:
......
......@@ -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:
......
......@@ -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
};
......
......@@ -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;
};
......
......@@ -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
......
......@@ -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
......
......@@ -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;
......
......@@ -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;
};
......
......@@ -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
......
......@@ -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:
......
......@@ -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:
......
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