[Libreoffice-commits] core.git: Branch 'feature/vclref' - compilerplugins/clang include/vcl vcl/generic vcl/inc vcl/source vcl/unx vcl/workben

Noel Grandin noel at peralex.com
Mon Jan 12 01:39:39 PST 2015


 compilerplugins/clang/vclwidgets.cxx  |   13 +++----------
 include/vcl/ctrl.hxx                  |    1 +
 include/vcl/dockingarea.hxx           |    1 +
 include/vcl/dockwin.hxx               |    1 +
 include/vcl/field.hxx                 |   12 ------------
 include/vcl/fixed.hxx                 |    2 --
 include/vcl/fixedhyper.hxx            |    5 -----
 include/vcl/longcurr.hxx              |    2 --
 include/vcl/lstbox.hxx                |    1 +
 include/vcl/menubtn.hxx               |    1 +
 include/vcl/morebtn.hxx               |    3 ++-
 include/vcl/popupmenuwindow.hxx       |    1 +
 include/vcl/prgsbar.hxx               |    5 ++---
 include/vcl/scrbar.hxx                |    1 +
 include/vcl/spin.hxx                  |    1 -
 include/vcl/split.hxx                 |    3 ++-
 include/vcl/splitwin.hxx              |    3 ++-
 include/vcl/status.hxx                |    9 +++++----
 include/vcl/tabctrl.hxx               |    7 ++++---
 include/vcl/tabdlg.hxx                |    3 ++-
 include/vcl/throbber.hxx              |    1 +
 include/vcl/toolbox.hxx               |    3 ++-
 vcl/generic/print/prtsetup.cxx        |   14 ++++++--------
 vcl/generic/print/prtsetup.hxx        |    3 +--
 vcl/inc/helpwin.hxx                   |    7 ++++---
 vcl/inc/ilstbox.hxx                   |    5 ++---
 vcl/inc/printdlg.hxx                  |    3 +--
 vcl/source/app/help.cxx               |    6 ++++++
 vcl/source/control/ctrl.cxx           |    6 ++++++
 vcl/source/control/field.cxx          |   24 ------------------------
 vcl/source/control/field2.cxx         |   24 ------------------------
 vcl/source/control/fixed.cxx          |    8 --------
 vcl/source/control/fixedhyper.cxx     |    4 ----
 vcl/source/control/ilstbox.cxx        |    6 ++++++
 vcl/source/control/longcurr.cxx       |    8 --------
 vcl/source/control/lstbox.cxx         |    6 ++++++
 vcl/source/control/menubtn.cxx        |    6 ++++++
 vcl/source/control/morebtn.cxx        |    6 ++++++
 vcl/source/control/prgsbar.cxx        |    4 ----
 vcl/source/control/scrbar.cxx         |    6 ++++++
 vcl/source/control/spinbtn.cxx        |    4 ----
 vcl/source/control/tabctrl.cxx        |    6 ++++++
 vcl/source/control/throbber.cxx       |    6 ++++++
 vcl/source/edit/vclmedit.cxx          |    9 ++++++++-
 vcl/source/window/dockingarea.cxx     |    6 ++++++
 vcl/source/window/dockmgr.cxx         |   14 ++++++++++++++
 vcl/source/window/dockwin.cxx         |   13 +++++++++++++
 vcl/source/window/popupmenuwindow.cxx |    6 ++++++
 vcl/source/window/printdlg.cxx        |   13 +++++--------
 vcl/source/window/split.cxx           |    6 ++++++
 vcl/source/window/splitwin.cxx        |    6 ++++++
 vcl/source/window/status.cxx          |    6 ++++++
 vcl/source/window/tabdlg.cxx          |    6 ++++++
 vcl/source/window/toolbox.cxx         |    6 ++++++
 vcl/unx/generic/app/i18n_status.cxx   |    3 ---
 vcl/workben/outdevgrind.cxx           |    1 -
 vcl/workben/vcldemo.cxx               |    8 +++++---
 57 files changed, 187 insertions(+), 157 deletions(-)

New commits:
commit b76ff5c5bc9317a445b8e289857be1dc40819f93
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jan 12 11:38:12 2015 +0200

    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

diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx
index 1f8e05b..040c5ba 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 1158234..414f0ed 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -128,6 +128,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 c0b7518..f4a8bd0 100644
--- a/include/vcl/dockingarea.hxx
+++ b/include/vcl/dockingarea.hxx
@@ -38,6 +38,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 6dfad81..6ae8989 100644
--- a/include/vcl/dockwin.hxx
+++ b/include/vcl/dockwin.hxx
@@ -301,6 +301,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 f3d6c82..250b548 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -487,7 +487,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;
@@ -507,7 +506,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;
@@ -537,7 +535,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;
@@ -604,7 +601,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;
@@ -636,7 +632,6 @@ protected:
 public:
     explicit                DateField( vcl::Window* pParent, WinBits nWinStyle );
     explicit                DateField( vcl::Window* pParent, const ResId& );
-    virtual                 ~DateField();
 
     virtual bool            PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
     virtual bool            Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -672,7 +667,6 @@ protected:
 public:
     explicit                TimeField( vcl::Window* pParent, WinBits nWinStyle );
     explicit                TimeField( vcl::Window* pParent, const ResId& );
-    virtual                 ~TimeField();
 
     virtual bool            PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
     virtual bool            Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -702,7 +696,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;
@@ -721,7 +714,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;
 
@@ -745,7 +737,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;
@@ -778,7 +769,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;
@@ -799,7 +789,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;
@@ -819,7 +808,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 a5069fc..66a5bb9 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 c85bd1c..2fc8e2f 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 74de049..0be11b5 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 621b571..ad365f6 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 83087ab..9a9a73a 100644
--- a/include/vcl/menubtn.hxx
+++ b/include/vcl/menubtn.hxx
@@ -58,6 +58,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 f773391..bf669be 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;
 
@@ -51,6 +51,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 266738a17..13d699f 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 782b2c5..43d3406 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 65bbca0..a758357 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 1900822..8ca8563b 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();
 
     virtual void    Up();
     virtual void    Down();
diff --git a/include/vcl/split.hxx b/include/vcl/split.hxx
index 1ed55f4..29bd204 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;
@@ -64,6 +64,7 @@ protected:
 public:
     explicit            Splitter( vcl::Window* pParent, WinBits nStyle = WB_VSCROLL );
     virtual             ~Splitter();
+    virtual void        dispose() SAL_OVERRIDE;
 
     virtual void        StartSplit();
     virtual void        EndSplit();
diff --git a/include/vcl/splitwin.hxx b/include/vcl/splitwin.hxx
index 83f6406..f56c746 100644
--- a/include/vcl/splitwin.hxx
+++ b/include/vcl/splitwin.hxx
@@ -126,7 +126,8 @@ private:
     SAL_DLLPRIVATE      SplitWindow & operator= (const SplitWindow &);
 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 b6433ef..57d6bab 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 526bc25..a3b8aa0 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 f02efc7..f02e2a7 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 aaf8edf..f7cbbed 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 3f2fbc1..e894c23 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -287,7 +287,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();
     virtual void        DoubleClick();
diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx
index 7118850..5f72838 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 )
@@ -187,10 +193,6 @@ RTSPaperPage::RTSPaperPage(RTSDialog* pParent)
     update();
 }
 
-RTSPaperPage::~RTSPaperPage()
-{
-}
-
 void RTSPaperPage::update()
 {
     const PPDKey* pKey      = NULL;
@@ -356,10 +358,6 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent )
     }
 }
 
-RTSDevicePage::~RTSDevicePage()
-{
-}
-
 void RTSDevicePage::update()
 {
 }
diff --git a/vcl/generic/print/prtsetup.hxx b/vcl/generic/print/prtsetup.hxx
index 08fb22d..4ab3d0d 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();
 
     void update();
 
diff --git a/vcl/inc/helpwin.hxx b/vcl/inc/helpwin.hxx
index b6beda3..c092d29 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 0f3b93d..2d4ebc3 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;
     virtual void    MBDown();
diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index fc4683a..26be5ed 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;
 
@@ -262,6 +260,7 @@ namespace vcl
     public:
         PrintDialog( vcl::Window*, const boost::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 1e44c45..121329a 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 612bf94..c0fcd24 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 18d4d88..549e818 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -766,10 +766,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() )
@@ -903,10 +899,6 @@ Size NumericBox::CalcMinimumSize() const
     return aRet;
 }
 
-NumericBox::~NumericBox()
-{
-}
-
 bool NumericBox::PreNotify( NotifyEvent& rNEvt )
 {
     if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
@@ -1603,10 +1595,6 @@ void MetricField::ImplLoadRes( const ResId& rResId )
     Reformat();
 }
 
-MetricField::~MetricField()
-{
-}
-
 void MetricField::SetUnit( FieldUnit nNewUnit )
 {
     sal_Int64 nRawMax = GetMax( nNewUnit );
@@ -1750,10 +1738,6 @@ Size MetricBox::CalcMinimumSize() const
     return aRet;
 }
 
-MetricBox::~MetricBox()
-{
-}
-
 bool MetricBox::PreNotify( NotifyEvent& rNEvt )
 {
     if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2()  )
@@ -1980,10 +1964,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() )
@@ -2062,10 +2042,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 0a651c7..d403fb6 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() )
@@ -1816,10 +1808,6 @@ void DateField::ImplLoadRes( const ResId& rResId )
     Reformat();
 }
 
-DateField::~DateField()
-{
-}
-
 bool DateField::PreNotify( NotifyEvent& rNEvt )
 {
     if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && IsStrictFormat() &&
@@ -1919,10 +1907,6 @@ DateBox::DateBox( vcl::Window* pParent, WinBits nWinStyle ) :
     Reformat();
 }
 
-DateBox::~DateBox()
-{
-}
-
 bool DateBox::PreNotify( NotifyEvent& rNEvt )
 {
     if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && IsStrictFormat() &&
@@ -2693,10 +2677,6 @@ void TimeField::ImplLoadRes( const ResId& rResId )
     Reformat();
 }
 
-TimeField::~TimeField()
-{
-}
-
 bool TimeField::PreNotify( NotifyEvent& rNEvt )
 {
     if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
@@ -2834,10 +2814,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 b084a06..dc8bec9 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 6926a0c..db36f90 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 36f39d4..1fe58fc 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 1393de0..f489a78 100644
--- a/vcl/source/control/longcurr.cxx
+++ b/vcl/source/control/longcurr.cxx
@@ -466,10 +466,6 @@ LongCurrencyField::LongCurrencyField( vcl::Window* pParent, WinBits nWinStyle )
     Reformat();
 }
 
-LongCurrencyField::~LongCurrencyField()
-{
-}
-
 bool LongCurrencyField::PreNotify( NotifyEvent& rNEvt )
 {
     if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
@@ -544,10 +540,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 d6eeca2..5e13f07 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()
+{
     ImplCallEventListeners( 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 a4ffdf8..6ecb214 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 0b585a1..e45babd 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 4dc523c..00aed82 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 06920fe..e6a7b70 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 9b16b47..c9feafa 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 e36acc0..1f72190 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 347f24a..e91f24b 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 cf76456..379aee2 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -48,7 +48,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; }
@@ -731,8 +732,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 8266c64..8309a62 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 722b96d..6e9ff37 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -56,6 +56,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;
@@ -96,8 +97,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)
@@ -479,6 +486,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;
@@ -515,7 +523,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 95dd54b..9ad9508 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -72,6 +72,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;
@@ -110,8 +111,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)
@@ -459,6 +466,11 @@ DockingWindow::DockingWindow(vcl::Window* pParent, const OString& rID,
 
 DockingWindow::~DockingWindow()
 {
+    dispose();
+}
+
+void DockingWindow::dispose()
+{
     if ( IsFloatingMode() )
     {
         Show( false, SHOW_NOFOCUSCHANGE );
@@ -466,6 +478,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 1a33ff9..fec8ebc 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 a6233e0..8552177 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() ) );
@@ -727,6 +719,11 @@ PrintDialog::PrintDialog( vcl::Window* i_pParent, const boost::shared_ptr<Printe
 
 PrintDialog::~PrintDialog()
 {
+    dispose();
+}
+
+void PrintDialog::dispose()
+{
     delete mpCustomOptionsUIBuilder;
 }
 
diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx
index 60efeb9..81826ea 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 47976fd..e993b57 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -1348,9 +1348,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 2b74883..e635caa 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 f15a2a0..9612ada 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 082d86d..51a6521 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1578,6 +1578,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 );
@@ -1609,6 +1614,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 2095491..9ed59af 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 528eae3..72869d1 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 a9d3634..b62367d 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1207,7 +1207,12 @@ public:
     }
     virtual ~DemoWin()
     {
+        dispose();
+    }
+    virtual void dispose() SAL_OVERRIDE
+    {
         mrRenderer.removeInvalidate(this);
+        WorkWindow::dispose();
     }
     virtual void MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE
     {
@@ -1274,9 +1279,6 @@ public:
 
         Show();
     }
-    virtual ~DemoWidgets()
-    {
-    }
     virtual void Paint(const Rectangle&) SAL_OVERRIDE
     {
         Rectangle aWholeSize(Point(0, 0),GetOutputSizePixel());


More information about the Libreoffice-commits mailing list