summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-01-12 11:38:12 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-04-09 20:17:25 +0100
commit1f59e2cec3f4a22d612ca6cff06930c3d4bb77ca (patch)
tree22fb02505caea2c016d74b1a303cbcad1cb7614a
parent9a6bf4be437102004a01ee5818e943f0e095eefe (diff)
vcl: window destructors calling dispose
Extend plugin to warn on any vcl::Window subclass that has a destructor and does not implement dispose. Apply this provision to the necessary classes in vcl/ Change-Id: I05189f8df02568131d59fc44fea904c87733c8c7
-rw-r--r--compilerplugins/clang/vclwidgets.cxx13
-rw-r--r--include/vcl/ctrl.hxx1
-rw-r--r--include/vcl/dockingarea.hxx1
-rw-r--r--include/vcl/dockwin.hxx1
-rw-r--r--include/vcl/field.hxx10
-rw-r--r--include/vcl/fixed.hxx2
-rw-r--r--include/vcl/fixedhyper.hxx5
-rw-r--r--include/vcl/longcurr.hxx2
-rw-r--r--include/vcl/lstbox.hxx1
-rw-r--r--include/vcl/menubtn.hxx1
-rw-r--r--include/vcl/morebtn.hxx3
-rw-r--r--include/vcl/popupmenuwindow.hxx1
-rw-r--r--include/vcl/prgsbar.hxx5
-rw-r--r--include/vcl/scrbar.hxx1
-rw-r--r--include/vcl/spin.hxx1
-rw-r--r--include/vcl/split.hxx3
-rw-r--r--include/vcl/splitwin.hxx3
-rw-r--r--include/vcl/status.hxx9
-rw-r--r--include/vcl/tabctrl.hxx7
-rw-r--r--include/vcl/tabdlg.hxx3
-rw-r--r--include/vcl/throbber.hxx1
-rw-r--r--include/vcl/toolbox.hxx3
-rw-r--r--vcl/generic/print/prtsetup.cxx14
-rw-r--r--vcl/generic/print/prtsetup.hxx3
-rw-r--r--vcl/inc/helpwin.hxx7
-rw-r--r--vcl/inc/ilstbox.hxx5
-rw-r--r--vcl/inc/printdlg.hxx3
-rw-r--r--vcl/source/app/help.cxx6
-rw-r--r--vcl/source/control/ctrl.cxx6
-rw-r--r--vcl/source/control/field.cxx24
-rw-r--r--vcl/source/control/field2.cxx24
-rw-r--r--vcl/source/control/fixed.cxx8
-rw-r--r--vcl/source/control/fixedhyper.cxx4
-rw-r--r--vcl/source/control/ilstbox.cxx6
-rw-r--r--vcl/source/control/longcurr.cxx8
-rw-r--r--vcl/source/control/lstbox.cxx6
-rw-r--r--vcl/source/control/menubtn.cxx6
-rw-r--r--vcl/source/control/morebtn.cxx6
-rw-r--r--vcl/source/control/prgsbar.cxx4
-rw-r--r--vcl/source/control/scrbar.cxx6
-rw-r--r--vcl/source/control/spinbtn.cxx4
-rw-r--r--vcl/source/control/tabctrl.cxx6
-rw-r--r--vcl/source/control/throbber.cxx6
-rw-r--r--vcl/source/edit/vclmedit.cxx9
-rw-r--r--vcl/source/window/dockingarea.cxx6
-rw-r--r--vcl/source/window/dockmgr.cxx14
-rw-r--r--vcl/source/window/dockwin.cxx13
-rw-r--r--vcl/source/window/popupmenuwindow.cxx6
-rw-r--r--vcl/source/window/printdlg.cxx13
-rw-r--r--vcl/source/window/split.cxx6
-rw-r--r--vcl/source/window/splitwin.cxx6
-rw-r--r--vcl/source/window/status.cxx6
-rw-r--r--vcl/source/window/tabdlg.cxx6
-rw-r--r--vcl/source/window/toolbox.cxx6
-rw-r--r--vcl/unx/generic/app/i18n_status.cxx3
-rw-r--r--vcl/workben/outdevgrind.cxx1
-rw-r--r--vcl/workben/vcldemo.cxx13
57 files changed, 187 insertions, 160 deletions
diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx
index 1f8e05b9692f..040c5ba2407d 100644
--- a/compilerplugins/clang/vclwidgets.cxx
+++ b/compilerplugins/clang/vclwidgets.cxx
@@ -82,18 +82,11 @@ bool VCLWidgets::VisitCXXRecordDecl(const CXXRecordDecl * recordDecl) {
}
if (!recordDecl->isCompleteDefinition())
return true;
- // check if this field is derived from Window
+ // check if this class is derived from Window
if (!isDerivedFromWindow(recordDecl)) {
return true;
}
- bool foundVclPtr = false;
- for(auto fieldDecl : recordDecl->fields()) {
- if (fieldDecl->getType().getAsString().find("VclPtr") != std::string::npos) {
- foundVclPtr = true;
- break;
- }
- }
- if (!foundVclPtr) {
+ if (!recordDecl->hasUserDeclaredDestructor()) {
return true;
}
bool foundDispose = false;
@@ -106,7 +99,7 @@ bool VCLWidgets::VisitCXXRecordDecl(const CXXRecordDecl * recordDecl) {
if (!foundDispose) {
report(
DiagnosticsEngine::Warning,
- "vcl::Window subclass with VclPtr members should declare a dispose() method.",
+ "vcl::Window subclass with destructor should declare a dispose() method.",
recordDecl->getLocation())
<< recordDecl->getSourceRange();
}
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
index d85c85885b2c..4d1f9030a074 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -127,6 +127,7 @@ public:
explicit Control( vcl::Window* pParent, WinBits nWinStyle = 0 );
explicit Control( vcl::Window* pParent, const ResId& );
virtual ~Control();
+ virtual void dispose() SAL_OVERRIDE;
virtual void EnableRTL ( bool bEnable = true ) SAL_OVERRIDE;
diff --git a/include/vcl/dockingarea.hxx b/include/vcl/dockingarea.hxx
index 7fa2ad55fec0..4bc2deff6b02 100644
--- a/include/vcl/dockingarea.hxx
+++ b/include/vcl/dockingarea.hxx
@@ -37,6 +37,7 @@ private:
public:
explicit DockingAreaWindow( vcl::Window* pParent );
virtual ~DockingAreaWindow();
+ virtual void dispose() SAL_OVERRIDE;
void SetAlign( WindowAlign eNewAlign );
WindowAlign GetAlign() const;
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx
index dac66c731c06..685dcd4624e7 100644
--- a/include/vcl/dockwin.hxx
+++ b/include/vcl/dockwin.hxx
@@ -299,6 +299,7 @@ public:
DockingWindow(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>());
virtual ~DockingWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void StartDocking();
virtual bool Docking( const Point& rPos, Rectangle& rRect );
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
index 179c16a974a1..fc51b627978e 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -485,7 +485,6 @@ class VCL_DLLPUBLIC PatternField : public SpinField, public PatternFormatter
{
public:
explicit PatternField( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~PatternField();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -505,7 +504,6 @@ protected:
public:
explicit NumericField( vcl::Window* pParent, WinBits nWinStyle );
explicit NumericField( vcl::Window* pParent, const ResId& );
- virtual ~NumericField();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -535,7 +533,6 @@ protected:
public:
explicit MetricField( vcl::Window* pParent, WinBits nWinStyle );
explicit MetricField( vcl::Window* pParent, const ResId& );
- virtual ~MetricField();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -602,7 +599,6 @@ class VCL_DLLPUBLIC CurrencyField : public SpinField, public CurrencyFormatter
{
public:
CurrencyField( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~CurrencyField();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -696,7 +692,6 @@ class VCL_DLLPUBLIC PatternBox : public ComboBox, public PatternFormatter
{
public:
PatternBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~PatternBox();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -715,7 +710,6 @@ class VCL_DLLPUBLIC NumericBox : public ComboBox, public NumericFormatter
{
public:
explicit NumericBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~NumericBox();
virtual Size CalcMinimumSize() const SAL_OVERRIDE;
@@ -739,7 +733,6 @@ class VCL_DLLPUBLIC MetricBox : public ComboBox, public MetricFormatter
{
public:
explicit MetricBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~MetricBox();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -772,7 +765,6 @@ class VCL_DLLPUBLIC CurrencyBox : public ComboBox, public CurrencyFormatter
{
public:
explicit CurrencyBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~CurrencyBox();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -793,7 +785,6 @@ class VCL_DLLPUBLIC DateBox : public ComboBox, public DateFormatter
{
public:
explicit DateBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~DateBox();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -813,7 +804,6 @@ class VCL_DLLPUBLIC TimeBox : public ComboBox, public TimeFormatter
{
public:
explicit TimeBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~TimeBox();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx
index f11f0e03485f..19c070ea6c0e 100644
--- a/include/vcl/fixed.hxx
+++ b/include/vcl/fixed.hxx
@@ -141,7 +141,6 @@ private:
public:
explicit FixedBitmap( vcl::Window* pParent, WinBits nStyle = 0 );
- virtual ~FixedBitmap();
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) SAL_OVERRIDE;
@@ -179,7 +178,6 @@ protected:
public:
explicit FixedImage( vcl::Window* pParent, WinBits nStyle = 0 );
explicit FixedImage( vcl::Window* pParent, const ResId& );
- virtual ~FixedImage();
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) SAL_OVERRIDE;
diff --git a/include/vcl/fixedhyper.hxx b/include/vcl/fixedhyper.hxx
index c85bd1cb6ac0..2fc8e2f95469 100644
--- a/include/vcl/fixedhyper.hxx
+++ b/include/vcl/fixedhyper.hxx
@@ -66,11 +66,6 @@ class VCL_DLLPUBLIC FixedHyperlink : public FixedText
*/
FixedHyperlink( vcl::Window* pParent, WinBits nWinStyle = 0 );
- /** dtor
-
- */
- virtual ~FixedHyperlink();
-
/** overwrites Window::GetFocus().
Changes the color of the text and shows a focus rectangle.
diff --git a/include/vcl/longcurr.hxx b/include/vcl/longcurr.hxx
index 0c2d1a969de0..0dbe82ca401f 100644
--- a/include/vcl/longcurr.hxx
+++ b/include/vcl/longcurr.hxx
@@ -90,7 +90,6 @@ private:
public:
LongCurrencyField( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~LongCurrencyField();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -117,7 +116,6 @@ class VCL_DLLPUBLIC LongCurrencyBox : public ComboBox, public LongCurrencyFormat
{
public:
LongCurrencyBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~LongCurrencyBox();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx
index 29d219920844..fdbce0795ad9 100644
--- a/include/vcl/lstbox.hxx
+++ b/include/vcl/lstbox.hxx
@@ -83,6 +83,7 @@ public:
explicit ListBox( vcl::Window* pParent, WinBits nStyle = WB_BORDER );
explicit ListBox( vcl::Window* pParent, const ResId& );
virtual ~ListBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
diff --git a/include/vcl/menubtn.hxx b/include/vcl/menubtn.hxx
index 41e03c6462f9..eb2c446a4a53 100644
--- a/include/vcl/menubtn.hxx
+++ b/include/vcl/menubtn.hxx
@@ -57,6 +57,7 @@ protected:
public:
explicit MenuButton( vcl::Window* pParent, WinBits nStyle = 0 );
virtual ~MenuButton();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
diff --git a/include/vcl/morebtn.hxx b/include/vcl/morebtn.hxx
index 4dbd6da57736..936cbba77d9e 100644
--- a/include/vcl/morebtn.hxx
+++ b/include/vcl/morebtn.hxx
@@ -35,7 +35,7 @@ class VCL_DLLPUBLIC MoreButton : public PushButton
{
private:
ImplMoreButtonData* mpMBData;
- sal_uLong mnDelta;
+ sal_uLong mnDelta;
MapUnit meUnit;
bool mbState;
@@ -50,6 +50,7 @@ protected:
public:
explicit MoreButton( vcl::Window* pParent, WinBits nStyle = 0 );
virtual ~MoreButton();
+ virtual void dispose() SAL_OVERRIDE;
void Click() SAL_OVERRIDE;
diff --git a/include/vcl/popupmenuwindow.hxx b/include/vcl/popupmenuwindow.hxx
index 266738a170c3..13d699f69542 100644
--- a/include/vcl/popupmenuwindow.hxx
+++ b/include/vcl/popupmenuwindow.hxx
@@ -30,6 +30,7 @@ private:
public:
PopupMenuFloatingWindow( vcl::Window* pParent, WinBits nStyle = (WB_SYSTEMFLOATWIN|WB_SYSTEMWINDOW|WB_NOBORDER) );
virtual ~PopupMenuFloatingWindow();
+ virtual void dispose() SAL_OVERRIDE;
sal_uInt16 GetMenuStackLevel() const;
void SetMenuStackLevel( sal_uInt16 nLevel );
diff --git a/include/vcl/prgsbar.hxx b/include/vcl/prgsbar.hxx
index 782b2c549a9a..43d340689d18 100644
--- a/include/vcl/prgsbar.hxx
+++ b/include/vcl/prgsbar.hxx
@@ -61,8 +61,8 @@ private:
Point maPos;
long mnPrgsWidth;
long mnPrgsHeight;
- sal_uInt16 mnPercent;
- sal_uInt16 mnPercentCount;
+ sal_uInt16 mnPercent;
+ sal_uInt16 mnPercentCount;
bool mbCalcNew;
using Window::ImplInit;
@@ -72,7 +72,6 @@ private:
public:
ProgressBar( vcl::Window* pParent, WinBits nWinBits = WB_STDPROGRESSBAR );
- virtual ~ProgressBar();
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
diff --git a/include/vcl/scrbar.hxx b/include/vcl/scrbar.hxx
index f3bef63b723a..27871afc2cb6 100644
--- a/include/vcl/scrbar.hxx
+++ b/include/vcl/scrbar.hxx
@@ -91,6 +91,7 @@ private:
public:
explicit ScrollBar( vcl::Window* pParent, WinBits nStyle = WB_VERT );
virtual ~ScrollBar();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Tracking( const TrackingEvent& rTEvt ) SAL_OVERRIDE;
diff --git a/include/vcl/spin.hxx b/include/vcl/spin.hxx
index 4fb25f31829f..ad261f2ef478 100644
--- a/include/vcl/spin.hxx
+++ b/include/vcl/spin.hxx
@@ -57,7 +57,6 @@ private:
public:
explicit SpinButton( vcl::Window* pParent, WinBits nStyle = 0 );
- virtual ~SpinButton();
void Up();
void Down();
diff --git a/include/vcl/split.hxx b/include/vcl/split.hxx
index fbc833272ce7..c167ce7cc506 100644
--- a/include/vcl/split.hxx
+++ b/include/vcl/split.hxx
@@ -28,7 +28,7 @@
class VCL_DLLPUBLIC Splitter : public vcl::Window
{
private:
- vcl::Window* mpRefWin;
+ vcl::Window* mpRefWin;
long mnSplitPos;
long mnLastSplitPos;
long mnStartSplitPos;
@@ -63,6 +63,7 @@ protected:
public:
explicit Splitter( vcl::Window* pParent, WinBits nStyle = WB_VSCROLL );
virtual ~Splitter();
+ virtual void dispose() SAL_OVERRIDE;
void StartSplit();
void EndSplit();
diff --git a/include/vcl/splitwin.hxx b/include/vcl/splitwin.hxx
index 157f0c23ed60..009f9e9fb274 100644
--- a/include/vcl/splitwin.hxx
+++ b/include/vcl/splitwin.hxx
@@ -123,7 +123,8 @@ private:
SplitWindow & operator= (const SplitWindow &) SAL_DELETED_FUNCTION;
public:
SplitWindow( vcl::Window* pParent, WinBits nStyle = 0 );
- virtual ~SplitWindow();
+ virtual ~SplitWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void StartSplit();
virtual void Split();
diff --git a/include/vcl/status.hxx b/include/vcl/status.hxx
index a9ad080e8715..6824233e43d3 100644
--- a/include/vcl/status.hxx
+++ b/include/vcl/status.hxx
@@ -85,9 +85,9 @@ private:
long mnCalcHeight;
long mnTextY;
long mnItemY;
- sal_uInt16 mnCurItemId;
- sal_uInt16 mnPercent;
- sal_uInt16 mnPercentCount;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnPercent;
+ sal_uInt16 mnPercentCount;
bool mbVisibleItems;
bool mbFormat;
bool mbProgressMode;
@@ -113,7 +113,8 @@ private:
public:
StatusBar( vcl::Window* pParent,
WinBits nWinStyle = WB_BORDER | WB_RIGHT );
- virtual ~StatusBar();
+ virtual ~StatusBar();
+ virtual void dispose() SAL_OVERRIDE;
void AdjustItemWidthsForHiDPI(bool bAdjustHiDPI);
diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx
index 526bc25ddfec..a3b8aa0f0bec 100644
--- a/include/vcl/tabctrl.hxx
+++ b/include/vcl/tabctrl.hxx
@@ -42,13 +42,13 @@ private:
long mnLastHeight;
long mnBtnSize;
long mnMaxPageWidth;
- sal_uInt16 mnActPageId;
- sal_uInt16 mnCurPageId;
+ sal_uInt16 mnActPageId;
+ sal_uInt16 mnCurPageId;
bool mbFormat;
bool mbRestoreHelpId;
bool mbRestoreUnqId;
bool mbSmallInvalidate;
- bool mbLayoutDirty;
+ bool mbLayoutDirty;
Link maActivateHdl;
Link maDeactivateHdl;
@@ -83,6 +83,7 @@ public:
TabControl( vcl::Window* pParent,
WinBits nStyle = WB_STDTABCONTROL );
virtual ~TabControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
diff --git a/include/vcl/tabdlg.hxx b/include/vcl/tabdlg.hxx
index f02efc726596..f02e2a79de16 100644
--- a/include/vcl/tabdlg.hxx
+++ b/include/vcl/tabdlg.hxx
@@ -41,7 +41,8 @@ public:
TabDialog( vcl::Window* pParent,
WinBits nStyle = WB_STDTABDIALOG );
TabDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription );
- virtual ~TabDialog();
+ virtual ~TabDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
diff --git a/include/vcl/throbber.hxx b/include/vcl/throbber.hxx
index aaf8edf5fba5..f7cbbedf62e2 100644
--- a/include/vcl/throbber.hxx
+++ b/include/vcl/throbber.hxx
@@ -48,6 +48,7 @@ public:
public:
Throbber(vcl::Window* i_parentWindow, WinBits i_style, const ImageSet i_imageSet = IMAGES_AUTO);
virtual ~Throbber();
+ virtual void dispose() SAL_OVERRIDE;
// Properties
void setStepTime( sal_Int32 nStepTime ) { mnStepTime = nStepTime; }
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index d723e6ee3ab1..8c72c3cc3aae 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -281,7 +281,8 @@ protected:
public:
ToolBox( vcl::Window* pParent, WinBits nStyle = 0 );
ToolBox( vcl::Window* pParent, const ResId& rResId );
- virtual ~ToolBox();
+ virtual ~ToolBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Click();
void DoubleClick();
diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx
index cbe60c35f3f5..ed5cadcbb6ba 100644
--- a/vcl/generic/print/prtsetup.cxx
+++ b/vcl/generic/print/prtsetup.cxx
@@ -93,8 +93,14 @@ RTSDialog::RTSDialog(const PrinterInfo& rJobData, vcl::Window* pParent)
RTSDialog::~RTSDialog()
{
+ dispose();
+}
+
+void RTSDialog::dispose()
+{
delete m_pPaperPage;
delete m_pDevicePage;
+ TabDialog::dispose();
}
IMPL_LINK( RTSDialog, ActivatePage, TabControl*, pTabCtrl )
@@ -185,10 +191,6 @@ RTSPaperPage::RTSPaperPage(RTSDialog* pParent)
update();
}
-RTSPaperPage::~RTSPaperPage()
-{
-}
-
void RTSPaperPage::update()
{
const PPDKey* pKey = NULL;
@@ -353,10 +355,6 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent )
}
}
-RTSDevicePage::~RTSDevicePage()
-{
-}
-
sal_uLong RTSDevicePage::getDepth()
{
sal_uInt16 nSelectPos = m_pDepthBox->GetSelectEntryPos();
diff --git a/vcl/generic/print/prtsetup.hxx b/vcl/generic/print/prtsetup.hxx
index 6d641bedadf9..17852fc1a3fd 100644
--- a/vcl/generic/print/prtsetup.hxx
+++ b/vcl/generic/print/prtsetup.hxx
@@ -64,6 +64,7 @@ class RTSDialog : public TabDialog
public:
RTSDialog(const ::psp::PrinterInfo& rJobData, vcl::Window* pParent = NULL);
virtual ~RTSDialog();
+ virtual void dispose() SAL_OVERRIDE;
const ::psp::PrinterInfo& getSetup() const { return m_aJobData; }
};
@@ -86,7 +87,6 @@ class RTSPaperPage : public TabPage
DECL_LINK( SelectHdl, ListBox* );
public:
RTSPaperPage( RTSDialog* );
- virtual ~RTSPaperPage();
void update();
@@ -112,7 +112,6 @@ class RTSDevicePage : public TabPage
DECL_LINK( ModifyHdl, Edit* );
public:
RTSDevicePage( RTSDialog* );
- virtual ~RTSDevicePage();
sal_uLong getLevel();
sal_uLong getPDFDevice();
diff --git a/vcl/inc/helpwin.hxx b/vcl/inc/helpwin.hxx
index b6beda35a6d3..c092d292d4ea 100644
--- a/vcl/inc/helpwin.hxx
+++ b/vcl/inc/helpwin.hxx
@@ -38,8 +38,8 @@ private:
Timer maShowTimer;
Timer maHideTimer;
- sal_uInt16 mnHelpWinStyle;
- sal_uInt16 mnStyle;
+ sal_uInt16 mnHelpWinStyle;
+ sal_uInt16 mnStyle;
protected:
DECL_LINK( TimerHdl, Timer* );
@@ -50,7 +50,8 @@ protected:
public:
HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle );
- virtual ~HelpTextWindow();
+ virtual ~HelpTextWindow();
+ virtual void dispose() SAL_OVERRIDE;
const OUString& GetHelpText() const { return maHelpText; }
void SetHelpText( const OUString& rHelpText );
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx
index 82d33c00fe45..375d3cd48382 100644
--- a/vcl/inc/ilstbox.hxx
+++ b/vcl/inc/ilstbox.hxx
@@ -266,7 +266,8 @@ public:
virtual void FillLayoutData() const SAL_OVERRIDE;
ImplListBoxWindow( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~ImplListBoxWindow();
+ virtual ~ImplListBoxWindow();
+ virtual void dispose() SAL_OVERRIDE;
ImplEntryList* GetEntryList() const { return mpEntryList; }
@@ -568,7 +569,6 @@ protected:
public:
ImplWin( vcl::Window* pParent, WinBits nWinStyle = 0 );
- virtual ~ImplWin() {};
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
@@ -610,7 +610,6 @@ private:
public:
ImplBtn( vcl::Window* pParent, WinBits nWinStyle = 0 );
- virtual ~ImplBtn() {};
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
void MBDown();
diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index bfc8a29e8a74..7af9e1e8ec00 100644
--- a/vcl/inc/printdlg.hxx
+++ b/vcl/inc/printdlg.hxx
@@ -63,7 +63,6 @@ namespace vcl
public:
PrintPreviewWindow( vcl::Window* pParent );
- virtual ~PrintPreviewWindow();
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Command( const CommandEvent& ) SAL_OVERRIDE;
@@ -88,7 +87,6 @@ namespace vcl
void ImplInitSettings();
public:
ShowNupOrderWindow( vcl::Window* pParent );
- virtual ~ShowNupOrderWindow();
virtual Size GetOptimalSize() const SAL_OVERRIDE;
@@ -260,6 +258,7 @@ namespace vcl
public:
PrintDialog( vcl::Window*, const std::shared_ptr< PrinterController >& );
virtual ~PrintDialog();
+ virtual void dispose() SAL_OVERRIDE;
bool isPrintToFile();
bool isCollate();
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 8a3a1f800c5a..859f0c876950 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -290,11 +290,17 @@ HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal
HelpTextWindow::~HelpTextWindow()
{
+ dispose();
+}
+
+void HelpTextWindow::dispose()
+{
maShowTimer.Stop();
maHideTimer.Stop();
if( this == ImplGetSVData()->maHelpData.mpHelpWin )
ImplGetSVData()->maHelpData.mpHelpWin = NULL;
+ FloatingWindow::dispose();
}
void HelpTextWindow::SetHelpText( const OUString& rHelpText )
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 411243cccaeb..155952dcd184 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -67,7 +67,13 @@ Control::Control( vcl::Window* pParent, const ResId& rResId ) :
Control::~Control()
{
+ dispose();
+}
+
+void Control::dispose()
+{
delete mpControlData, mpControlData = NULL;
+ Window::dispose();
}
void Control::EnableRTL( bool bEnable )
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index c71b7265c32e..cb6b46b8cb7a 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -842,10 +842,6 @@ void NumericField::ImplLoadRes( const ResId& rResId )
mnSpinSize = ReadLongRes();
}
-NumericField::~NumericField()
-{
-}
-
bool NumericField::PreNotify( NotifyEvent& rNEvt )
{
if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
@@ -979,10 +975,6 @@ Size NumericBox::CalcMinimumSize() const
return aRet;
}
-NumericBox::~NumericBox()
-{
-}
-
bool NumericBox::PreNotify( NotifyEvent& rNEvt )
{
if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
@@ -1679,10 +1671,6 @@ void MetricField::ImplLoadRes( const ResId& rResId )
Reformat();
}
-MetricField::~MetricField()
-{
-}
-
void MetricField::SetUnit( FieldUnit nNewUnit )
{
sal_Int64 nRawMax = GetMax( nNewUnit );
@@ -1826,10 +1814,6 @@ Size MetricBox::CalcMinimumSize() const
return aRet;
}
-MetricBox::~MetricBox()
-{
-}
-
bool MetricBox::PreNotify( NotifyEvent& rNEvt )
{
if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
@@ -2056,10 +2040,6 @@ CurrencyField::CurrencyField( vcl::Window* pParent, WinBits nWinStyle ) :
Reformat();
}
-CurrencyField::~CurrencyField()
-{
-}
-
bool CurrencyField::PreNotify( NotifyEvent& rNEvt )
{
if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
@@ -2138,10 +2118,6 @@ CurrencyBox::CurrencyBox( vcl::Window* pParent, WinBits nWinStyle ) :
Reformat();
}
-CurrencyBox::~CurrencyBox()
-{
-}
-
bool CurrencyBox::PreNotify( NotifyEvent& rNEvt )
{
if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 4bf320f61f48..3f343b215760 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -820,10 +820,6 @@ PatternField::PatternField( vcl::Window* pParent, WinBits nWinStyle ) :
Reformat();
}
-PatternField::~PatternField()
-{
-}
-
bool PatternField::PreNotify( NotifyEvent& rNEvt )
{
if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
@@ -870,10 +866,6 @@ PatternBox::PatternBox( vcl::Window* pParent, WinBits nWinStyle ) :
Reformat();
}
-PatternBox::~PatternBox()
-{
-}
-
bool PatternBox::PreNotify( NotifyEvent& rNEvt )
{
if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
@@ -1738,10 +1730,6 @@ DateField::DateField( vcl::Window* pParent, WinBits nWinStyle ) :
ResetLastDate();
}
-DateField::~DateField()
-{
-}
-
bool DateField::PreNotify( NotifyEvent& rNEvt )
{
if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && IsStrictFormat() &&
@@ -1841,10 +1829,6 @@ DateBox::DateBox( vcl::Window* pParent, WinBits nWinStyle ) :
Reformat();
}
-DateBox::~DateBox()
-{
-}
-
bool DateBox::PreNotify( NotifyEvent& rNEvt )
{
if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && IsStrictFormat() &&
@@ -2532,10 +2516,6 @@ TimeField::TimeField( vcl::Window* pParent, WinBits nWinStyle ) :
Reformat();
}
-TimeField::~TimeField()
-{
-}
-
bool TimeField::PreNotify( NotifyEvent& rNEvt )
{
if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
@@ -2673,10 +2653,6 @@ TimeBox::TimeBox( vcl::Window* pParent, WinBits nWinStyle ) :
Reformat();
}
-TimeBox::~TimeBox()
-{
-}
-
bool TimeBox::PreNotify( NotifyEvent& rNEvt )
{
if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 5ee2a950c6eb..4f111bffaedf 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -754,10 +754,6 @@ FixedBitmap::FixedBitmap( vcl::Window* pParent, WinBits nStyle ) :
ImplInit( pParent, nStyle );
}
-FixedBitmap::~FixedBitmap()
-{
-}
-
void FixedBitmap::ImplDraw( OutputDevice* pDev, sal_uLong /* nDrawFlags */,
const Point& rPos, const Size& rSize )
{
@@ -921,10 +917,6 @@ FixedImage::FixedImage( vcl::Window* pParent, const ResId& rResId ) :
Show();
}
-FixedImage::~FixedImage()
-{
-}
-
void FixedImage::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize )
{
diff --git a/vcl/source/control/fixedhyper.cxx b/vcl/source/control/fixedhyper.cxx
index 6926a0c843c6..db36f90c2572 100644
--- a/vcl/source/control/fixedhyper.cxx
+++ b/vcl/source/control/fixedhyper.cxx
@@ -26,10 +26,6 @@ FixedHyperlink::FixedHyperlink(vcl::Window* pParent, WinBits nWinStyle)
Initialize();
}
-FixedHyperlink::~FixedHyperlink()
-{
-}
-
void FixedHyperlink::Initialize()
{
// saves the old pointer
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 9a18684f22a7..dd9cf5208bf9 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -536,7 +536,13 @@ ImplListBoxWindow::ImplListBoxWindow( vcl::Window* pParent, WinBits nWinStyle )
ImplListBoxWindow::~ImplListBoxWindow()
{
+ dispose();
+}
+
+void ImplListBoxWindow::dispose()
+{
delete mpEntryList;
+ Control::dispose();
}
void ImplListBoxWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx
index 5f081bed20de..77724b0b02d3 100644
--- a/vcl/source/control/longcurr.cxx
+++ b/vcl/source/control/longcurr.cxx
@@ -468,10 +468,6 @@ LongCurrencyField::LongCurrencyField( vcl::Window* pParent, WinBits nWinStyle )
Reformat();
}
-LongCurrencyField::~LongCurrencyField()
-{
-}
-
bool LongCurrencyField::PreNotify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
@@ -546,10 +542,6 @@ LongCurrencyBox::LongCurrencyBox( vcl::Window* pParent, WinBits nWinStyle ) :
Reformat();
}
-LongCurrencyBox::~LongCurrencyBox()
-{
-}
-
bool LongCurrencyBox::PreNotify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index ee856fc42257..23da0e84b70d 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -70,6 +70,11 @@ ListBox::ListBox( vcl::Window* pParent, const ResId& rResId ) :
ListBox::~ListBox()
{
+ dispose();
+}
+
+void ListBox::dispose()
+{
CallEventListeners( VCLEVENT_OBJECT_DYING );
// When destroying the FloatWin TH does a GrabFocus to the Parent:
@@ -81,6 +86,7 @@ ListBox::~ListBox()
delete mpFloatWin;
delete mpImplWin;
delete mpBtn;
+ Control::dispose();
}
void ListBox::ImplInitListBoxData()
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx
index a78c5612ec86..f38886726927 100644
--- a/vcl/source/control/menubtn.cxx
+++ b/vcl/source/control/menubtn.cxx
@@ -82,8 +82,14 @@ MenuButton::MenuButton( vcl::Window* pParent, WinBits nWinBits )
MenuButton::~MenuButton()
{
+ dispose();
+}
+
+void MenuButton::dispose()
+{
delete mpMenuTimer;
delete mpOwnMenu;
+ PushButton::dispose();
}
IMPL_LINK_NOARG(MenuButton, ImplMenuTimeoutHdl)
diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx
index 95cd171afd81..eb28f3a7088e 100644
--- a/vcl/source/control/morebtn.cxx
+++ b/vcl/source/control/morebtn.cxx
@@ -80,8 +80,14 @@ MoreButton::MoreButton( vcl::Window* pParent, WinBits nStyle ) :
MoreButton::~MoreButton()
{
+ dispose();
+}
+
+void MoreButton::dispose()
+{
delete mpMBData->mpItemList;
delete mpMBData;
+ PushButton::dispose();
}
void MoreButton::Click()
diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx
index d6443cd16515..a89afac723bb 100644
--- a/vcl/source/control/prgsbar.cxx
+++ b/vcl/source/control/prgsbar.cxx
@@ -56,10 +56,6 @@ ProgressBar::ProgressBar( vcl::Window* pParent, WinBits nWinStyle ) :
ImplInit();
}
-ProgressBar::~ProgressBar()
-{
-}
-
void ProgressBar::ImplInitSettings( bool bFont,
bool bForeground, bool bBackground )
{
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 98d753363f18..b1411d72469f 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -125,7 +125,13 @@ ScrollBar::ScrollBar( vcl::Window* pParent, WinBits nStyle ) :
ScrollBar::~ScrollBar()
{
+ dispose();
+}
+
+void ScrollBar::dispose()
+{
delete mpData;
+ Control::dispose();
}
void ScrollBar::ImplUpdateRects( bool bUpdate )
diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx
index 9b16b4753751..c9feafa07663 100644
--- a/vcl/source/control/spinbtn.cxx
+++ b/vcl/source/control/spinbtn.cxx
@@ -55,10 +55,6 @@ SpinButton::SpinButton( vcl::Window* pParent, WinBits nStyle )
ImplInit( pParent, nStyle );
}
-SpinButton::~SpinButton()
-{
-}
-
IMPL_LINK( SpinButton, ImplTimeout, Timer*, pTimer )
{
if ( pTimer->GetTimeout() == GetSettings().GetMouseSettings().GetButtonStartRepeat() )
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 3d544133c398..73987a1aafc8 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -192,6 +192,11 @@ TabControl::TabControl( vcl::Window* pParent, WinBits nStyle ) :
TabControl::~TabControl()
{
+ dispose();
+}
+
+void TabControl::dispose()
+{
Window *pParent = GetParent();
if (pParent && pParent->IsDialog())
GetParent()->RemoveChildEventListener( LINK( this, TabControl, ImplWindowEventListener ) );
@@ -205,6 +210,7 @@ TabControl::~TabControl()
delete mpTabCtrlData->mpListBox;
delete mpTabCtrlData;
}
+ Control::dispose();
}
ImplTabItem* TabControl::ImplGetItem( sal_uInt16 nId ) const
diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx
index 347f24a32e31..e91f24bc6c7a 100644
--- a/vcl/source/control/throbber.cxx
+++ b/vcl/source/control/throbber.cxx
@@ -59,7 +59,13 @@ Throbber::Throbber( vcl::Window* i_parentWindow, WinBits i_style, const ImageSet
Throbber::~Throbber()
{
+ dispose();
+}
+
+void Throbber::dispose()
+{
maWaitTimer.Stop();
+ ImageControl::dispose();
}
namespace
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 0ceabaf0c51b..c0406c6329a6 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -47,7 +47,8 @@ private:
public:
TextWindow( vcl::Window* pParent );
- virtual ~TextWindow();
+ virtual ~TextWindow();
+ virtual void dispose() SAL_OVERRIDE;
ExtTextEngine* GetTextEngine() const { return mpExtTextEngine; }
ExtTextView* GetTextView() const { return mpExtTextView; }
@@ -730,8 +731,14 @@ TextWindow::TextWindow( vcl::Window* pParent ) : Window( pParent )
TextWindow::~TextWindow()
{
+ dispose();
+}
+
+void TextWindow::dispose()
+{
delete mpExtTextView;
delete mpExtTextEngine;
+ Window::dispose();
}
void TextWindow::MouseMove( const MouseEvent& rMEvt )
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx
index 623ea9635b37..1aad1dc73574 100644
--- a/vcl/source/window/dockingarea.cxx
+++ b/vcl/source/window/dockingarea.cxx
@@ -92,7 +92,13 @@ DockingAreaWindow::DockingAreaWindow( vcl::Window* pParent ) :
DockingAreaWindow::~DockingAreaWindow()
{
+ dispose();
+}
+
+void DockingAreaWindow::dispose()
+{
delete mpImplData;
+ Window::dispose();
}
void DockingAreaWindow::DataChanged( const DataChangedEvent& rDCEvt )
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index a389216fb914..7b0f1c3ae2c5 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -57,6 +57,7 @@ public:
ImplDockFloatWin2( vcl::Window* pParent, WinBits nWinBits,
ImplDockingWindowWrapper* pDockingWin );
virtual ~ImplDockFloatWin2();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Move() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
@@ -97,8 +98,14 @@ ImplDockFloatWin2::ImplDockFloatWin2( vcl::Window* pParent, WinBits nWinBits,
ImplDockFloatWin2::~ImplDockFloatWin2()
{
+ dispose();
+}
+
+void ImplDockFloatWin2::dispose()
+{
if( mnLastUserEvent )
Application::RemoveUserEvent( mnLastUserEvent );
+ FloatingWindow::dispose();
}
IMPL_LINK_NOARG(ImplDockFloatWin2, DockTimerHdl)
@@ -477,6 +484,7 @@ private:
public:
ImplPopupFloatWin( vcl::Window* pParent, ImplDockingWindowWrapper* pDockingWin, bool bHasGrip );
virtual ~ImplPopupFloatWin();
+ virtual void dispose() SAL_OVERRIDE;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
@@ -513,7 +521,13 @@ ImplPopupFloatWin::ImplPopupFloatWin( vcl::Window* pParent, ImplDockingWindowWra
ImplPopupFloatWin::~ImplPopupFloatWin()
{
+ dispose();
+}
+
+void ImplPopupFloatWin::dispose()
+{
mpDockingWin = NULL;
+ FloatingWindow::dispose();
}
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ImplPopupFloatWin::CreateAccessible()
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 94e32d34abf5..549d8c445c24 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -73,6 +73,7 @@ public:
ImplDockFloatWin( vcl::Window* pParent, WinBits nWinBits,
DockingWindow* pDockingWin );
virtual ~ImplDockFloatWin();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Move() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
@@ -111,8 +112,14 @@ ImplDockFloatWin::ImplDockFloatWin( vcl::Window* pParent, WinBits nWinBits,
ImplDockFloatWin::~ImplDockFloatWin()
{
+ dispose();
+}
+
+void ImplDockFloatWin::dispose()
+{
if( mnLastUserEvent )
Application::RemoveUserEvent( mnLastUserEvent );
+ FloatingWindow::dispose();
}
IMPL_LINK_NOARG(ImplDockFloatWin, DockTimerHdl)
@@ -460,6 +467,11 @@ DockingWindow::DockingWindow(vcl::Window* pParent, const OString& rID,
DockingWindow::~DockingWindow()
{
+ dispose();
+}
+
+void DockingWindow::dispose()
+{
if ( IsFloatingMode() )
{
Show( false, SHOW_NOFOCUSCHANGE );
@@ -467,6 +479,7 @@ DockingWindow::~DockingWindow()
}
delete mpImplData;
mpImplData = NULL;
+ Window::dispose();
}
void DockingWindow::Tracking( const TrackingEvent& rTEvt )
diff --git a/vcl/source/window/popupmenuwindow.cxx b/vcl/source/window/popupmenuwindow.cxx
index 1a33ff9037ca..fec8ebca0385 100644
--- a/vcl/source/window/popupmenuwindow.cxx
+++ b/vcl/source/window/popupmenuwindow.cxx
@@ -46,7 +46,13 @@ PopupMenuFloatingWindow::PopupMenuFloatingWindow( vcl::Window* pParent, WinBits
PopupMenuFloatingWindow::~PopupMenuFloatingWindow()
{
+ dispose();
+}
+
+void PopupMenuFloatingWindow::dispose()
+{
delete mpImplData;
+ FloatingWindow::dispose();
}
sal_uInt16 PopupMenuFloatingWindow::GetMenuStackLevel() const
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 0015caf7d886..2c63c674093b 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -80,10 +80,6 @@ PrintDialog::PrintPreviewWindow::PrintPreviewWindow( vcl::Window* i_pParent )
maVertDim->SetText( OUString( "2.0in" ) );
}
-PrintDialog::PrintPreviewWindow::~PrintPreviewWindow()
-{
-}
-
const sal_Int32 PrintDialog::PrintPreviewWindow::PREVIEW_BITMAP_WIDTH = 1600;
void PrintDialog::PrintPreviewWindow::DataChanged( const DataChangedEvent& i_rDCEvt )
@@ -310,10 +306,6 @@ PrintDialog::ShowNupOrderWindow::ShowNupOrderWindow( vcl::Window* i_pParent )
ImplInitSettings();
}
-PrintDialog::ShowNupOrderWindow::~ShowNupOrderWindow()
-{
-}
-
void PrintDialog::ShowNupOrderWindow::ImplInitSettings()
{
SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) );
@@ -719,6 +711,11 @@ PrintDialog::PrintDialog( vcl::Window* i_pParent, const std::shared_ptr<PrinterC
PrintDialog::~PrintDialog()
{
+ dispose();
+}
+
+void PrintDialog::dispose()
+{
delete mpCustomOptionsUIBuilder;
}
diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx
index 947dc986cf20..bd4b3fec5620 100644
--- a/vcl/source/window/split.cxx
+++ b/vcl/source/window/split.cxx
@@ -151,8 +151,14 @@ Splitter::Splitter( vcl::Window* pParent, WinBits nStyle ) :
Splitter::~Splitter()
{
+ dispose();
+}
+
+void Splitter::dispose()
+{
TaskPaneList *pTList = GetSystemWindow()->GetTaskPaneList();
pTList->RemoveWindow( this );
+ Window::dispose();
}
void Splitter::SetHorizontal(bool bNew)
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 86db81283a4f..9f63ae3493db 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -1347,9 +1347,15 @@ SplitWindow::SplitWindow( vcl::Window* pParent, WinBits nStyle ) :
SplitWindow::~SplitWindow()
{
+ dispose();
+}
+
+void SplitWindow::dispose()
+{
// delete Sets
ImplDeleteSet( mpMainSet );
mpMainSet = NULL; //NULL for base-class callbacks during dtoring
+ DockingWindow::dispose();
}
void SplitWindow::ImplSetWindowSize( long nDelta )
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index bca642e23612..15db5b5e6909 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -151,6 +151,11 @@ StatusBar::StatusBar( vcl::Window* pParent, WinBits nStyle ) :
StatusBar::~StatusBar()
{
+ dispose();
+}
+
+void StatusBar::dispose()
+{
// delete all items
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
delete (*mpItemList)[ i ];
@@ -160,6 +165,7 @@ StatusBar::~StatusBar()
// delete VirtualDevice
delete mpImplData->mpVirDev;
delete mpImplData;
+ Window::dispose();
}
void StatusBar::AdjustItemWidthsForHiDPI(bool bAdjustHiDPI)
diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx
index f15a2a03be49..9612ada17206 100644
--- a/vcl/source/window/tabdlg.cxx
+++ b/vcl/source/window/tabdlg.cxx
@@ -221,7 +221,13 @@ TabDialog::TabDialog( vcl::Window* pParent, const OUString& rID, const OUString&
TabDialog::~TabDialog()
{
+ dispose();
+}
+
+void TabDialog::dispose()
+{
delete mpFixedLine;
+ Dialog::dispose();
}
void TabDialog::StateChanged( StateChangedType nType )
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 7cf7a23b0c76..f0da66ca311c 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1570,6 +1570,11 @@ ToolBox::ToolBox( vcl::Window* pParent, const ResId& rResId ) :
ToolBox::~ToolBox()
{
+ dispose();
+}
+
+void ToolBox::dispose()
+{
// custom menu event still running?
if( mpData->mnEventId )
Application::RemoveUserEvent( mpData->mnEventId );
@@ -1601,6 +1606,7 @@ ToolBox::~ToolBox()
pSVData->maCtrlData.mpTBDragMgr = NULL;
}
}
+ DockingWindow::dispose();
}
ImplToolItem* ToolBox::ImplGetItem( sal_uInt16 nItemId ) const
diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx
index b779c52716db..fb49388a2d82 100644
--- a/vcl/unx/generic/app/i18n_status.cxx
+++ b/vcl/unx/generic/app/i18n_status.cxx
@@ -52,7 +52,6 @@ class StatusWindow : public WorkWindow
protected:
StatusWindow( WinBits nWinBits );
public:
- virtual ~StatusWindow();
virtual void setPosition( SalFrame* );
virtual void setText( const OUString & ) = 0;
@@ -67,8 +66,6 @@ StatusWindow::StatusWindow( WinBits nWinBits ) :
{
}
-StatusWindow::~StatusWindow() {}
-
void StatusWindow::setPosition( SalFrame* )
{
}
diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx
index 528eae381abb..72869d1d507a 100644
--- a/vcl/workben/outdevgrind.cxx
+++ b/vcl/workben/outdevgrind.cxx
@@ -72,7 +72,6 @@ class TestWindow : public Dialog
Show();
}
- virtual ~TestWindow() {}
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
};
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index f272ccbb88c4..9860d7d20c84 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1385,8 +1385,13 @@ public:
}
virtual ~DemoWin()
{
+ dispose();
+ }
+ virtual void dispose() SAL_OVERRIDE
+ {
mxThread.clear();
mrRenderer.removeInvalidate(this);
+ WorkWindow::dispose();
}
virtual void MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE
{
@@ -1477,14 +1482,6 @@ public:
Show();
}
-
- virtual ~DemoWidgets()
- {
- delete mpButton;
- delete mpToolbox;
- delete mpBox;
- }
-
virtual void Paint(const Rectangle&) SAL_OVERRIDE
{
Rectangle aWholeSize(Point(0, 0),GetOutputSizePixel());