loplugin:finalclasses in svtools

Change-Id: I596342a3d32e116ac5994b60a5bd8717d4f6a5dd
Reviewed-on: https://gerrit.libreoffice.org/43733
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2017-10-24 08:06:22 +02:00
parent 89b08e2318
commit f49b6d89fd
14 changed files with 118 additions and 160 deletions

View File

@@ -59,15 +59,13 @@ typedef ::cppu::WeakAggComponentImplHelper5<
css::lang::XServiceInfo >
SvtRulerAccessible_Base;
class SvtRulerAccessible : public ::cppu::BaseMutex, public SvtRulerAccessible_Base
class SvtRulerAccessible final : public ::cppu::BaseMutex, public SvtRulerAccessible_Base
{
public:
//===== internal ========================================================
SvtRulerAccessible(
const css::uno::Reference< css::accessibility::XAccessible>& rxParent, Ruler& rRepresentation, const ::rtl::OUString& rName );
protected:
virtual ~SvtRulerAccessible() override;
public:
/// @throws css::uno::RuntimeException
bool SAL_CALL
isVisible();
@@ -160,7 +158,17 @@ public:
virtual css::uno::Sequence<sal_Int8> SAL_CALL
getImplementationId() override;
protected:
private:
virtual ~SvtRulerAccessible() override;
virtual void SAL_CALL disposing() override;
/// @returns true if it's disposed or in disposing
inline bool IsAlive() const;
/// @throws DisposedException if it's not alive
void ThrowExceptionIfNotAlive();
/// @Return the object's current bounding box relative to the desktop.
///
@@ -172,18 +180,7 @@ protected:
/// @throws css::uno::RuntimeException
tools::Rectangle GetBoundingBox();
virtual void SAL_CALL disposing() override;
/// @returns true if it's disposed or in disposing
inline bool IsAlive() const;
/// @throws DisposedException if it's not alive
void ThrowExceptionIfNotAlive();
private:
/** Name of this object.
*/
/// Name of this object.
::rtl::OUString msName;
/// Reference to the parent object.
@@ -193,10 +190,8 @@ private:
/// pointer to internal representation
VclPtr<Ruler> mpRepr;
/// client id in the AccessibleEventNotifier queue
/// client id in the AccessibleEventNotifier queue
sal_uInt32 mnClientId;
};
inline bool SvtRulerAccessible::IsAlive() const

View File

@@ -46,29 +46,8 @@ namespace svt
// = AddressBookSourceDialog
struct AddressBookSourceDialogData;
class SVT_DLLPUBLIC AddressBookSourceDialog : public ModalDialog
class SVT_DLLPUBLIC AddressBookSourceDialog final : public ModalDialog
{
private:
// Controls
VclPtr<ComboBox> m_pDatasource;
VclPtr<PushButton> m_pAdministrateDatasources;
VclPtr<ComboBox> m_pTable;
VclPtr<ScrollBar> m_pFieldScroller;
// string to display for "no selection"
const OUString m_sNoFieldSelection;
/// the DatabaseContext for selecting data sources
css::uno::Reference< css::sdb::XDatabaseContext >
m_xDatabaseContext;
// the ORB for creating objects
css::uno::Reference< css::uno::XComponentContext >
m_xORB;
css::uno::Reference< css::container::XNameAccess >
m_xCurrentDatasourceTables;
std::unique_ptr<AddressBookSourceDialogData> m_pImpl;
public:
AddressBookSourceDialog( vcl::Window* _pParent,
const css::uno::Reference< css::uno::XComponentContext >& _rxORB );
@@ -107,7 +86,7 @@ namespace svt
void getFieldMapping(
css::uno::Sequence< css::util::AliasProgrammaticPair >& _rMapping) const;
protected:
private:
void implConstruct();
// Window overridables
@@ -134,6 +113,26 @@ namespace svt
DECL_LINK(OnComboSelect, ComboBox&, void);
DECL_LINK(OnOkClicked, Button*, void);
DECL_LINK(OnDelayedInitialize, void*, void);
// Controls
VclPtr<ComboBox> m_pDatasource;
VclPtr<PushButton> m_pAdministrateDatasources;
VclPtr<ComboBox> m_pTable;
VclPtr<ScrollBar> m_pFieldScroller;
// string to display for "no selection"
const OUString m_sNoFieldSelection;
/// the DatabaseContext for selecting data sources
css::uno::Reference< css::sdb::XDatabaseContext >
m_xDatabaseContext;
// the ORB for creating objects
css::uno::Reference< css::uno::XComponentContext >
m_xORB;
css::uno::Reference< css::container::XNameAccess >
m_xCurrentDatasourceTables;
std::unique_ptr<AddressBookSourceDialogData> m_pImpl;
};

View File

@@ -122,9 +122,8 @@ calls or by ending a selection.
typedef std::set<sal_Int32> IntDateSet;
class SVT_DLLPUBLIC Calendar : public Control
class SVT_DLLPUBLIC Calendar final : public Control
{
private:
IntDateSet* mpSelectTable;
IntDateSet* mpOldSelectTable;
OUString maDayTexts[31];
@@ -205,8 +204,6 @@ private:
SVT_DLLPRIVATE void ImplEndTracking( bool bCancel );
SVT_DLLPRIVATE DayOfWeek ImplGetWeekStart() const;
protected:
DECL_LINK( ScrollHdl, Timer *, void );
public:

View File

@@ -192,29 +192,8 @@ inline Color sameDistColor( Color /*rMain*/, Color rDefault )
return rDefault;
}
class SVT_DLLPUBLIC LineListBox : public ListBox
class SVT_DLLPUBLIC LineListBox final : public ListBox
{
ImpLineList* pLineList;
long m_nWidth;
OUString m_sNone;
ScopedVclPtr<VirtualDevice> aVirDev;
Size aTxtSize;
Color aColor;
Color maPaintCol;
FieldUnit eSourceUnit;
SVT_DLLPRIVATE void ImpGetLine( long nLine1, long nLine2, long nDistance,
Color nColor1, Color nColor2, Color nColorDist,
SvxBorderLineStyle nStyle, Bitmap& rBmp );
using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit();
void UpdatePaintLineColor(); // returns sal_True if maPaintCol has changed
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
void UpdateEntries( long nOldWidth );
sal_Int32 GetStylePos( sal_Int32 nListPos, long nWidth );
public:
typedef Color (*ColorFunc)(Color);
typedef Color (*ColorDistFunc)(Color, Color);
@@ -248,16 +227,35 @@ public:
void SetColor( const Color& rColor );
const Color& GetColor() const { return aColor; }
protected:
private:
SVT_DLLPRIVATE void ImpGetLine( long nLine1, long nLine2, long nDistance,
Color nColor1, Color nColor2, Color nColorDist,
SvxBorderLineStyle nStyle, Bitmap& rBmp );
using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit();
void UpdatePaintLineColor(); // returns sal_True if maPaintCol has changed
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
void UpdateEntries( long nOldWidth );
sal_Int32 GetStylePos( sal_Int32 nListPos, long nWidth );
inline const Color& GetPaintColor() const;
Color GetColorLine1( sal_Int32 nPos );
Color GetColorLine2( sal_Int32 nPos );
Color GetColorDist( sal_Int32 nPos );
private:
LineListBox( const LineListBox& ) = delete;
LineListBox& operator =( const LineListBox& ) = delete;
ImpLineList* pLineList;
long m_nWidth;
OUString m_sNone;
ScopedVclPtr<VirtualDevice> aVirDev;
Size aTxtSize;
Color aColor;
Color maPaintCol;
FieldUnit eSourceUnit;
};
inline void LineListBox::SetColor( const Color& rColor )

View File

@@ -38,17 +38,13 @@ namespace o3tl
}
class SVT_DLLPUBLIC FileControl : public vcl::Window
class SVT_DLLPUBLIC FileControl final : public vcl::Window
{
private:
VclPtr<Edit> maEdit;
VclPtr<PushButton> maButton;
OUString maButtonText;
OUString maButtonText;
FileControlMode_Internal mnInternalFlags;
protected:
SVT_DLLPRIVATE void Resize() override;
SVT_DLLPRIVATE void GetFocus() override;
SVT_DLLPRIVATE void StateChanged( StateChangedType nType ) override;

View File

@@ -252,11 +252,8 @@ protected:
};
class SVT_DLLPUBLIC DoubleNumericField : public FormattedField
class SVT_DLLPUBLIC DoubleNumericField final : public FormattedField
{
protected:
validation::NumberValidator* m_pNumberValidator;
public:
DoubleNumericField(vcl::Window* pParent, WinBits nStyle)
:FormattedField(pParent, nStyle)
@@ -268,20 +265,18 @@ public:
virtual ~DoubleNumericField() override;
virtual void dispose() override;
protected:
private:
virtual bool CheckText(const OUString& sText) const override;
virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat) override;
void ResetConformanceTester();
validation::NumberValidator* m_pNumberValidator;
};
class DoubleCurrencyField : public FormattedField
class DoubleCurrencyField final : public FormattedField
{
OUString m_sCurrencySymbol;
bool m_bPrependCurrSym;
bool m_bChangingFormat;
public:
DoubleCurrencyField(vcl::Window* pParent, WinBits nStyle);
@@ -291,10 +286,14 @@ public:
bool getPrependCurrSym() const { return m_bPrependCurrSym; }
void setPrependCurrSym(bool _bPrepend);
protected:
private:
virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat) override;
void UpdateCurrencyFormat();
OUString m_sCurrencySymbol;
bool m_bPrependCurrSym;
bool m_bChangingFormat;
};
#endif // INCLUDED_SVTOOLS_FMTFIELD_HXX

View File

@@ -32,9 +32,8 @@ namespace svt
{
class HyperLabelImpl;
class HyperLabel : public FixedText
class HyperLabel final : public FixedText
{
protected:
std::unique_ptr<HyperLabelImpl> m_pImpl;
Link<HyperLabel*,void> maClickHdl;
@@ -46,9 +45,10 @@ namespace svt
void DeactivateHyperMode(vcl::Font aFont, const Color aColor);
void ActivateHyperMode(vcl::Font aFont, const Color aColor);
protected:
void implInit();
using FixedText::CalcMinimumSize;
public:
HyperLabel( vcl::Window* _pParent, WinBits _nWinStyle );
virtual ~HyperLabel( ) override;
@@ -70,9 +70,6 @@ namespace svt
void SetClickHdl( const Link<HyperLabel*,void>& rLink ) { maClickHdl = rLink; }
Size CalcMinimumSize( long nMaxWidth ) const;
private:
using FixedText::CalcMinimumSize;
};
}

View File

@@ -30,18 +30,17 @@ namespace svt
//= OStringTransferable
class SVT_DLLPUBLIC OStringTransferable : public TransferableHelper
class SVT_DLLPUBLIC OStringTransferable final : public TransferableHelper
{
protected:
OUString m_sContent;
public:
OStringTransferable(const OUString& _rContent);
protected:
private:
// TransferableHelper overridables
virtual void AddSupportedFormats() override;
virtual bool GetData( const css::datatransfer::DataFlavor& _rFlavor, const OUString& rDestDoc ) override;
OUString m_sContent;
};

View File

@@ -261,19 +261,16 @@ public:
struct TransferableDataHelper_Impl;
class SVT_DLLPUBLIC TransferableDataHelper
class SVT_DLLPUBLIC TransferableDataHelper final
{
friend class DropTargetHelper;
private:
css::uno::Reference< css::datatransfer::XTransferable > mxTransfer;
css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard;
DataFlavorExVector maFormats;
std::unique_ptr<TransferableObjectDescriptor> mxObjDesc;
std::unique_ptr<TransferableDataHelper_Impl> mxImpl;
protected:
void InitFormats();
public:
@@ -308,8 +305,6 @@ public:
void Rebind( const css::uno::Reference< css::datatransfer::XTransferable >& _rxNewData );
public:
css::uno::Any GetAny( SotClipboardFormatId nFormat, const OUString& rDestDoc ) const;
css::uno::Any GetAny( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) const;
@@ -357,8 +352,6 @@ public:
css::uno::Reference<css::io::XInputStream> GetInputStream( SotClipboardFormatId nFormat, const OUString& rDestDoc );
css::uno::Reference<css::io::XInputStream> GetInputStream( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
public:
static TransferableDataHelper CreateFromSystemClipboard( vcl::Window * pWindow );
static TransferableDataHelper CreateFromSelection( vcl::Window * pWindow );
static bool IsEqual( const css::datatransfer::DataFlavor& rInternalFlavor,

View File

@@ -41,14 +41,8 @@ public:
class RoadmapImpl;
class RoadmapItem;
class SVT_DLLPUBLIC ORoadmap : public Control, public RoadmapTypes
class SVT_DLLPUBLIC ORoadmap final : public Control, public RoadmapTypes
{
protected:
std::unique_ptr<RoadmapImpl> m_pImpl;
// Window overridables
void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& _rRect) override;
void implInit(vcl::RenderContext& rRenderContext);
public:
ORoadmap( vcl::Window* _pParent, WinBits _nWinStyle );
virtual ~ORoadmap( ) override;
@@ -83,14 +77,12 @@ public:
virtual void GetFocus() override;
virtual void ApplySettings( vcl::RenderContext& rRenderContext ) override;
protected:
private:
bool PreNotify( NotifyEvent& rNEvt ) override;
protected:
/// called when an item has been selected by any means
void Select();
void Select();
private:
DECL_LINK(ImplClickHdl, HyperLabel*, void);
RoadmapItem* GetByIndex( ItemIndex _nItemIndex );
@@ -107,6 +99,12 @@ private:
RoadmapItem* GetByPointer(vcl::Window const * pWindow);
RoadmapItem* InsertHyperLabel( ItemIndex Index, const OUString& _aStr, ItemId RMID, bool _bEnabled, bool _bIncomplete );
void UpdatefollowingHyperLabels( ItemIndex Index );
// Window overridables
void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& _rRect) override;
void implInit(vcl::RenderContext& rRenderContext);
std::unique_ptr<RoadmapImpl> m_pImpl;
};
} // namespace svt

View File

@@ -47,15 +47,13 @@ typedef ::cppu::ImplHelper2<
css::accessibility::XAccessible,
css::lang::XServiceInfo > VCLXAccessibleHeaderBarItem_BASE;
class VCLXAccessibleHeaderBarItem : public comphelper::OAccessibleExtendedComponentHelper,
class VCLXAccessibleHeaderBarItem final : public comphelper::OAccessibleExtendedComponentHelper,
public VCLXAccessibleHeaderBarItem_BASE
{
private:
VclPtr<HeaderBar> m_pHeadBar;
sal_Int32 m_nIndexInParent;
protected:
void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
// OCommonAccessibleComponent

View File

@@ -112,9 +112,8 @@ public:
// class VCLXFileControl
class VCLXFileControl : public css::awt::XTextComponent, public css::awt::XTextLayoutConstrains, public VCLXWindow
class VCLXFileControl final : public css::awt::XTextComponent, public css::awt::XTextLayoutConstrains, public VCLXWindow
{
protected:
DECL_LINK(ModifyHdl, Edit&, void);
void ModifyHdl();
TextListenerMultiplexer maTextListeners;
@@ -233,20 +232,8 @@ typedef ::cppu::ImplInheritanceHelper < VCLXGraphicControl
, css::beans::XPropertyChangeListener
, css::awt::XItemEventBroadcaster
> SVTXRoadmap_Base;
class SVTXRoadmap : public SVTXRoadmap_Base
class SVTXRoadmap final : public SVTXRoadmap_Base
{
private:
ItemListenerMultiplexer maItemListeners;
static RMItemData GetRMItemData( const css::container::ContainerEvent& _rEvent );
protected:
virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
virtual ~SVTXRoadmap() override;
public:
SVTXRoadmap();
@@ -269,13 +256,21 @@ public:
// XPropertyChangeListener
virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
protected:
private:
// VCLXGraphicControl overridables
virtual void ImplSetNewImage() override;
static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
static RMItemData GetRMItemData( const css::container::ContainerEvent& _rEvent );
virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
virtual ~SVTXRoadmap() override;
ItemListenerMultiplexer maItemListeners;
};
@@ -364,7 +359,7 @@ public:
// class VCLXProgressBar
class VCLXProgressBar : public css::awt::XProgressBar,
class VCLXProgressBar final : public css::awt::XProgressBar,
public VCLXWindow
{
private:
@@ -372,7 +367,6 @@ private:
sal_Int32 m_nValueMin;
sal_Int32 m_nValueMax;
protected:
void ImplUpdateValue();
public:

View File

@@ -64,12 +64,8 @@ namespace svt { namespace table
//= TableRowGeometry
class TableRowGeometry : public TableGeometry
class TableRowGeometry final : public TableGeometry
{
protected:
RowPos m_nRowPos;
bool m_bAllowVirtualRows;
public:
TableRowGeometry(
TableControl_Impl const & _rControl,
@@ -87,16 +83,16 @@ namespace svt { namespace table
private:
void impl_initRect();
bool impl_isValidRow( RowPos const i_row ) const;
RowPos m_nRowPos;
bool m_bAllowVirtualRows;
};
//= TableColumnGeometry
class TableColumnGeometry : public TableGeometry
class TableColumnGeometry final : public TableGeometry
{
protected:
ColPos m_nColPos;
public:
TableColumnGeometry(
TableControl_Impl const & _rControl,
@@ -112,6 +108,8 @@ namespace svt { namespace table
private:
void impl_initRect();
bool impl_isValidColumn( ColPos const i_column ) const;
ColPos m_nColPos;
};

View File

@@ -48,17 +48,8 @@ typedef ::cppu::ImplInheritanceHelper < VCLXWindow
, css::awt::grid::XGridDataListener
, css::container::XContainerListener
> SVTXGridControl_Base;
class SVTXGridControl : public SVTXGridControl_Base
class SVTXGridControl final : public SVTXGridControl_Base
{
private:
std::shared_ptr< ::svt::table::UnoControlTableModel > m_xTableModel;
bool m_bTableModelInitCompleted;
SelectionListenerMultiplexer m_aSelectionListeners;
protected:
virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
void ImplCallItemListeners();
public:
SVTXGridControl();
virtual ~SVTXGridControl() override;
@@ -104,16 +95,22 @@ public:
// XWindow
void SAL_CALL setEnable( sal_Bool bEnable ) override;
protected:
private:
// VCLXWindow
virtual void SetWindow( const VclPtr< vcl::Window > &pWindow ) override;
private:
void impl_updateColumnsFromModel_nothrow();
void impl_checkTableModelInit();
void impl_checkColumnIndex_throw( ::svt::table::TableControl const & i_table, sal_Int32 const i_columnIndex ) const;
void impl_checkRowIndex_throw( ::svt::table::TableControl const & i_table, sal_Int32 const i_rowIndex ) const;
virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
void ImplCallItemListeners();
std::shared_ptr< ::svt::table::UnoControlTableModel > m_xTableModel;
bool m_bTableModelInitCompleted;
SelectionListenerMultiplexer m_aSelectionListeners;
};
#endif // INCLUDED_SVTOOLS_SOURCE_UNO_SVTXGRIDCONTROL_HXX