re-insert erroneously converted delete calls.

Change-Id: Iebdf2af3866d884289f6913646106fe3f2d4dde5
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index cb80961..4e0c09b 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -242,7 +242,7 @@ void IconChoiceDialog::dispose()

            if ( pData->bOnDemand )
                delete &pData->pPage->GetItemSet();
            delete pData->pPage;
            pData->pPage.disposeAndClear();
        }
        delete pData;
    }
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 98833f9..808a80c 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -81,7 +81,7 @@ short Class::Execute()                              \

class VclAbstractDialog2_Impl : public VclAbstractDialog2
{
    VclPtr<Dialog>         m_pDlg;
    ScopedVclPtr<Dialog> m_pDlg;
    Link            m_aEndDlgHdl;
public:
                    VclAbstractDialog2_Impl( Dialog* p ) : m_pDlg( p ) {}
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 6262d24..ab31348 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -465,7 +465,7 @@ static bool lcl_isOptionHidden( sal_uInt16 _nPageId, const SvtOptionsDialogOptio

struct OptionsPageInfo
{
    VclPtr<SfxTabPage>  m_pPage;
    ScopedVclPtr<SfxTabPage> m_pPage;
    sal_uInt16          m_nPageId;
    OUString       m_sPageURL;
    OUString       m_sEventHdl;
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 2125cbd..da52057 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -1535,6 +1535,10 @@ void OJoinTableView::clearLayoutInformation()

    m_aTableMap.clear();

    for(auto i = m_vTableConnection.begin();
             i != m_vTableConnection.end(); ++i)
        i->disposeAndClear();

    m_vTableConnection.clear();
}

diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
index 85f3ff2..02c59c3 100644
--- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
@@ -33,6 +33,7 @@ OQueryTabConnUndoAction::~OQueryTabConnUndoAction()
    if (m_bOwnerOfConn)
    {   // I have the connection -> delete
        m_pOwner->DeselectConn(m_pConnection);
        m_pConnection.disposeAndClear();
    }
}

diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
index 1745890..d898780 100644
--- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
@@ -56,6 +56,7 @@ OQueryTabWinUndoAct::~OQueryTabWinUndoAct()

        if ( m_pTabWin )
            m_pTabWin->clearListBox();
        m_pTabWin.disposeAndClear();

        // and of course the corresponding connections
        auto aIter = m_vTableConnection.begin();
@@ -63,6 +64,7 @@ OQueryTabWinUndoAct::~OQueryTabWinUndoAct()
        for(;aIter != aEnd;++aIter)
        {
            m_pOwner->DeselectConn(*aIter);
            aIter->disposeAndClear();
        }
        m_vTableConnection.clear();
    }
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index a031b47..53b5380 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -98,6 +98,8 @@ TheExtensionManager::TheExtensionManager( vcl::Window *pParent,

TheExtensionManager::~TheExtensionManager()
{
    m_pUpdReqDialog.disposeAndClear();
    m_pExtMgrDialog.disposeAndClear();
    delete m_pExecuteCmdQueue;
}

diff --git a/extensions/source/propctrlr/propertyeditor.hxx b/extensions/source/propctrlr/propertyeditor.hxx
index a43ee8d..2e2d6fd 100644
--- a/extensions/source/propctrlr/propertyeditor.hxx
+++ b/extensions/source/propctrlr/propertyeditor.hxx
@@ -49,7 +49,7 @@ namespace pcr
        struct HiddenPage
        {
            sal_uInt16  nPos;
            VclPtr<TabPage>    pPage;
            ScopedVclPtr<TabPage>    pPage;
            HiddenPage() : nPos( 0 ), pPage( NULL ) { }
            HiddenPage( sal_uInt16 _nPos, TabPage* _pPage ) : nPos( _nPos ), pPage( _pPage ) { }
        };
diff --git a/forms/source/solar/inc/navtoolbar.hxx b/forms/source/solar/inc/navtoolbar.hxx
index e5c2627..ec66f92 100644
--- a/forms/source/solar/inc/navtoolbar.hxx
+++ b/forms/source/solar/inc/navtoolbar.hxx
@@ -61,7 +61,7 @@ namespace frm
                                        m_pDescriptionProvider;
        ImageSize                       m_eImageSize;
        VclPtr<ImplNavToolBar>          m_pToolbar;
        ::std::vector< VclPtr<vcl::Window> >        m_aChildWins;
        ::std::vector< ScopedVclPtr<vcl::Window> > m_aChildWins;

    public:
        NavigationToolBar(
diff --git a/fpicker/source/office/commonpicker.cxx b/fpicker/source/office/commonpicker.cxx
index 95ee24b..f237568 100644
--- a/fpicker/source/office/commonpicker.cxx
+++ b/fpicker/source/office/commonpicker.cxx
@@ -148,7 +148,11 @@ namespace svt
        {
            stopWindowListening();

            m_pDlg.clear();
            if ( !bDialogDying )    // it's the parent which is dying -> delete the dialog
                m_pDlg.disposeAndClear();
            else
                m_pDlg.clear();

            m_xWindow = NULL;
            m_xDialogParent = NULL;
        }
diff --git a/framework/inc/classes/fwktabwindow.hxx b/framework/inc/classes/fwktabwindow.hxx
index b041482..ed3d82c 100644
--- a/framework/inc/classes/fwktabwindow.hxx
+++ b/framework/inc/classes/fwktabwindow.hxx
@@ -78,7 +78,7 @@ public:
struct TabEntry
{
    sal_Int32           m_nIndex;
    VclPtr<FwkTabPage>  m_pPage;
    ScopedVclPtr<FwkTabPage>  m_pPage;
    OUString            m_sPageURL;
    css::uno::Reference< css::awt::XContainerWindowEventHandler > m_xEventHdl;

diff --git a/include/sfx2/fcontnr.hxx b/include/sfx2/fcontnr.hxx
index 3ae4237..1c325b9 100644
--- a/include/sfx2/fcontnr.hxx
+++ b/include/sfx2/fcontnr.hxx
@@ -57,7 +57,7 @@ public:

class SfxFrameWindow
{
    VclPtr<vcl::Window>     pWindow;
    ScopedVclPtr<vcl::Window> pWindow;
public:
                SfxFrameWindow( vcl::Window *pWin )
                 : pWindow( pWin )
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 44f6969..216c3c8 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -58,7 +58,7 @@ class ScTextImportOptionsDlg;
class ScCondFormatManagerDlg;

#define DECL_ABSTDLG_BASE(Class,DialogClass)        \
    VclPtr<DialogClass> pDlg;                       \
    ScopedVclPtr<DialogClass> pDlg;                 \
public:                                             \
                    Class( DialogClass* p)          \
                     : pDlg(p)                      \
@@ -66,8 +66,8 @@ public:                                             \
    virtual         ~Class();                       \
    virtual short   Execute() SAL_OVERRIDE ;

#define DECL_ABSTDLG2_BASE(Class,DialogClass)        \
    VclPtr<DialogClass> pDlg;                       \
#define DECL_ABSTDLG2_BASE(Class,DialogClass)       \
    ScopedVclPtr<DialogClass> pDlg;                 \
public:                                             \
                    Class( DialogClass* p)          \
                     : pDlg(p)                      \
diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx
index 28bf18e..f0aa72a 100644
--- a/sc/source/ui/drawfunc/fupoor.cxx
+++ b/sc/source/ui/drawfunc/fupoor.cxx
@@ -53,6 +53,7 @@ FuPoor::~FuPoor()
{
    aDragTimer.Stop();
    aScrollTimer.Stop();
    pDialog.disposeAndClear();
}

void FuPoor::Activate()
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index b7fe534..3ba9b48 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -23,7 +23,7 @@
#include <sfx2/basedlgs.hxx>

#define DECL_ABSTDLG_BASE(Class,DialogClass)        \
    VclPtr<DialogClass> pDlg;                       \
    ScopedVclPtr<DialogClass> pDlg;                 \
public:                                             \
                    Class( DialogClass* p)          \
                     : pDlg(p)                      \
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index f3d94ef..9d1da08 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -100,7 +100,8 @@ FuPoor::~FuPoor()
{
    aDragTimer.Stop();
    aScrollTimer.Stop();
    aDelayToScrollTimer.Stop ();
    aDelayToScrollTimer.Stop();
    pDialog.disposeAndClear();
}

void FuPoor::Activate()
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index 4d265d7..ccaebb1 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -117,6 +117,7 @@ ThumbnailViewItem::ThumbnailViewItem(ThumbnailView &rView, sal_uInt16 nId)

ThumbnailViewItem::~ThumbnailViewItem()
{
    mpTitleED.disposeAndClear();
    if( mpxAcc )
    {
        static_cast< ThumbnailViewItemAcc* >( mpxAcc->get() )->ParentDestroyed();
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 6a6e4b5..285e618 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -712,6 +712,8 @@ SfxSingleTabDialog::~SfxSingleTabDialog()

void SfxSingleTabDialog::dispose()
{
    pImpl->m_pSfxPage.disposeAndClear();
    pImpl->m_pLine.disposeAndClear();
    delete pImpl;
    pOKBtn.clear();
    pCancelBtn.clear();
diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index 88377b3..2b1177a 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -150,8 +150,11 @@ SfxInfoBarWindow::~SfxInfoBarWindow()

void SfxInfoBarWindow::dispose()
{
    m_pMessage.clear();
    m_pCloseBtn.clear();
    for ( auto it = m_aActionBtns.begin( ); it != m_aActionBtns.end( ); ++it )
        it->disposeAndClear();

    m_pMessage.disposeAndClear();
    m_pCloseBtn.disposeAndClear();
    m_aActionBtns.clear( );
    vcl::Window::dispose();
}
@@ -247,6 +250,8 @@ SfxInfoBarContainerWindow::~SfxInfoBarContainerWindow()

void SfxInfoBarContainerWindow::dispose()
{
    for ( auto it = m_pInfoBars.begin( ); it != m_pInfoBars.end( ); ++it )
        it->disposeAndClear();
    m_pInfoBars.clear( );
    Window::dispose();
}
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index b1c8bf0..cbe8217 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -765,6 +765,7 @@ SfxCommonTemplateDialog_Impl::~SfxCommonTemplateDialog_Impl()
    if ( pStyleSheetPool )
        EndListening(*pStyleSheetPool);
    pStyleSheetPool = NULL;
    pTreeBox.disposeAndClear();
    delete pIdle;
    if ( m_pDeletionWatcher )
        m_pDeletionWatcher->signal();
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 2df93f1..9ff0df6 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -328,13 +328,13 @@ IMPL_LINK_NOARG(TabBarEdit, ImplEndTimerHdl)

struct TabBar_Impl
{
    VclPtr<ImplTabSizer>  mpSizer;
    VclPtr<ImplTabButton> mpFirstButton;
    VclPtr<ImplTabButton> mpPrevButton;
    VclPtr<ImplTabButton> mpNextButton;
    VclPtr<ImplTabButton> mpLastButton;
    VclPtr<TabBarEdit>    mpEdit;
    ImplTabBarList        mpItemList;
    ScopedVclPtr<ImplTabSizer>  mpSizer;
    ScopedVclPtr<ImplTabButton> mpFirstButton;
    ScopedVclPtr<ImplTabButton> mpPrevButton;
    ScopedVclPtr<ImplTabButton> mpNextButton;
    ScopedVclPtr<ImplTabButton> mpLastButton;
    ScopedVclPtr<TabBarEdit>    mpEdit;
    ImplTabBarList              mpItemList;

    svt::AccessibleFactoryAccess  maAccessibleFactory;

@@ -347,22 +347,12 @@ struct TabBar_Impl
            delete mpItemList[i];
        }
        mpItemList.clear();

        mpPrevBtn.disposeAndClear();
        mpNextBtn.disposeAndClear();
        mpFirstBtn.disposeAndClear();
        mpLastBtn.disposeAndClear();
        mpEdit.disposeAndClear();
    }

    sal_uInt16 getItemSize()
    {
        return static_cast<sal_uInt16>(mpItemList.size());
    }
    ~TabBar_Impl()
    {
        mpSizer.disposeAndClear();
    }
};

TabBar::TabBar( vcl::Window* pParent, WinBits nWinStyle ) :
diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx
index 411c9b0..87c63f0 100644
--- a/svtools/source/dialogs/roadmapwizard.cxx
+++ b/svtools/source/dialogs/roadmapwizard.cxx
@@ -55,7 +55,7 @@ namespace svt

    struct RoadmapWizardImpl : public RoadmapWizardTypes
    {
        VclPtr<ORoadmap>    pRoadmap;
        ScopedVclPtr<ORoadmap> pRoadmap;
        Paths               aPaths;
        PathId              nActivePath;
        StateDescriptions   aStateDescriptors;
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 66984db..403fa39 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -643,8 +643,10 @@ DbCellControl::~DbCellControl()
{
    lcl_clearBroadCaster(m_pModelChangeBroadcaster);
    lcl_clearBroadCaster(m_pFieldChangeBroadcaster);
}

    m_pWindow.disposeAndClear();
    m_pPainter.disposeAndClear();
}

void DbCellControl::implValuePropertyChanged( )
{
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 349da44..3460eca 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1436,6 +1436,9 @@ namespace svxform
        m_pSubmissionPage.clear();
        m_pBindingPage.clear();

        sal_Int32 i, nCount = m_aPageList.size();
        for ( i = 0; i < nCount; ++i )
            m_aPageList[i].disposeAndClear();
        m_aPageList.clear();

        Reference< XFrameActionListener > xListener(
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 16cd697..5f7a6fd 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -119,7 +119,11 @@ SwAddressControl_Impl::~SwAddressControl_Impl()

void SwAddressControl_Impl::dispose()
{
    for(auto aTextIter = m_aFixedTexts.begin(); aTextIter != m_aFixedTexts.end(); ++aTextIter)
        aTextIter->disposeAndClear();
    m_aFixedTexts.clear();
    for(auto aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter)
        aEditIter->disposeAndClear();
    m_aEdits.clear();
    m_pScrollBar.clear();
    m_pWindow.clear();
@@ -132,7 +136,11 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
    //when the address data is updated then remove the controls an build again
    if(m_aFixedTexts.size())
    {
        for(auto aTextIter = m_aFixedTexts.begin(); aTextIter != m_aFixedTexts.end(); ++aTextIter)
            aTextIter->disposeAndClear();
        m_aFixedTexts.clear();
        for(auto aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter)
            aEditIter->disposeAndClear();
        m_aEdits.clear();
        m_bNoDataSet = true;
    }
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 538163d..42b9e331 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -989,6 +989,13 @@ SwAssignFieldsControl::~SwAssignFieldsControl()

void SwAssignFieldsControl::dispose()
{
    for(auto aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter)
        aFIIter->disposeAndClear();
    for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter)
        aLBIter->disposeAndClear();
    for(auto aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter)
        aFIIter->disposeAndClear();

    m_aFieldNames.clear();
    m_aMatches.clear();
    m_aPreviews.clear();
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index a65a7cb..68fa68a 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -595,6 +595,7 @@ void AbstractSwWordCountFloatDlg_Impl::SetCounts(const SwDocStat &rCurrCnt, cons

AbstractMailMergeWizard_Impl::~AbstractMailMergeWizard_Impl()
{
    pDlg.disposeAndClear();
}

void AbstractMailMergeWizard_Impl::StartExecuteModal( const Link& rEndDialogHdl )
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index ea38f71..4ec9fa6 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -48,7 +48,7 @@ class DropDownFieldDialog;

#define DECL_ABSTDLG_BASE(Class,DialogClass)        \
protected:                                          \
    VclPtr<DialogClass> pDlg;                       \
    ScopedVclPtr<DialogClass> pDlg;                 \
public:                                             \
                    Class( DialogClass* p)          \
                     : pDlg(p)                      \
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index e0fd483..e65a904 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -2789,6 +2789,8 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)

    if(pForm)
    {
        for (ctrl_iterator iter = aControlList.begin(); iter != aControlList.end(); ++iter)
            iter->disposeAndClear();
        //apply current level settings to the form
        for (auto it = aControlList.begin(); it != aControlList.end(); ++it)
             it->disposeAndClear();
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index b16c1c6..6f2404a 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -193,6 +193,7 @@ void SwPostItMgr::CheckForRemovedPostIts()
            mvPostItFlds.remove(*it);
            if (GetActiveSidebarWin() == p->pPostIt)
                SetActiveSidebarWin(0);
            p->pPostIt.disposeAndClear();
            delete p;
            bRemoved = true;
        }
@@ -241,6 +242,7 @@ void SwPostItMgr::RemoveItem( SfxBroadcaster* pBroadcast )
            SwSidebarItem* p = (*i);
            if (GetActiveSidebarWin() == p->pPostIt)
                SetActiveSidebarWin(0);
            p->pPostIt.disposeAndClear();
            mvPostItFlds.erase(i);
            delete p;
            break;
@@ -1174,6 +1176,7 @@ void SwPostItMgr::RemoveSidebarWin()
        for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i != mvPostItFlds.end() ; ++i)
        {
            EndListening( *(const_cast<SfxBroadcaster*>((*i)->GetBroadCaster())) );
            (*i)->pPostIt.disposeAndClear();
            delete (*i);
        }
        mvPostItFlds.clear();
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 9e2f997..ad29cdc 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1238,6 +1238,12 @@ SwPagePreview::~SwPagePreview()
    SwViewShell* pVShell =  pViewWin->GetViewShell();
    pVShell->SetWin(0);
    delete pVShell;

    pViewWin.disposeAndClear();

    pScrollFill.disposeAndClear();
    pHScrollbar.disposeAndClear();
    pVScrollbar.disposeAndClear();
}

SwDocShell* SwPagePreview::GetDocShell()
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index f5161a7..fb057fc 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -895,6 +895,7 @@ IMPL_LINK_NOARG(SwNavigationPI, PopupModeEndHdl)
    {
        // Replace floating window with popup window and destroy
        // floating window instance.
        pFloatingWindow.disposeAndClear();
        pFloatingWindow = pPopupWindow;
        pPopupWindow    = 0;
    }
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 961dd91..90184ec 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -204,6 +204,8 @@ void TabControl::dispose()
    ImplFreeLayoutData();

    // delete TabCtrl data
    if (mpTabCtrlData)
        mpTabCtrlData->mpListBox.disposeAndClear();
    delete mpTabCtrlData;
    mpTabCtrlData = NULL;
    Control::dispose();
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 4322248f..6371297 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -184,6 +184,7 @@ void ImpVclMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle )
    bool bScrollbarsChanged = false;
    if ( bHaveVScroll != bNeedVScroll )
    {
        mpVScrollBar.disposeAndClear();
        mpVScrollBar = bNeedVScroll ? new ScrollBar( pVclMultiLineEdit, WB_VSCROLL|WB_DRAG ) : NULL;

        if ( bNeedVScroll )
@@ -197,6 +198,7 @@ void ImpVclMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle )

    if ( bHaveHScroll != bNeedHScroll )
    {
        mpHScrollBar.disposeAndClear();
        mpHScrollBar = bNeedHScroll ? new ScrollBar( pVclMultiLineEdit, WB_HSCROLL|WB_DRAG ) : NULL;

        if ( bNeedHScroll )
@@ -210,6 +212,7 @@ void ImpVclMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle )

    if ( bHaveScrollBox != bNeedScrollBox )
    {
        mpScrollBox.disposeAndClear();
        mpScrollBox = bNeedScrollBox ? new ScrollBarBox( pVclMultiLineEdit, WB_SIZEABLE ) : NULL;

        if ( bNeedScrollBox )
@@ -255,10 +258,10 @@ void ImpVclMEdit::InitFromStyle( WinBits nWinStyle )
ImpVclMEdit::~ImpVclMEdit()
{
    EndListening( *mpTextWindow->GetTextEngine() );
    mpScrollBox.disposeAndClear();
    mpVScrollBar.disposeAndClear();
    mpHScrollBar.disposeAndClear();
    mpTextWindow.disposeAndClear();
    mpHScrollBar.disposeAndClear();
    mpVScrollBar.disposeAndClear();
    mpScrollBox.disposeAndClear();
    pVclMultiLineEdit.disposeAndClear();
}

diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 8216e6e..b5e7845 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -191,6 +191,7 @@ public:
        mnDefaultPaperBin( -1 ),
        mnFixedPaperBin( -1 )
    {}
    ~ImplPrinterControllerData() { mpProgress.disposeAndClear(); }

    Size getRealPaperSize( const Size& i_rPageSize, bool bNoNUP ) const
    {
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index 37a4b3a..b0552ff 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -64,6 +64,11 @@ ButtonDialog::~ButtonDialog()

void ButtonDialog::dispose()
{
    for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
    {
        if ( it->mbOwnButton )
            it->mpPushButton.disposeAndClear();
    }
    maItemList.clear();
    Dialog::dispose();
}
@@ -343,6 +348,7 @@ void ButtonDialog::Clear()
    for (btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
    {
        it->mpPushButton->Hide();
        it->mpPushButton.disposeAndClear();
    }

    maItemList.clear();
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 92595d0..7a4bd3d 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -3286,6 +3286,7 @@ void VclBuilder::delete_by_name(const OString& sID)
    {
        if (aI->m_sID.equals(sID))
        {
            aI->m_pWindow.disposeAndClear();
            m_aChildren.erase(aI);
            break;
        }
diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx
index 2101713..13cfdb1 100644
--- a/vcl/unx/generic/app/i18n_status.cxx
+++ b/vcl/unx/generic/app/i18n_status.cxx
@@ -523,6 +523,7 @@ I18NStatus::I18NStatus() :

I18NStatus::~I18NStatus()
{
    m_pStatusWindow.disposeAndClear();
    if( pInstance == this )
        pInstance = NULL;
}