diff options
Diffstat (limited to 'sw')
221 files changed, 3889 insertions, 1730 deletions
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index f880d609b34a..c74fc3ba5fba 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -32,6 +32,7 @@ #include <com/sun/star/uno/Any.hxx> #include <SidebarWindowsTypes.hxx> #include <svl/lstner.hxx> +#include <vcl/vclptr.hxx> class OutputDevice; class SwWrtShell; @@ -139,12 +140,12 @@ class SwPostItMgr: public SfxListener private: SwView* mpView; SwWrtShell* mpWrtShell; - SwEditWin* mpEditWin; + VclPtr<SwEditWin> mpEditWin; std::list< SwSidebarItem*> mvPostItFlds; std::vector<SwPostItPageItem*> mPages; ImplSVEvent * mnEventId; bool mbWaitingForCalcRects; - sw::sidebarwindows::SwSidebarWin* mpActivePostIt; + VclPtr<sw::sidebarwindows::SwSidebarWin> mpActivePostIt; bool mbLayout; long mbLayoutHeight; bool mbLayouting; diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx index 5d3dcda36137..34957135b6b6 100644 --- a/sw/inc/SidebarWin.hxx +++ b/sw/inc/SidebarWin.hxx @@ -211,11 +211,11 @@ class SwSidebarWin : public vcl::Window OutlinerView* mpOutlinerView; Outliner* mpOutliner; - sw::sidebarwindows::SidebarTxtControl* mpSidebarTxtControl; - ScrollBar* mpVScrollbar; - Edit* mpMetadataAuthor; - Edit* mpMetadataDate; - MenuButton* mpMenuButton; + VclPtr<sw::sidebarwindows::SidebarTxtControl> mpSidebarTxtControl; + VclPtr<ScrollBar> mpVScrollbar; + VclPtr<Edit> mpMetadataAuthor; + VclPtr<Edit> mpMetadataDate; + VclPtr<MenuButton> mpMenuButton; sw::sidebarwindows::AnchorOverlayObject* mpAnchor; sw::sidebarwindows::ShadowOverlayObject* mpShadow; diff --git a/sw/inc/colwd.hxx b/sw/inc/colwd.hxx index 448e07efaca6..1e466c477f4f 100644 --- a/sw/inc/colwd.hxx +++ b/sw/inc/colwd.hxx @@ -28,8 +28,8 @@ class SwTableFUNC; class SwTableWidthDlg : public SvxStandardDialog { - NumericField* m_pColNF; - MetricField* m_pWidthMF; + VclPtr<NumericField> m_pColNF; + VclPtr<MetricField> m_pWidthMF; SwTableFUNC &rFnc; protected: @@ -38,6 +38,8 @@ protected: public: SwTableWidthDlg(vcl::Window *pParent, SwTableFUNC &rFnc ); + virtual ~SwTableWidthDlg(); + virtual void dispose() SAL_OVERRIDE; }; #endif diff --git a/sw/inc/hhcwrp.hxx b/sw/inc/hhcwrp.hxx index 138c72c25427..43c1e326f53c 100644 --- a/sw/inc/hhcwrp.hxx +++ b/sw/inc/hhcwrp.hxx @@ -30,7 +30,7 @@ class SwPaM; class SW_DLLPUBLIC SwHHCWrapper : public editeng::HangulHanjaConversion { SwView * m_pView; - vcl::Window* m_pWin; + VclPtr<vcl::Window> m_pWin; SwWrtShell &m_rWrtShell; SwConversionArgs *m_pConvArgs; /**< object for arguments (and results) needed diff --git a/sw/inc/postithelper.hxx b/sw/inc/postithelper.hxx index 80b26ac520e6..cf1f7c069c02 100644 --- a/sw/inc/postithelper.hxx +++ b/sw/inc/postithelper.hxx @@ -89,7 +89,7 @@ namespace SwPostItHelper class SwSidebarItem { public: - sw::sidebarwindows::SwSidebarWin* pPostIt; + VclPtr<sw::sidebarwindows::SwSidebarWin> pPostIt; bool bShow; bool bFocus; diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 01b308311287..7ad04e5c948b 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -128,7 +128,7 @@ class SW_DLLPUBLIC SwViewShell : public sw::Ring<SwViewShell> SwViewShellImp *mpImp; // Core-internals of SwViewShell. // The pointer is never 0. - ::vcl::Window *mpWin; ///< = 0 during printing or pdf export + VclPtr<::vcl::Window> mpWin; ///< = 0 during printing or pdf export OutputDevice *mpOut; ///< Window, Printer, VirtDev, ... OutputDevice* mpTmpRef; // Temporariy reference device. Is used // during (printer depending) prospect diff --git a/sw/qa/tiledrendering/tiledrendering.cxx b/sw/qa/tiledrendering/tiledrendering.cxx index f3c245db2d0e..00a4b1f8296c 100644 --- a/sw/qa/tiledrendering/tiledrendering.cxx +++ b/sw/qa/tiledrendering/tiledrendering.cxx @@ -58,24 +58,24 @@ class TiledRenderingDialog: public ModalDialog { private: TiledRenderingApp *mpApp; - NumericField *mpContextWidth; - NumericField *mpContextHeight; - NumericField *mpTilePosX; - NumericField *mpTilePosY; - NumericField *mpTileWidth; - NumericField *mpTileHeight; - FixedImage *mpImage; + VclPtr<NumericField> mpContextWidth; + VclPtr<NumericField> mpContextHeight; + VclPtr<NumericField> mpTilePosX; + VclPtr<NumericField> mpTilePosY; + VclPtr<NumericField> mpTileWidth; + VclPtr<NumericField> mpTileHeight; + VclPtr<FixedImage> mpImage; public: TiledRenderingDialog(TiledRenderingApp * app) : ModalDialog(DIALOG_NO_PARENT, "TiledRendering", "qa/sw/ui/tiledrendering.ui"), mpApp(app) { - PushButton * renderButton; + VclPtr<PushButton> renderButton; get(renderButton, "buttonRenderTile"); renderButton->SetClickHdl( LINK( this, TiledRenderingDialog, RenderHdl)); - PushButton * chooseDocumentButton; + VclPtr<PushButton> chooseDocumentButton; get(chooseDocumentButton, "buttonChooseDocument"); chooseDocumentButton->SetClickHdl( LINK( this, TiledRenderingDialog, ChooseDocumentHdl)); @@ -92,6 +92,19 @@ public: virtual ~TiledRenderingDialog() { + dispose(); + } + + virtual void dispose() SAL_OVERRIDE + { + mpContextWidth.clear(); + mpContextHeight.clear(); + mpTilePosX.clear(); + mpTilePosY.clear(); + mpTileWidth.clear(); + mpTileHeight.clear(); + mpImage.clear(); + ModalDialog::dispose(); } DECL_LINK ( RenderHdl, Button * ); diff --git a/sw/source/core/access/accdoc.hxx b/sw/source/core/access/accdoc.hxx index 7f630af8355e..1ed2be42e750 100644 --- a/sw/source/core/access/accdoc.hxx +++ b/sw/source/core/access/accdoc.hxx @@ -36,7 +36,7 @@ class SwAccessibleDocumentBase : public SwAccessibleContext ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> mxParent; - vcl::Window* mpChildWin; // protected by solar mutext + VclPtr<vcl::Window> mpChildWin; // protected by solar mutext using SwAccessibleFrame::SetVisArea; diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx index 0953d7f9b04d..b3409938dfdf 100644 --- a/sw/source/core/access/accfrmobj.cxx +++ b/sw/source/core/access/accfrmobj.cxx @@ -213,7 +213,7 @@ bool SwAccessibleChild::IsValid() const { return mpFrm != 0 || mpDrawObj != 0 || - mpWindow != 0; + mpWindow != nullptr; } bool SwAccessibleChild::IsVisibleChildrenOnly() const diff --git a/sw/source/core/access/accfrmobj.hxx b/sw/source/core/access/accfrmobj.hxx index bfd188f79ad1..31a489e43640 100644 --- a/sw/source/core/access/accfrmobj.hxx +++ b/sw/source/core/access/accfrmobj.hxx @@ -20,6 +20,7 @@ #ifndef INCLUDED_SW_SOURCE_CORE_ACCESS_ACCFRMOBJ_HXX #define INCLUDED_SW_SOURCE_CORE_ACCESS_ACCFRMOBJ_HXX +#include <vcl/vclptr.hxx> class SwAccessibleMap; class SwFrm; @@ -71,7 +72,7 @@ class SwAccessibleChild private: const SwFrm* mpFrm; const SdrObject* mpDrawObj; - vcl::Window* mpWindow; + VclPtr<vcl::Window> mpWindow; void Init( const SdrObject* pDrawObj ); void Init( const SwFrm* pFrm ); diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 7af4b3bb2850..0d2893c16057 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2262,7 +2262,7 @@ SwViewShell::CreateAccessiblePreview() void SwViewShell::InvalidateAccessibleFocus() { - if( this && Imp() && Imp()->IsAccessible() ) + if( Imp() && Imp()->IsAccessible() ) Imp()->GetAccessibleMap().InvalidateFocus(); } diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx index a7616885ad21..9db5c7da2d0d 100644 --- a/sw/source/ui/chrdlg/break.cxx +++ b/sw/source/ui/chrdlg/break.cxx @@ -173,6 +173,23 @@ SwBreakDlg::SwBreakDlg( vcl::Window *pParent, SwWrtShell &rS ) m_pPageNumEdit->SetText(OUString()); } +SwBreakDlg::~SwBreakDlg() +{ + dispose(); +} + +void SwBreakDlg::dispose() +{ + m_pLineBtn.clear(); + m_pColumnBtn.clear(); + m_pPageBtn.clear(); + m_pPageCollText.clear(); + m_pPageCollBox.clear(); + m_pPageNumBox.clear(); + m_pPageNumEdit.clear(); + SvxStandardDialog::dispose(); +} + void SwBreakDlg::CheckEnable() { bool bEnable = true; @@ -206,8 +223,4 @@ void SwBreakDlg::CheckEnable() m_pPageNumEdit->Enable(bEnable); } -SwBreakDlg::~SwBreakDlg() -{ -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index 688ea18dd6ab..e19be029b52c 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -191,6 +191,16 @@ SwCharURLPage::~SwCharURLPage() void SwCharURLPage::dispose() { delete pINetItem; + m_pURLED.clear(); + m_pTextFT.clear(); + m_pTextED.clear(); + m_pNameED.clear(); + m_pTargetFrmLB.clear(); + m_pURLPB.clear(); + m_pEventPB.clear(); + m_pVisitedLB.clear(); + m_pNotVisitedLB.clear(); + m_pCharStyleContainer.clear(); SfxTabPage::dispose(); } diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index d06e0d662629..6390f463db6e 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -62,7 +62,7 @@ const sal_uInt16 SwDropCapsPage::aPageRg[] = { class SwDropCapsPict : public Control { - SwDropCapsPage* mpPage; + VclPtr<SwDropCapsPage> mpPage; OUString maText; OUString maScriptText; Color maBackColor; @@ -210,6 +210,7 @@ void SwDropCapsPict::dispose() { if( mbDelPrinter ) delete mpPrinter; + mpPage.clear(); Control::dispose(); } @@ -575,6 +576,25 @@ SwDropCapsPage::SwDropCapsPage(vcl::Window *pParent, const SfxItemSet &rSet) SwDropCapsPage::~SwDropCapsPage() { + dispose(); +} + +void SwDropCapsPage::dispose() +{ + m_pDropCapsBox.clear(); + m_pWholeWordCB.clear(); + m_pSwitchText.clear(); + m_pDropCapsField.clear(); + m_pLinesText.clear(); + m_pLinesField.clear(); + m_pDistanceText.clear(); + m_pDistanceField.clear(); + m_pTextText.clear(); + m_pTextEdit.clear(); + m_pTemplateText.clear(); + m_pTemplateBox.clear(); + m_pPict.clear(); + SfxTabPage::dispose(); } int SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet) diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index 29429aa16da0..04e923cc4d2d 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -101,6 +101,26 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(vcl::Window* pParent, const SfxItem SwParagraphNumTabPage::~SwParagraphNumTabPage() { + dispose(); +} + +void SwParagraphNumTabPage::dispose() +{ + m_pOutlineStartBX.clear(); + m_pOutlineLvLB.clear(); + m_pNumberStyleBX.clear(); + m_pNumberStyleLB.clear(); + m_pEditNumStyleBtn.clear(); + m_pNewStartCB.clear(); + m_pNewStartBX.clear(); + m_pNewStartNumberCB.clear(); + m_pNewStartNF.clear(); + m_pCountParaFram.clear(); + m_pCountParaCB.clear(); + m_pRestartParaCountCB.clear(); + m_pRestartBX.clear(); + m_pRestartNF.clear(); + SfxTabPage::dispose(); } SfxTabPage* SwParagraphNumTabPage::Create( vcl::Window* pParent, diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index bc1346861bcf..f279d5493897 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -132,6 +132,16 @@ void SwCondCollPage::dispose() for(sal_Int32 i = 0; i < m_pFilterLB->GetEntryCount(); ++i) delete static_cast<sal_uInt16*>(m_pFilterLB->GetEntryData(i)); + m_pConditionCB.clear(); + m_pContextFT.clear(); + m_pUsedFT.clear(); + m_pTbLinks.clear(); + m_pStyleFT.clear(); + m_pStyleLB.clear(); + m_pFilterLB.clear(); + m_pRemovePB.clear(); + m_pAssignPB.clear(); + SfxTabPage::dispose(); } diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx index 4b006c0a1381..c902ed7acc02 100644 --- a/sw/source/ui/config/mailconfigpage.cxx +++ b/sw/source/ui/config/mailconfigpage.cxx @@ -45,16 +45,16 @@ using namespace ::com::sun::star::beans; class SwTestAccountSettingsDialog : public SfxModalDialog { - VclMultiLineEdit* m_pErrorsED; + VclPtr<VclMultiLineEdit> m_pErrorsED; - PushButton* m_pStopPB; + VclPtr<PushButton> m_pStopPB; - FixedText* m_pEstablish; - FixedText* m_pFind; - FixedText* m_pResult1; - FixedText* m_pResult2; - FixedImage* m_pImage1; - FixedImage* m_pImage2; + VclPtr<FixedText> m_pEstablish; + VclPtr<FixedText> m_pFind; + VclPtr<FixedText> m_pResult1; + VclPtr<FixedText> m_pResult2; + VclPtr<FixedImage> m_pImage1; + VclPtr<FixedImage> m_pImage2; Image m_aCompletedImg; Image m_aFailedImg; @@ -62,7 +62,7 @@ class SwTestAccountSettingsDialog : public SfxModalDialog OUString m_sFailed; OUString m_sErrorServer; - SwMailConfigPage* m_pParent; + VclPtr<SwMailConfigPage> m_pParent; bool m_bStop; @@ -71,35 +71,37 @@ class SwTestAccountSettingsDialog : public SfxModalDialog DECL_STATIC_LINK(SwTestAccountSettingsDialog, TestHdl, void*); public: SwTestAccountSettingsDialog(SwMailConfigPage* pParent); + virtual ~SwTestAccountSettingsDialog(); + virtual void dispose() SAL_OVERRIDE; }; class SwAuthenticationSettingsDialog : public SfxModalDialog { - CheckBox* m_pAuthenticationCB; - - RadioButton* m_pSeparateAuthenticationRB; - RadioButton* m_pSMTPAfterPOPRB; - - FixedText* m_pOutgoingServerFT; - FixedText* m_pUserNameFT; - Edit* m_pUserNameED; - FixedText* m_pOutPasswordFT; - Edit* m_pOutPasswordED; - - FixedText* m_pIncomingServerFT; - FixedText* m_pServerFT; - Edit* m_pServerED; - FixedText* m_pPortFT; - NumericField* m_pPortNF; - FixedText* m_pProtocolFT; - RadioButton* m_pPOP3RB; - RadioButton* m_pIMAPRB; - FixedText* m_pInUsernameFT; - Edit* m_pInUsernameED; - FixedText* m_pInPasswordFT; - Edit* m_pInPasswordED; - - OKButton* m_pOKPB; + VclPtr<CheckBox> m_pAuthenticationCB; + + VclPtr<RadioButton> m_pSeparateAuthenticationRB; + VclPtr<RadioButton> m_pSMTPAfterPOPRB; + + VclPtr<FixedText> m_pOutgoingServerFT; + VclPtr<FixedText> m_pUserNameFT; + VclPtr<Edit> m_pUserNameED; + VclPtr<FixedText> m_pOutPasswordFT; + VclPtr<Edit> m_pOutPasswordED; + + VclPtr<FixedText> m_pIncomingServerFT; + VclPtr<FixedText> m_pServerFT; + VclPtr<Edit> m_pServerED; + VclPtr<FixedText> m_pPortFT; + VclPtr<NumericField> m_pPortNF; + VclPtr<FixedText> m_pProtocolFT; + VclPtr<RadioButton> m_pPOP3RB; + VclPtr<RadioButton> m_pIMAPRB; + VclPtr<FixedText> m_pInUsernameFT; + VclPtr<Edit> m_pInUsernameED; + VclPtr<FixedText> m_pInPasswordFT; + VclPtr<Edit> m_pInPasswordED; + + VclPtr<OKButton> m_pOKPB; SwMailMergeConfigItem& rConfigItem; @@ -110,6 +112,7 @@ class SwAuthenticationSettingsDialog : public SfxModalDialog public: SwAuthenticationSettingsDialog(SwMailConfigPage* pParent, SwMailMergeConfigItem& rItem); virtual ~SwAuthenticationSettingsDialog(); + virtual void dispose() SAL_OVERRIDE; }; SwMailConfigPage::SwMailConfigPage( vcl::Window* pParent, const SfxItemSet& rSet ) : @@ -141,6 +144,16 @@ SwMailConfigPage::~SwMailConfigPage() void SwMailConfigPage::dispose() { delete m_pConfigItem; + m_pDisplayNameED.clear(); + m_pAddressED.clear(); + m_pReplyToCB.clear(); + m_pReplyToFT.clear(); + m_pReplyToED.clear(); + m_pServerED.clear(); + m_pPortNF.clear(); + m_pSecureCB.clear(); + m_pServerAuthenticationPB.clear(); + m_pTestPB.clear(); SfxTabPage::dispose(); } @@ -244,6 +257,25 @@ SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pPare Application::PostUserEvent( STATIC_LINK( this, SwTestAccountSettingsDialog, TestHdl ), this ); } +SwTestAccountSettingsDialog::~SwTestAccountSettingsDialog() +{ + dispose(); +} + +void SwTestAccountSettingsDialog::dispose() +{ + m_pErrorsED.clear(); + m_pStopPB.clear(); + m_pEstablish.clear(); + m_pFind.clear(); + m_pResult1.clear(); + m_pResult2.clear(); + m_pImage1.clear(); + m_pImage2.clear(); + m_pParent.clear(); + SfxModalDialog::dispose(); +} + IMPL_LINK_NOARG(SwTestAccountSettingsDialog, StopHdl) { m_bStop = true; @@ -420,6 +452,33 @@ SwAuthenticationSettingsDialog::SwAuthenticationSettingsDialog( SwAuthenticationSettingsDialog::~SwAuthenticationSettingsDialog() { + dispose(); +} + +void SwAuthenticationSettingsDialog::dispose() +{ + m_pAuthenticationCB.clear(); + m_pSeparateAuthenticationRB.clear(); + m_pSMTPAfterPOPRB.clear(); + m_pOutgoingServerFT.clear(); + m_pUserNameFT.clear(); + m_pUserNameED.clear(); + m_pOutPasswordFT.clear(); + m_pOutPasswordED.clear(); + m_pIncomingServerFT.clear(); + m_pServerFT.clear(); + m_pServerED.clear(); + m_pPortFT.clear(); + m_pPortNF.clear(); + m_pProtocolFT.clear(); + m_pPOP3RB.clear(); + m_pIMAPRB.clear(); + m_pInUsernameFT.clear(); + m_pInUsernameED.clear(); + m_pInPasswordFT.clear(); + m_pInPasswordED.clear(); + m_pOKPB.clear(); + SfxModalDialog::dispose(); } IMPL_LINK_NOARG(SwAuthenticationSettingsDialog, OKHdl_Impl) diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index a0deaa471e9a..b90215015468 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -134,6 +134,10 @@ SwCompatibilityOptPage::~SwCompatibilityOptPage() void SwCompatibilityOptPage::dispose() { delete m_pImpl; + m_pMain.clear(); + m_pFormattingLB.clear(); + m_pOptionsLB.clear(); + m_pDefaultPB.clear(); SfxTabPage::dispose(); } diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 643e6437dd78..d0c8d8a67707 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -125,6 +125,30 @@ SwLoadOptPage::SwLoadOptPage(vcl::Window* pParent, const SfxItemSet& rSet) m_pShowStandardizedPageCount->SetClickHdl(aLink); } +SwLoadOptPage::~SwLoadOptPage() +{ + dispose(); +} + +void SwLoadOptPage::dispose() +{ + m_pAlwaysRB.clear(); + m_pRequestRB.clear(); + m_pNeverRB.clear(); + m_pAutoUpdateFields.clear(); + m_pAutoUpdateCharts.clear(); + m_pMetricLB.clear(); + m_pTabFT.clear(); + m_pTabMF.clear(); + m_pUseSquaredPageMode.clear(); + m_pUseCharUnit.clear(); + m_pWordCountED.clear(); + m_pShowStandardizedPageCount.clear(); + m_pStandardizedPageSizeNF.clear(); + SfxTabPage::dispose(); +} + + SfxTabPage* SwLoadOptPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ) { @@ -524,6 +548,24 @@ void SwCaptionOptPage::dispose() { DelUserData(); delete pMgr; + m_pCheckLB.clear(); + m_pLbCaptionOrder.clear(); + m_pPreview.clear(); + m_pSettingsGroup.clear(); + m_pCategoryBox.clear(); + m_pFormatText.clear(); + m_pFormatBox.clear(); + m_pNumberingSeparatorFT.clear(); + m_pNumberingSeparatorED.clear(); + m_pTextText.clear(); + m_pTextEdit.clear(); + m_pPosBox.clear(); + m_pNumCapt.clear(); + m_pLbLevel.clear(); + m_pEdDelim.clear(); + m_pCategory.clear(); + m_pCharStyleLB.clear(); + m_pApplyBorderCB.clear(); SfxTabPage::dispose(); } diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 5d7bafc7a834..5acc585686cf 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -156,8 +156,34 @@ SwContentOptPage::SwContentOptPage( vcl::Window* pParent, SwContentOptPage::~SwContentOptPage() { + dispose(); } +void SwContentOptPage::dispose() +{ + m_pCrossCB.clear(); + m_pHScrollBox.clear(); + m_pVScrollBox.clear(); + m_pAnyRulerCB.clear(); + m_pHRulerCBox.clear(); + m_pHMetric.clear(); + m_pVRulerCBox.clear(); + m_pVRulerRightCBox.clear(); + m_pVMetric.clear(); + m_pSmoothCBox.clear(); + m_pGrfCB.clear(); + m_pTblCB.clear(); + m_pDrwCB.clear(); + m_pFldNameCB.clear(); + m_pPostItCB.clear(); + m_pSettingsFrame.clear(); + m_pSettingsLabel.clear(); + m_pMetricLabel.clear(); + m_pMetricLB.clear(); + SfxTabPage::dispose(); +} + + SfxTabPage* SwContentOptPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet) { @@ -352,6 +378,36 @@ SwAddPrinterTabPage::SwAddPrinterTabPage(vcl::Window* pParent, m_pProspectCB_RTL->Show(aCTLOptions.IsCTLFontEnabled()); } +SwAddPrinterTabPage::~SwAddPrinterTabPage() +{ + dispose(); +} + +void SwAddPrinterTabPage::dispose() +{ + m_pGrfCB.clear(); + m_pCtrlFldCB.clear(); + m_pBackgroundCB.clear(); + m_pBlackFontCB.clear(); + m_pPrintHiddenTextCB.clear(); + m_pPrintTextPlaceholderCB.clear(); + m_pPagesFrame.clear(); + m_pLeftPageCB.clear(); + m_pRightPageCB.clear(); + m_pProspectCB.clear(); + m_pProspectCB_RTL.clear(); + m_pCommentsFrame.clear(); + m_pNoRB.clear(); + m_pOnlyRB.clear(); + m_pEndRB.clear(); + m_pEndPageRB.clear(); + m_pInMarginsRB.clear(); + m_pPrintEmptyPagesCB.clear(); + m_pPaperFromSetupCB.clear(); + m_pFaxLB.clear(); + SfxTabPage::dispose(); +} + void SwAddPrinterTabPage::SetPreview(bool bPrev) { bPreview = bPrev; @@ -583,6 +639,19 @@ void SwStdFontTabPage::dispose() { delete pPrt; } + pLabelFT.clear(); + pStandardBox.clear(); + pStandardHeightLB.clear(); + pTitleBox.clear(); + pTitleHeightLB.clear(); + pListBox.clear(); + pListHeightLB.clear(); + pLabelBox.clear(); + pLabelHeightLB.clear(); + pIdxBox.clear(); + pIndexHeightLB.clear(); + pDocOnlyCB.clear(); + pStandardPB.clear(); SfxTabPage::dispose(); } @@ -1088,6 +1157,26 @@ SwTableOptionsTabPage::SwTableOptionsTabPage( vcl::Window* pParent, const SfxIte SwTableOptionsTabPage::~SwTableOptionsTabPage() { + dispose(); +} + +void SwTableOptionsTabPage::dispose() +{ + pHeaderCB.clear(); + pRepeatHeaderCB.clear(); + pDontSplitCB.clear(); + pBorderCB.clear(); + pNumFormattingCB.clear(); + pNumFmtFormattingCB.clear(); + pNumAlignmentCB.clear(); + pRowMoveMF.clear(); + pColMoveMF.clear(); + pRowInsertMF.clear(); + pColInsertMF.clear(); + pFixRB.clear(); + pFixPropRB.clear(); + pVarRB.clear(); + SfxTabPage::dispose(); } SfxTabPage* SwTableOptionsTabPage::Create( vcl::Window* pParent, @@ -1324,6 +1413,31 @@ SwShdwCrsrOptionsTabPage::SwShdwCrsrOptionsTabPage( vcl::Window* pParent, SwShdwCrsrOptionsTabPage::~SwShdwCrsrOptionsTabPage() { + dispose(); +} + +void SwShdwCrsrOptionsTabPage::dispose() +{ + m_pParaCB.clear(); + m_pSHyphCB.clear(); + m_pSpacesCB.clear(); + m_pHSpacesCB.clear(); + m_pTabCB.clear(); + m_pBreakCB.clear(); + m_pCharHiddenCB.clear(); + m_pFldHiddenCB.clear(); + m_pFldHiddenParaCB.clear(); + m_pDirectCursorFrame.clear(); + m_pOnOffCB.clear(); + m_pFillMarginRB.clear(); + m_pFillIndentRB.clear(); + m_pFillTabRB.clear(); + m_pFillSpaceRB.clear(); + m_pCursorProtFrame.clear(); + m_pCrsrInProtCB.clear(); + m_pIgnoreProtCB.clear(); + m_pMathBaselineAlignmentCB.clear(); + SfxTabPage::dispose(); } SfxTabPage* SwShdwCrsrOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet ) @@ -1737,6 +1851,24 @@ SwRedlineOptionsTabPage::SwRedlineOptionsTabPage( vcl::Window* pParent, SwRedlineOptionsTabPage::~SwRedlineOptionsTabPage() { + dispose(); +} + +void SwRedlineOptionsTabPage::dispose() +{ + pInsertLB.clear(); + pInsertColorLB.clear(); + pInsertedPreviewWN.clear(); + pDeletedLB.clear(); + pDeletedColorLB.clear(); + pDeletedPreviewWN.clear(); + pChangedLB.clear(); + pChangedColorLB.clear(); + pChangedPreviewWN.clear(); + pMarkPosLB.clear(); + pMarkColorLB.clear(); + pMarkPreviewWN.clear(); + SfxTabPage::dispose(); } SfxTabPage* SwRedlineOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet) @@ -2238,6 +2370,19 @@ SwCompareOptionsTabPage::SwCompareOptionsTabPage( vcl::Window* pParent, const S SwCompareOptionsTabPage::~SwCompareOptionsTabPage() { + dispose(); +} + +void SwCompareOptionsTabPage::dispose() +{ + m_pAutoRB.clear(); + m_pWordRB.clear(); + m_pCharRB.clear(); + m_pRsidCB.clear(); + m_pIgnoreCB.clear(); + m_pLenNF.clear(); + m_pStoreRsidCB.clear(); + SfxTabPage::dispose(); } SfxTabPage* SwCompareOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ) @@ -2373,6 +2518,26 @@ SwTestTabPage::SwTestTabPage(vcl::Window* pParent, const SfxItemSet& rCoreSet) } +SwTestTabPage::~SwTestTabPage() +{ + dispose(); +} + +void SwTestTabPage::dispose() +{ + m_pTest1CBox.clear(); + m_pTest2CBox.clear(); + m_pTest3CBox.clear(); + m_pTest4CBox.clear(); + m_pTest5CBox.clear(); + m_pTest6CBox.clear(); + m_pTest7CBox.clear(); + m_pTest8CBox.clear(); + m_pTest9CBox.clear(); + m_pTest10CBox.clear(); + SfxTabPage::dispose(); +} + SfxTabPage* SwTestTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ) { diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 3a469aca6ac6..71d69b25823c 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -277,7 +277,15 @@ void SwAddressListDialog::dispose() delete pUserData; pEntry = m_pListLB->Next( pEntry ); } - delete m_pListLB; + m_pAddressPage.clear(); + m_pListLB.clear(); + m_pDescriptionFI.clear(); + m_pLoadListPB.clear(); + m_pCreateListPB.clear(); + m_pFilterPB.clear(); + m_pEditPB.clear(); + m_pTablePB.clear(); + m_pOK.clear(); SfxModalDialog::dispose(); } diff --git a/sw/source/ui/dbui/addresslistdialog.hxx b/sw/source/ui/dbui/addresslistdialog.hxx index 59d2c4051e3c..708876448579 100644 --- a/sw/source/ui/dbui/addresslistdialog.hxx +++ b/sw/source/ui/dbui/addresslistdialog.hxx @@ -46,17 +46,17 @@ class SwAddrSourceLB; class SwAddressListDialog : public SfxModalDialog { - FixedText* m_pDescriptionFI; + VclPtr<FixedText> m_pDescriptionFI; - SwAddrSourceLB* m_pListLB; + VclPtr<SwAddrSourceLB> m_pListLB; - PushButton* m_pLoadListPB; - PushButton* m_pCreateListPB; - PushButton* m_pFilterPB; - PushButton* m_pEditPB; - PushButton* m_pTablePB; + VclPtr<PushButton> m_pLoadListPB; + VclPtr<PushButton> m_pCreateListPB; + VclPtr<PushButton> m_pFilterPB; + VclPtr<PushButton> m_pEditPB; + VclPtr<PushButton> m_pTablePB; - OKButton* m_pOK; + VclPtr<OKButton> m_pOK; OUString m_sName; OUString m_sTable; @@ -66,7 +66,7 @@ class SwAddressListDialog : public SfxModalDialog bool m_bInSelectHdl; - SwMailMergeAddressBlockPage* m_pAddressPage; + VclPtr<SwMailMergeAddressBlockPage> m_pAddressPage; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext> m_xDBContext; diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 2806672bba9a..d54a313ac875 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -46,11 +46,11 @@ using namespace ::com::sun::star::ui::dialogs; class SwAddressControl_Impl : public Control { - ScrollBar *m_pScrollBar; - Window *m_pWindow; + VclPtr<ScrollBar> m_pScrollBar; + VclPtr<Window> m_pWindow; - ::std::vector<FixedText*> m_aFixedTexts; - ::std::vector<Edit*> m_aEdits; + ::std::vector<VclPtr<FixedText> > m_aFixedTexts; + ::std::vector<VclPtr<Edit> > m_aEdits; SwCSVData* m_pData; Size m_aWinOutputSize; @@ -119,14 +119,10 @@ SwAddressControl_Impl::~SwAddressControl_Impl() void SwAddressControl_Impl::dispose() { - ::std::vector<FixedText*>::iterator aTextIter; - for(aTextIter = m_aFixedTexts.begin(); aTextIter != m_aFixedTexts.end(); ++aTextIter) - delete *aTextIter; - ::std::vector<Edit*>::iterator aEditIter; - for(aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter) - delete *aEditIter; - delete m_pScrollBar; - delete m_pWindow; + m_aFixedTexts.clear(); + m_aEdits.clear(); + m_pScrollBar.clear(); + m_pWindow.clear(); Control::dispose(); } @@ -136,12 +132,6 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData) //when the address data is updated then remove the controls an build again if(m_aFixedTexts.size()) { - ::std::vector<FixedText*>::iterator aTextIter; - for(aTextIter = m_aFixedTexts.begin(); aTextIter != m_aFixedTexts.end(); ++aTextIter) - delete *aTextIter; - ::std::vector<Edit*>::iterator aEditIter; - for(aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter) - delete *aEditIter; m_aFixedTexts.clear(); m_aEdits.clear(); m_bNoDataSet = true; @@ -251,9 +241,8 @@ void SwAddressControl_Impl::SetCurrentDataSet(sal_uInt32 nSet) OSL_ENSURE(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index"); if(m_pData->aDBData.size() > m_nCurrentDataSet) { - ::std::vector<Edit*>::iterator aEditIter; sal_uInt32 nIndex = 0; - for(aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter, ++nIndex) + for(auto aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter, ++nIndex) { OSL_ENSURE(nIndex < m_pData->aDBData[m_nCurrentDataSet].size(), "number of columns doesn't match number of Edits"); @@ -387,8 +376,7 @@ void SwAddressControl_Impl::Resize() { long nNewEditSize = aSize.Width() - (*m_aEdits.begin())->GetPosPixel().X() - nScrollBarWidth - 6; - ::std::vector<Edit*>::iterator aEditIter; - for(aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter) + for(auto aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter) { (*aEditIter)->SetSizePixel(Size(nNewEditSize, (*aEditIter)->GetSizePixel().Height())); } @@ -508,7 +496,18 @@ SwCreateAddressListDialog::~SwCreateAddressListDialog() void SwCreateAddressListDialog::dispose() { delete m_pCSVData; - delete m_pFindDlg; + m_pAddressControl.clear(); + m_pNewPB.clear(); + m_pDeletePB.clear(); + m_pFindPB.clear(); + m_pCustomizePB.clear(); + m_pStartPB.clear(); + m_pPrevPB.clear(); + m_pSetNoNF.clear(); + m_pNextPB.clear(); + m_pEndPB.clear(); + m_pOK.clear(); + m_pFindDlg.clear(); SfxModalDialog::dispose(); } @@ -764,6 +763,23 @@ SwFindEntryDialog::SwFindEntryDialog(SwCreateAddressListDialog* pParent) m_pCancel->SetClickHdl(LINK(this, SwFindEntryDialog, CloseHdl_Impl)); } +SwFindEntryDialog::~SwFindEntryDialog() +{ + dispose(); +} + +void SwFindEntryDialog::dispose() +{ + m_pFindED.clear(); + m_pFindOnlyCB.clear(); + m_pFindOnlyLB.clear(); + m_pFindPB.clear(); + m_pCancel.clear(); + m_pParent.clear(); + ModelessDialog::dispose(); +} + + IMPL_LINK_NOARG(SwFindEntryDialog, FindHdl_Impl) { sal_Int32 nColumn = -1; diff --git a/sw/source/ui/dbui/createaddresslistdialog.hxx b/sw/source/ui/dbui/createaddresslistdialog.hxx index dec027a5514f..ac6ed41cfab2 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.hxx +++ b/sw/source/ui/dbui/createaddresslistdialog.hxx @@ -40,27 +40,27 @@ struct SwCSVData class SwFindEntryDialog; class SwCreateAddressListDialog : public SfxModalDialog { - SwAddressControl_Impl* m_pAddressControl; + VclPtr<SwAddressControl_Impl> m_pAddressControl; - PushButton *m_pNewPB; - PushButton *m_pDeletePB; - PushButton *m_pFindPB; - PushButton *m_pCustomizePB; + VclPtr<PushButton> m_pNewPB; + VclPtr<PushButton> m_pDeletePB; + VclPtr<PushButton> m_pFindPB; + VclPtr<PushButton> m_pCustomizePB; - PushButton *m_pStartPB; - PushButton *m_pPrevPB; - NumericField *m_pSetNoNF; - PushButton *m_pNextPB; - PushButton *m_pEndPB; + VclPtr<PushButton> m_pStartPB; + VclPtr<PushButton> m_pPrevPB; + VclPtr<NumericField> m_pSetNoNF; + VclPtr<PushButton> m_pNextPB; + VclPtr<PushButton> m_pEndPB; - OKButton *m_pOK; + VclPtr<OKButton> m_pOK; OUString m_sAddressListFilterName; OUString m_sURL; SwCSVData* m_pCSVData; - SwFindEntryDialog* m_pFindDlg; + VclPtr<SwFindEntryDialog> m_pFindDlg; DECL_LINK(NewHdl_Impl, void *); DECL_LINK(DeleteHdl_Impl, void *); @@ -84,14 +84,14 @@ public: class SwFindEntryDialog : public ModelessDialog { - Edit* m_pFindED; - CheckBox* m_pFindOnlyCB; - ListBox* m_pFindOnlyLB; + VclPtr<Edit> m_pFindED; + VclPtr<CheckBox> m_pFindOnlyCB; + VclPtr<ListBox> m_pFindOnlyLB; - PushButton* m_pFindPB; - CancelButton* m_pCancel; + VclPtr<PushButton> m_pFindPB; + VclPtr<CancelButton> m_pCancel; - SwCreateAddressListDialog* m_pParent; + VclPtr<SwCreateAddressListDialog> m_pParent; DECL_LINK(FindHdl_Impl, void *); DECL_LINK(FindEnableHdl_Impl, void *); @@ -99,6 +99,8 @@ class SwFindEntryDialog : public ModelessDialog public: SwFindEntryDialog(SwCreateAddressListDialog* pParent); + virtual ~SwFindEntryDialog(); + virtual void dispose() SAL_OVERRIDE; ListBox& GetFieldsListBox() { diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.cxx b/sw/source/ui/dbui/customizeaddresslistdialog.cxx index c812fcd37a1a..5db3c7c13238 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.cxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.cxx @@ -24,7 +24,6 @@ #include <vcl/msgbox.hxx> #include <dbui.hrc> #include <helpid.h> -#include <boost/scoped_ptr.hpp> SwCustomizeAddressListDialog::SwCustomizeAddressListDialog( vcl::Window* pParent, const SwCSVData& rOldData) @@ -61,8 +60,21 @@ SwCustomizeAddressListDialog::SwCustomizeAddressListDialog( SwCustomizeAddressListDialog::~SwCustomizeAddressListDialog() { + dispose(); } +void SwCustomizeAddressListDialog::dispose() +{ + m_pFieldsLB.clear(); + m_pAddPB.clear(); + m_pDeletePB.clear(); + m_pRenamePB.clear(); + m_pUpPB.clear(); + m_pDownPB.clear(); + SfxModalDialog::dispose(); +} + + IMPL_LINK_NOARG(SwCustomizeAddressListDialog, ListBoxSelectHdl_Impl) { UpdateButtons(); @@ -76,11 +88,11 @@ IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton) if(nPos == LISTBOX_ENTRY_NOTFOUND) nPos = 0; - boost::scoped_ptr<SwAddRenameEntryDialog> pDlg; + VclPtr<SwAddRenameEntryDialog> pDlg; if (bRename) - pDlg.reset(new SwRenameEntryDialog(pButton, m_pNewData->aDBColumnHeaders)); + pDlg = new SwRenameEntryDialog(pButton, m_pNewData->aDBColumnHeaders); else - pDlg.reset(new SwAddEntryDialog(pButton, m_pNewData->aDBColumnHeaders)); + pDlg = new SwAddEntryDialog(pButton, m_pNewData->aDBColumnHeaders); if(bRename) { OUString aTemp = m_pFieldsLB->GetEntry(nPos); @@ -111,7 +123,6 @@ IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton) m_pFieldsLB->InsertEntry(sNew, nPos); m_pFieldsLB->SelectEntryPos(nPos); } - pDlg.reset(); UpdateButtons(); return 0; } @@ -184,6 +195,18 @@ SwAddRenameEntryDialog::SwAddRenameEntryDialog( ModifyHdl_Impl(m_pFieldNameED); } +SwAddRenameEntryDialog::~SwAddRenameEntryDialog() +{ + dispose(); +} + +void SwAddRenameEntryDialog::dispose() +{ + m_pFieldNameED.clear(); + m_pOK.clear(); + SfxModalDialog::dispose(); +} + IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit) { OUString sEntry = pEdit->GetText(); diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.hxx b/sw/source/ui/dbui/customizeaddresslistdialog.hxx index e0592085047f..e943f657b3f3 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.hxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.hxx @@ -29,14 +29,14 @@ struct SwCSVData; class SwCustomizeAddressListDialog : public SfxModalDialog { - ListBox* m_pFieldsLB; + VclPtr<ListBox> m_pFieldsLB; - PushButton* m_pAddPB; - PushButton* m_pDeletePB; - PushButton* m_pRenamePB; + VclPtr<PushButton> m_pAddPB; + VclPtr<PushButton> m_pDeletePB; + VclPtr<PushButton> m_pRenamePB; - PushButton* m_pUpPB; - PushButton* m_pDownPB; + VclPtr<PushButton> m_pUpPB; + VclPtr<PushButton> m_pDownPB; SwCSVData* m_pNewData; @@ -49,20 +49,24 @@ class SwCustomizeAddressListDialog : public SfxModalDialog public: SwCustomizeAddressListDialog(vcl::Window* pParent, const SwCSVData& rOldData); virtual ~SwCustomizeAddressListDialog(); + virtual void dispose() SAL_OVERRIDE; SwCSVData* GetNewData() { return m_pNewData;} }; class SwAddRenameEntryDialog : public SfxModalDialog { - Edit* m_pFieldNameED; - OKButton* m_pOK; + VclPtr<Edit> m_pFieldNameED; + VclPtr<OKButton> m_pOK; const std::vector< OUString >& m_rCSVHeader; DECL_LINK(ModifyHdl_Impl, Edit*); protected: SwAddRenameEntryDialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription, const std::vector< OUString >& rCSVHeader); + virtual ~SwAddRenameEntryDialog(); + virtual void dispose() SAL_OVERRIDE; + public: void SetFieldName(const OUString& rName) {m_pFieldNameED->SetText(rName);} OUString GetFieldName() const {return m_pFieldNameED->GetText();}; diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 247a531a73ce..4c8da211625c 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -421,6 +421,31 @@ void SwInsertDBColAutoPilot::dispose() delete pRep; delete pTAutoFmt; + m_pRbAsTable.clear(); + m_pRbAsField.clear(); + m_pRbAsText.clear(); + m_pHeadFrame.clear(); + m_pLbTblDbColumn.clear(); + m_pLbTxtDbColumn.clear(); + m_pFormatFrame.clear(); + m_pRbDbFmtFromDb.clear(); + m_pRbDbFmtFromUsr.clear(); + m_pLbDbFmtFromUsr.clear(); + m_pIbDbcolToEdit.clear(); + m_pEdDbText.clear(); + m_pFtDbParaColl.clear(); + m_pLbDbParaColl.clear(); + m_pIbDbcolAllTo.clear(); + m_pIbDbcolOneTo.clear(); + m_pIbDbcolOneFrom.clear(); + m_pIbDbcolAllFrom.clear(); + m_pFtTableCol.clear(); + m_pLbTableCol.clear(); + m_pCbTableHeadon.clear(); + m_pRbHeadlColnms.clear(); + m_pRbHeadlEmpty.clear(); + m_pPbTblFormat.clear(); + m_pPbTblAutofmt.clear(); SfxModalDialog::dispose(); } @@ -773,9 +798,9 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox ) ListBox* pGetBox = pBox == m_pLbDbFmtFromUsr ? ( m_pRbAsTable->IsChecked() ? ( 0 == m_pLbTableCol->GetEntryData( 0 ) - ? m_pLbTblDbColumn - : m_pLbTableCol ) - : m_pLbTxtDbColumn ) + ? m_pLbTblDbColumn.get() + : m_pLbTableCol.get() ) + : m_pLbTxtDbColumn.get() ) : pBox; SwInsDBColumn aSrch( pGetBox->GetSelectEntry(), 0 ); @@ -823,7 +848,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox ) // to know later on, what ListBox was the "active", a Flag // is remembered in the 1st entry - void* pPtr = pBox == m_pLbTableCol ? m_pLbTableCol : 0; + void* pPtr = pBox == m_pLbTableCol ? m_pLbTableCol.get() : 0; m_pLbTableCol->SetEntryData( 0, pPtr ); } return 0; diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.cxx b/sw/source/ui/dbui/dbtablepreviewdialog.cxx index 76c66c7b7449..d62f410a56b6 100644 --- a/sw/source/ui/dbui/dbtablepreviewdialog.cxx +++ b/sw/source/ui/dbui/dbtablepreviewdialog.cxx @@ -91,6 +91,8 @@ void SwDBTablePreviewDialog::dispose() m_xFrame->setComponent(NULL, NULL); m_xFrame->dispose(); } + m_pDescriptionFI.clear(); + m_pBeamerWIN.clear(); SfxModalDialog::dispose(); } diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.hxx b/sw/source/ui/dbui/dbtablepreviewdialog.hxx index a1d9dcefe802..bae176de7b74 100644 --- a/sw/source/ui/dbui/dbtablepreviewdialog.hxx +++ b/sw/source/ui/dbui/dbtablepreviewdialog.hxx @@ -31,8 +31,8 @@ namespace com{ namespace sun{ namespace star{ class SwDBTablePreviewDialog : public SfxModalDialog { - FixedText* m_pDescriptionFI; - vcl::Window* m_pBeamerWIN; + VclPtr<FixedText> m_pDescriptionFI; + VclPtr<vcl::Window> m_pBeamerWIN; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xFrame; public: diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 4698f3d77104..73476fd633cd 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -93,6 +93,32 @@ SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage( SwMailMergeWizard* _pP m_pNextSetIB->SetClickHdl(aLink); } +SwMailMergeAddressBlockPage::~SwMailMergeAddressBlockPage() +{ + dispose(); +} + +void SwMailMergeAddressBlockPage::dispose() +{ + m_pAddressListPB.clear(); + m_pCurrentAddressFI.clear(); + m_pStep2.clear(); + m_pStep3.clear(); + m_pStep4.clear(); + m_pSettingsFI.clear(); + m_pAddressCB.clear(); + m_pSettingsWIN.clear(); + m_pSettingsPB.clear(); + m_pHideEmptyParagraphsCB.clear(); + m_pAssignPB.clear(); + m_pPreviewWIN.clear(); + m_pDocumentIndexFI.clear(); + m_pPrevSetIB.clear(); + m_pNextSetIB.clear(); + m_pWizard.clear(); + svt::OWizardPage::dispose(); +} + bool SwMailMergeAddressBlockPage::canAdvance() const { return m_pWizard->GetConfigItem().GetResultSet().is(); @@ -330,6 +356,20 @@ SwSelectAddressBlockDialog::SwSelectAddressBlockDialog( SwSelectAddressBlockDialog::~SwSelectAddressBlockDialog() { + dispose(); +} + +void SwSelectAddressBlockDialog::dispose() +{ + m_pPreview.clear(); + m_pNewPB.clear(); + m_pCustomizePB.clear(); + m_pDeletePB.clear(); + m_pNeverRB.clear(); + m_pAlwaysRB.clear(); + m_pDependentRB.clear(); + m_pCountryED.clear(); + SfxModalDialog::dispose(); } void SwSelectAddressBlockDialog::SetAddressBlocks(const uno::Sequence< OUString>& rBlocks, @@ -533,6 +573,26 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog( SwCustomizeAddressBlockDialog::~SwCustomizeAddressBlockDialog() { + dispose(); +} + +void SwCustomizeAddressBlockDialog::dispose() +{ + m_pAddressElementsFT.clear(); + m_pAddressElementsLB.clear(); + m_pInsertFieldIB.clear(); + m_pRemoveFieldIB.clear(); + m_pDragFT.clear(); + m_pDragED.clear(); + m_pUpIB.clear(); + m_pLeftIB.clear(); + m_pRightIB.clear(); + m_pDownIB.clear(); + m_pFieldFT.clear(); + m_pFieldCB.clear(); + m_pPreviewWIN.clear(); + m_pOK.clear(); + SfxModalDialog::dispose(); } IMPL_LINK_NOARG(SwCustomizeAddressBlockDialog, OKHdl_Impl) @@ -750,9 +810,9 @@ class SwAssignFieldsControl : public Control VclPtr<HeaderBar> m_aHeaderHB; VclPtr<Window> m_aWindow; - ::std::vector<FixedText*> m_aFieldNames; - ::std::vector<ListBox*> m_aMatches; - ::std::vector<FixedText*> m_aPreviews; + ::std::vector<VclPtr<FixedText> > m_aFieldNames; + ::std::vector<VclPtr<ListBox> > m_aMatches; + ::std::vector<VclPtr<FixedText> > m_aPreviews; SwMailMergeConfigItem* m_rConfigItem; @@ -929,14 +989,9 @@ SwAssignFieldsControl::~SwAssignFieldsControl() void SwAssignFieldsControl::dispose() { - ::std::vector<FixedText*>::iterator aFIIter; - for(aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter) - delete *aFIIter; - ::std::vector<ListBox*>::iterator aLBIter; - for(aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter) - delete *aLBIter; - for(aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter) - delete *aFIIter; + m_aFieldNames.clear(); + m_aMatches.clear(); + m_aPreviews.clear(); m_aVScroll.disposeAndClear(); m_aHeaderHB.disposeAndClear(); @@ -972,16 +1027,14 @@ void SwAssignFieldsControl::Resize() long nControlHeight = std::max(m_aFieldNames[0]->get_preferred_size().Height(), m_aMatches[0]->get_preferred_size().Height()); - ::std::vector<FixedText*>::iterator aFIIter; - for(aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter) + for(auto aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter) (*aFIIter)->SetSizePixel(Size(nColWidth - 6, nControlHeight)); - ::std::vector<ListBox*>::iterator aLBIter; - for(aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter) + for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter) { long nPosY = (*aLBIter)->GetPosPixel().Y(); (*aLBIter)->SetPosSizePixel(Point(nColWidth, nPosY), Size(nColWidth - 6, nControlHeight)); } - for(aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter) + for(auto aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter) { long nPosY = (*aFIIter)->GetPosPixel().Y(); (*aFIIter)->SetPosSizePixel(Point(2 * nColWidth + 6, nPosY), Size(nColWidth, nControlHeight)); @@ -1046,14 +1099,11 @@ IMPL_LINK(SwAssignFieldsControl, ScrollHdl_Impl, ScrollBar*, pScroll) long nMove = m_nFirstYPos - (*m_aMatches.begin())->GetPosPixel().Y() - (nThumb * m_nYOffset); SetUpdateMode(false); - long nIndex; - ::std::vector<FixedText*>::iterator aFIIter; - for(nIndex = 0, aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter, ++nIndex) + for(auto aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter) lcl_Move(*aFIIter, nMove); - ::std::vector<ListBox*>::iterator aLBIter; - for(nIndex = 0, aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter, ++nIndex) + for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter) lcl_Move(*aLBIter, nMove); - for(nIndex = 0, aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter, ++nIndex) + for(auto aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter) lcl_Move(*aFIIter, nMove); SetUpdateMode(true); @@ -1082,9 +1132,8 @@ IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox) } } } - ::std::vector<ListBox*>::iterator aLBIter; sal_Int32 nIndex = 0; - for(aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter, ++nIndex) + for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter, ++nIndex) { if(*aLBIter == pBox) { @@ -1101,8 +1150,7 @@ IMPL_LINK(SwAssignFieldsControl, GotFocusHdl_Impl, ListBox*, pBox) if(0 != (GETFOCUS_TAB & pBox->GetGetFocusFlags())) { sal_Int32 nIndex = 0; - ::std::vector<ListBox*>::iterator aLBIter; - for(aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter, ++nIndex) + for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter, ++nIndex) { if(*aLBIter == pBox) { @@ -1161,6 +1209,17 @@ SwAssignFieldsDialog::SwAssignFieldsDialog( SwAssignFieldsDialog::~SwAssignFieldsDialog() { + dispose(); +} + +void SwAssignFieldsDialog::dispose() +{ + m_pMatchingFI.clear(); + m_pFieldsControl.clear(); + m_pPreviewFI.clear(); + m_pPreviewWIN.clear(); + m_pOK.clear(); + SfxModalDialog::dispose(); } uno::Sequence< OUString > SwAssignFieldsDialog::CreateAssignments() @@ -1168,9 +1227,8 @@ uno::Sequence< OUString > SwAssignFieldsDialog::CreateAssignments() uno::Sequence< OUString > aAssignments( m_rConfigItem.GetDefaultAddressHeaders().Count()); OUString* pAssignments = aAssignments.getArray(); - ::std::vector<ListBox*>::iterator aLBIter; sal_Int32 nIndex = 0; - for(aLBIter = m_pFieldsControl->m_aMatches.begin(); + for(auto aLBIter = m_pFieldsControl->m_aMatches.begin(); aLBIter != m_pFieldsControl->m_aMatches.end(); ++aLBIter, ++nIndex) { @@ -1213,6 +1271,18 @@ DDListBox::DDListBox(vcl::Window* pParent, WinBits nStyle) } +DDListBox::~DDListBox() +{ + dispose(); +} + +void DDListBox::dispose() +{ + m_pParentDialog.clear(); + SvTreeListBox::dispose(); +} + + extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeDDListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap) { WinBits nWinStyle = WB_TABSTOP; @@ -1257,6 +1327,19 @@ AddressMultiLineEdit::AddressMultiLineEdit(vcl::Window* pParent, WinBits nBits) EnableFocusSelectionHide(false); } +AddressMultiLineEdit::~AddressMultiLineEdit() +{ + dispose(); +} + +void AddressMultiLineEdit::dispose() +{ + EndListening(*GetTextEngine()); + m_pParentDialog.clear(); + VclMultiLineEdit::dispose(); +} + + Size AddressMultiLineEdit::GetOptimalSize() const { return LogicToPixel(Size(160, 60), MAP_APPFONT); @@ -1276,11 +1359,6 @@ void AddressMultiLineEdit::SetAddressDialog(SwCustomizeAddressBlockDialog *pPare m_pParentDialog = pParent; } -AddressMultiLineEdit::~AddressMultiLineEdit() -{ - EndListening(*GetTextEngine()); -} - void AddressMultiLineEdit::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) { if (m_aSelectionLink.IsSet() && dynamic_cast<const TextHint*>(&rHint)) diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx index 6824bed6f897..2f93a750f1b1 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.hxx +++ b/sw/source/ui/dbui/mmaddressblockpage.hxx @@ -37,31 +37,31 @@ class SwMailMergeConfigItem; class SwMailMergeAddressBlockPage : public svt::OWizardPage { - PushButton* m_pAddressListPB; - FixedText* m_pCurrentAddressFI; + VclPtr<PushButton> m_pAddressListPB; + VclPtr<FixedText> m_pCurrentAddressFI; - VclContainer* m_pStep2; - VclContainer* m_pStep3; - VclContainer* m_pStep4; + VclPtr<VclContainer> m_pStep2; + VclPtr<VclContainer> m_pStep3; + VclPtr<VclContainer> m_pStep4; - FixedText* m_pSettingsFI; - CheckBox* m_pAddressCB; - SwAddressPreview* m_pSettingsWIN; - PushButton* m_pSettingsPB; - CheckBox* m_pHideEmptyParagraphsCB; + VclPtr<FixedText> m_pSettingsFI; + VclPtr<CheckBox> m_pAddressCB; + VclPtr<SwAddressPreview> m_pSettingsWIN; + VclPtr<PushButton> m_pSettingsPB; + VclPtr<CheckBox> m_pHideEmptyParagraphsCB; - PushButton* m_pAssignPB; + VclPtr<PushButton> m_pAssignPB; - SwAddressPreview* m_pPreviewWIN; - FixedText* m_pDocumentIndexFI; - PushButton* m_pPrevSetIB; - PushButton* m_pNextSetIB; + VclPtr<SwAddressPreview> m_pPreviewWIN; + VclPtr<FixedText> m_pDocumentIndexFI; + VclPtr<PushButton> m_pPrevSetIB; + VclPtr<PushButton> m_pNextSetIB; OUString m_sDocument; OUString m_sCurrentAddress; OUString m_sChangeAddress; - SwMailMergeWizard* m_pWizard; + VclPtr<SwMailMergeWizard> m_pWizard; DECL_LINK(AddressListHdl_Impl, void *); DECL_LINK(SettingsHdl_Impl, PushButton*); @@ -79,20 +79,22 @@ class SwMailMergeAddressBlockPage : public svt::OWizardPage public: SwMailMergeAddressBlockPage(SwMailMergeWizard* _pParent); + virtual ~SwMailMergeAddressBlockPage(); + virtual void dispose() SAL_OVERRIDE; SwMailMergeWizard* GetWizard() { return m_pWizard; } }; class SwSelectAddressBlockDialog : public SfxModalDialog { - SwAddressPreview* m_pPreview; - PushButton* m_pNewPB; - PushButton* m_pCustomizePB; - PushButton* m_pDeletePB; + VclPtr<SwAddressPreview> m_pPreview; + VclPtr<PushButton> m_pNewPB; + VclPtr<PushButton> m_pCustomizePB; + VclPtr<PushButton> m_pDeletePB; - RadioButton* m_pNeverRB; - RadioButton* m_pAlwaysRB; - RadioButton* m_pDependentRB; - Edit* m_pCountryED; + VclPtr<RadioButton> m_pNeverRB; + VclPtr<RadioButton> m_pAlwaysRB; + VclPtr<RadioButton> m_pDependentRB; + VclPtr<Edit> m_pCountryED; com::sun::star::uno::Sequence< OUString> m_aAddressBlocks; SwMailMergeConfigItem& m_rConfig; @@ -106,6 +108,7 @@ class SwSelectAddressBlockDialog : public SfxModalDialog public: SwSelectAddressBlockDialog(vcl::Window* pParent, SwMailMergeConfigItem& rConfig); virtual ~SwSelectAddressBlockDialog(); + virtual void dispose() SAL_OVERRIDE; void SetAddressBlocks(const com::sun::star::uno::Sequence< OUString>& rBlocks, sal_uInt16 nSelected); @@ -119,9 +122,11 @@ public: class SwCustomizeAddressBlockDialog; class DDListBox : public SvTreeListBox { - SwCustomizeAddressBlockDialog* m_pParentDialog; + VclPtr<SwCustomizeAddressBlockDialog> m_pParentDialog; public: DDListBox(vcl::Window* pParent, const WinBits nStyle); + virtual ~DDListBox(); + virtual void dispose() SAL_OVERRIDE; void SetAddressDialog(SwCustomizeAddressBlockDialog *pParent); @@ -136,7 +141,7 @@ public: class AddressMultiLineEdit : public VclMultiLineEdit, public SfxListener { Link m_aSelectionLink; - SwCustomizeAddressBlockDialog* m_pParentDialog; + VclPtr<SwCustomizeAddressBlockDialog> m_pParentDialog; using VclMultiLineEdit::Notify; @@ -147,6 +152,7 @@ protected: public: AddressMultiLineEdit(vcl::Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER); virtual ~AddressMultiLineEdit(); + virtual void dispose() SAL_OVERRIDE; void SetAddressDialog(SwCustomizeAddressBlockDialog *pParent); @@ -183,26 +189,26 @@ public: GREETING_MALE }; private: - FixedText* m_pAddressElementsFT; - DDListBox* m_pAddressElementsLB; + VclPtr<FixedText> m_pAddressElementsFT; + VclPtr<DDListBox> m_pAddressElementsLB; - PushButton* m_pInsertFieldIB; - PushButton* m_pRemoveFieldIB; + VclPtr<PushButton> m_pInsertFieldIB; + VclPtr<PushButton> m_pRemoveFieldIB; - FixedText* m_pDragFT; - AddressMultiLineEdit* m_pDragED; - PushButton* m_pUpIB; - PushButton* m_pLeftIB; - PushButton* m_pRightIB; - PushButton* m_pDownIB; + VclPtr<FixedText> m_pDragFT; + VclPtr<AddressMultiLineEdit> m_pDragED; + VclPtr<PushButton> m_pUpIB; + VclPtr<PushButton> m_pLeftIB; + VclPtr<PushButton> m_pRightIB; + VclPtr<PushButton> m_pDownIB; - FixedText* m_pFieldFT; - ComboBox* m_pFieldCB; + VclPtr<FixedText> m_pFieldFT; + VclPtr<ComboBox> m_pFieldCB; TextFilter m_aTextFilter; - SwAddressPreview* m_pPreviewWIN; + VclPtr<SwAddressPreview> m_pPreviewWIN; - OKButton* m_pOK; + VclPtr<OKButton> m_pOK; ::std::vector<OUString> m_aSalutations; ::std::vector<OUString> m_aPunctuations; @@ -228,6 +234,7 @@ private: public: SwCustomizeAddressBlockDialog(vcl::Window* pParent, SwMailMergeConfigItem& rConfig, DialogType); virtual ~SwCustomizeAddressBlockDialog(); + virtual void dispose() SAL_OVERRIDE; void SetAddress(const OUString& rAddress); OUString GetAddress(); @@ -236,14 +243,13 @@ public: class SwAssignFieldsControl; class SwAssignFieldsDialog : public SfxModalDialog { - FixedText *m_pMatchingFI; - SwAssignFieldsControl *m_pFieldsControl; + VclPtr<FixedText> m_pMatchingFI; + VclPtr<SwAssignFieldsControl> m_pFieldsControl; - FixedText *m_pPreviewFI; - SwAddressPreview *m_pPreviewWIN; + VclPtr<FixedText> m_pPreviewFI; + VclPtr<SwAddressPreview> m_pPreviewWIN; - - OKButton *m_pOK; + VclPtr<OKButton> m_pOK; OUString m_sNone; OUString m_rPreviewString; @@ -260,6 +266,7 @@ public: const OUString& rPreview, bool bIsAddressBlock); virtual ~SwAssignFieldsDialog(); + virtual void dispose() SAL_OVERRIDE; }; #endif diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx index 85440c6a4833..fff60188bdd3 100644 --- a/sw/source/ui/dbui/mmdocselectpage.cxx +++ b/sw/source/ui/dbui/mmdocselectpage.cxx @@ -92,6 +92,21 @@ SwMailMergeDocSelectPage::SwMailMergeDocSelectPage(SwMailMergeWizard* pParent) SwMailMergeDocSelectPage::~SwMailMergeDocSelectPage() { + dispose(); +} + +void SwMailMergeDocSelectPage::dispose() +{ + m_pCurrentDocRB.clear(); + m_pNewDocRB.clear(); + m_pLoadDocRB.clear(); + m_pLoadTemplateRB.clear(); + m_pRecentDocRB.clear(); + m_pBrowseDocPB.clear(); + m_pBrowseTemplatePB.clear(); + m_pRecentDocLB.clear(); + m_pWizard.clear(); + svt::OWizardPage::dispose(); } IMPL_LINK(SwMailMergeDocSelectPage, DocSelectHdl, RadioButton*, pButton) diff --git a/sw/source/ui/dbui/mmdocselectpage.hxx b/sw/source/ui/dbui/mmdocselectpage.hxx index b2e241270faf..931fc4dbfce4 100644 --- a/sw/source/ui/dbui/mmdocselectpage.hxx +++ b/sw/source/ui/dbui/mmdocselectpage.hxx @@ -28,21 +28,21 @@ class SwMailMergeWizard; class SwMailMergeDocSelectPage : public svt::OWizardPage { - RadioButton* m_pCurrentDocRB; - RadioButton* m_pNewDocRB; - RadioButton* m_pLoadDocRB; - RadioButton* m_pLoadTemplateRB; - RadioButton* m_pRecentDocRB; + VclPtr<RadioButton> m_pCurrentDocRB; + VclPtr<RadioButton> m_pNewDocRB; + VclPtr<RadioButton> m_pLoadDocRB; + VclPtr<RadioButton> m_pLoadTemplateRB; + VclPtr<RadioButton> m_pRecentDocRB; - PushButton* m_pBrowseDocPB; - PushButton* m_pBrowseTemplatePB; + VclPtr<PushButton> m_pBrowseDocPB; + VclPtr<PushButton> m_pBrowseTemplatePB; - ListBox* m_pRecentDocLB; + VclPtr<ListBox> m_pRecentDocLB; OUString m_sLoadFileName; OUString m_sLoadTemplateName; - SwMailMergeWizard* m_pWizard; + VclPtr<SwMailMergeWizard> m_pWizard; DECL_LINK(DocSelectHdl, RadioButton*); DECL_LINK(FileSelectHdl, PushButton*); @@ -52,6 +52,7 @@ class SwMailMergeDocSelectPage : public svt::OWizardPage public: SwMailMergeDocSelectPage( SwMailMergeWizard* _pParent); virtual ~SwMailMergeDocSelectPage(); + virtual void dispose() SAL_OVERRIDE; }; diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index 7355613e3ad2..15aa60b137cb 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -292,6 +292,18 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage(SwMailMergeWizard* _pParent) SwMailMergeGreetingsPage::~SwMailMergeGreetingsPage() { + dispose(); +} + +void SwMailMergeGreetingsPage::dispose() +{ + m_pPreviewFI.clear(); + m_pPreviewWIN.clear(); + m_pAssignPB.clear(); + m_pDocumentIndexFI.clear(); + m_pPrevSetIB.clear(); + m_pNextSetIB.clear(); + svt::OWizardPage::dispose(); } void SwMailMergeGreetingsPage::ActivatePage() @@ -472,6 +484,15 @@ SwMailBodyDialog::SwMailBodyDialog(vcl::Window* pParent, SwMailMergeWizard* _pWi SwMailBodyDialog::~SwMailBodyDialog() { + dispose(); +} + +void SwMailBodyDialog::dispose() +{ + m_pBodyFT.clear(); + m_pBodyMLE.clear(); + m_pOK.clear(); + SfxModalDialog::dispose(); } IMPL_LINK(SwMailBodyDialog, ContainsHdl_Impl, CheckBox*, pBox) diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx b/sw/source/ui/dbui/mmgreetingspage.hxx index d74b54224df9..d351191b6121 100644 --- a/sw/source/ui/dbui/mmgreetingspage.hxx +++ b/sw/source/ui/dbui/mmgreetingspage.hxx @@ -33,30 +33,30 @@ class SwMailMergeWizard; class SwGreetingsHandler { protected: - CheckBox* m_pGreetingLineCB; + VclPtr<CheckBox> m_pGreetingLineCB; - CheckBox* m_pPersonalizedCB; + VclPtr<CheckBox> m_pPersonalizedCB; - FixedText* m_pFemaleFT; - ListBox* m_pFemaleLB; - PushButton* m_pFemalePB; + VclPtr<FixedText> m_pFemaleFT; + VclPtr<ListBox> m_pFemaleLB; + VclPtr<PushButton> m_pFemalePB; - FixedText* m_pMaleFT; - ListBox* m_pMaleLB; - PushButton* m_pMalePB; + VclPtr<FixedText> m_pMaleFT; + VclPtr<ListBox> m_pMaleLB; + VclPtr<PushButton> m_pMalePB; - FixedText* m_pFemaleFI; - FixedText* m_pFemaleColumnFT; - ListBox* m_pFemaleColumnLB; - FixedText* m_pFemaleFieldFT; - ComboBox* m_pFemaleFieldCB; + VclPtr<FixedText> m_pFemaleFI; + VclPtr<FixedText> m_pFemaleColumnFT; + VclPtr<ListBox> m_pFemaleColumnLB; + VclPtr<FixedText> m_pFemaleFieldFT; + VclPtr<ComboBox> m_pFemaleFieldCB; - FixedText* m_pNeutralFT; - ComboBox* m_pNeutralCB; + VclPtr<FixedText> m_pNeutralFT; + VclPtr<ComboBox> m_pNeutralCB; bool m_bIsTabPage; - SwMailMergeWizard* m_pWizard; + VclPtr<SwMailMergeWizard> m_pWizard; ~SwGreetingsHandler() {} @@ -70,12 +70,12 @@ protected: class SwMailMergeGreetingsPage : public svt::OWizardPage, public SwGreetingsHandler { - FixedText* m_pPreviewFI; - SwAddressPreview* m_pPreviewWIN; - PushButton* m_pAssignPB; - FixedText* m_pDocumentIndexFI; - PushButton* m_pPrevSetIB; - PushButton* m_pNextSetIB; + VclPtr<FixedText> m_pPreviewFI; + VclPtr<SwAddressPreview> m_pPreviewWIN; + VclPtr<PushButton> m_pAssignPB; + VclPtr<FixedText> m_pDocumentIndexFI; + VclPtr<PushButton> m_pPrevSetIB; + VclPtr<PushButton> m_pNextSetIB; OUString m_sDocument; @@ -90,21 +90,23 @@ class SwMailMergeGreetingsPage : public svt::OWizardPage, public: SwMailMergeGreetingsPage( SwMailMergeWizard* _pParent); virtual ~SwMailMergeGreetingsPage(); + virtual void dispose() SAL_OVERRIDE; }; class SwMailBodyDialog : public SfxModalDialog, public SwGreetingsHandler { - FixedText *m_pBodyFT; - VclMultiLineEdit *m_pBodyMLE; + VclPtr<FixedText> m_pBodyFT; + VclPtr<VclMultiLineEdit> m_pBodyMLE; - OKButton *m_pOK; + VclPtr<OKButton> m_pOK; DECL_LINK(ContainsHdl_Impl, CheckBox*); DECL_LINK(OKHdl, void *); public: SwMailBodyDialog(vcl::Window* pParent, SwMailMergeWizard* pWizard); virtual ~SwMailBodyDialog(); + virtual void dispose() SAL_OVERRIDE; void SetBody(const OUString& rBody ) {m_pBodyMLE->SetText(rBody);} OUString GetBody() const {return m_pBodyMLE->GetText();} diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index 67b12453ddc0..c02333126595 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -162,6 +162,17 @@ void SwMailMergeLayoutPage::dispose() { delete m_pExampleFrame; File::remove( m_sExampleURL ); + m_pPosition.clear(); + m_pAlignToBodyCB.clear(); + m_pLeftFT.clear(); + m_pLeftMF.clear(); + m_pTopMF.clear(); + m_pGreetingLine.clear(); + m_pUpPB.clear(); + m_pDownPB.clear(); + m_pExampleContainerWIN.clear(); + m_pZoomLB.clear(); + m_pWizard.clear(); svt::OWizardPage::dispose(); } diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx b/sw/source/ui/dbui/mmlayoutpage.hxx index 69e534b002bb..5b9f9a8c3cc1 100644 --- a/sw/source/ui/dbui/mmlayoutpage.hxx +++ b/sw/source/ui/dbui/mmlayoutpage.hxx @@ -38,20 +38,20 @@ namespace com{ namespace sun{ namespace star{ namespace beans{ class XPropertySe class SwMailMergeLayoutPage : public svt::OWizardPage { - VclContainer* m_pPosition; + VclPtr<VclContainer> m_pPosition; - CheckBox* m_pAlignToBodyCB; - FixedText* m_pLeftFT; - MetricField* m_pLeftMF; - MetricField* m_pTopMF; + VclPtr<CheckBox> m_pAlignToBodyCB; + VclPtr<FixedText> m_pLeftFT; + VclPtr<MetricField> m_pLeftMF; + VclPtr<MetricField> m_pTopMF; - VclContainer* m_pGreetingLine; - PushButton* m_pUpPB; - PushButton* m_pDownPB; + VclPtr<VclContainer> m_pGreetingLine; + VclPtr<PushButton> m_pUpPB; + VclPtr<PushButton> m_pDownPB; - vcl::Window* m_pExampleContainerWIN; + VclPtr<vcl::Window> m_pExampleContainerWIN; - ListBox* m_pZoomLB; + VclPtr<ListBox> m_pZoomLB; SwOneExampleFrame* m_pExampleFrame; SwWrtShell* m_pExampleWrtShell; @@ -61,7 +61,7 @@ class SwMailMergeLayoutPage : public svt::OWizardPage bool m_bIsGreetingInserted; - SwMailMergeWizard* m_pWizard; + VclPtr<SwMailMergeWizard> m_pWizard; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xViewProperties; diff --git a/sw/source/ui/dbui/mmmergepage.cxx b/sw/source/ui/dbui/mmmergepage.cxx index f0fbebcaf046..f2e416933d8f 100644 --- a/sw/source/ui/dbui/mmmergepage.cxx +++ b/sw/source/ui/dbui/mmmergepage.cxx @@ -50,6 +50,25 @@ SwMailMergeMergePage::SwMailMergeMergePage(SwMailMergeWizard* _pParent) } +SwMailMergeMergePage::~SwMailMergeMergePage() +{ + dispose(); +} + +void SwMailMergeMergePage::dispose() +{ + m_pEditFI.clear(); + m_pEditPB.clear(); + m_pFindED.clear(); + m_pFindPB.clear(); + m_pWholeWordsCB.clear(); + m_pBackwardsCB.clear(); + m_pMatchCaseCB.clear(); + m_pWizard.clear(); + svt::OWizardPage::dispose(); +} + + IMPL_LINK_NOARG(SwMailMergeMergePage, EditDocumentHdl_Impl) { m_pWizard->SetRestartPage(MM_MERGEPAGE); diff --git a/sw/source/ui/dbui/mmmergepage.hxx b/sw/source/ui/dbui/mmmergepage.hxx index b415586acc7d..2ff8187eff10 100644 --- a/sw/source/ui/dbui/mmmergepage.hxx +++ b/sw/source/ui/dbui/mmmergepage.hxx @@ -29,17 +29,17 @@ class SwMailMergeWizard; class SwMailMergeMergePage : public svt::OWizardPage { - FixedText* m_pEditFI; - PushButton* m_pEditPB; + VclPtr<FixedText> m_pEditFI; + VclPtr<PushButton> m_pEditPB; - ReturnActionEdit* m_pFindED; - PushButton* m_pFindPB; + VclPtr<ReturnActionEdit> m_pFindED; + VclPtr<PushButton> m_pFindPB; - CheckBox* m_pWholeWordsCB; - CheckBox* m_pBackwardsCB; - CheckBox* m_pMatchCaseCB; + VclPtr<CheckBox> m_pWholeWordsCB; + VclPtr<CheckBox> m_pBackwardsCB; + VclPtr<CheckBox> m_pMatchCaseCB; - SwMailMergeWizard* m_pWizard; + VclPtr<SwMailMergeWizard> m_pWizard; DECL_LINK(EditDocumentHdl_Impl, void *); DECL_LINK(FindHdl_Impl, void *); @@ -47,6 +47,8 @@ class SwMailMergeMergePage : public svt::OWizardPage public: SwMailMergeMergePage( SwMailMergeWizard* _pParent); + virtual ~SwMailMergeMergePage(); + virtual void dispose() SAL_OVERRIDE; }; diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index c75a8d6afce6..1de413396689 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -194,8 +194,8 @@ IMPL_LINK( SwSendQueryBox_Impl, ModifyHdl, Edit*, pEdit) class SwCopyToDialog : public SfxModalDialog { - Edit* m_pCCED; - Edit* m_pBCCED; + VclPtr<Edit> m_pCCED; + VclPtr<Edit> m_pBCCED; public: SwCopyToDialog(vcl::Window* pParent) @@ -205,6 +205,13 @@ public: get(m_pCCED, "cc"); get(m_pBCCED, "bcc"); } + virtual ~SwCopyToDialog() { dispose(); } + virtual void dispose() SAL_OVERRIDE + { + m_pCCED.clear(); + m_pBCCED.clear(); + SfxModalDialog::dispose(); + } OUString GetCC() {return m_pCCED->GetText();} void SetCC(const OUString& rSet) {m_pCCED->SetText(rSet);} @@ -306,6 +313,37 @@ SwMailMergeOutputPage::~SwMailMergeOutputPage() void SwMailMergeOutputPage::dispose() { delete m_pTempPrinter; + m_pSaveStartDocRB.clear(); + m_pSaveMergedDocRB.clear(); + m_pPrintRB.clear(); + m_pSendMailRB.clear(); + m_pSeparator.clear(); + m_pSaveStartDocPB.clear(); + m_pSaveAsOneRB.clear(); + m_pSaveIndividualRB.clear(); + m_pPrintAllRB.clear(); + m_pSendAllRB.clear(); + m_pFromRB.clear(); + m_pFromNF.clear(); + m_pToFT.clear(); + m_pToNF.clear(); + m_pSaveNowPB.clear(); + m_pPrinterFT.clear(); + m_pPrinterLB.clear(); + m_pPrinterSettingsPB.clear(); + m_pPrintNowPB.clear(); + m_pMailToFT.clear(); + m_pMailToLB.clear(); + m_pCopyToPB.clear(); + m_pSubjectFT.clear(); + m_pSubjectED.clear(); + m_pSendAsFT.clear(); + m_pSendAsLB.clear(); + m_pAttachmentGroup.clear(); + m_pAttachmentED.clear(); + m_pSendAsPB.clear(); + m_pSendDocumentsPB.clear(); + m_pWizard.clear(); svt::OWizardPage::dispose(); } @@ -485,7 +523,7 @@ IMPL_LINK(SwMailMergeOutputPage, OutputTypeHdl_Impl, RadioButton*, pButton) SendTypeHdl_Impl(m_pSendAsLB); } } - m_pFromRB->GetClickHdl().Call(m_pFromRB->IsChecked() ? m_pFromRB : 0); + m_pFromRB->GetClickHdl().Call(m_pFromRB->IsChecked() ? m_pFromRB.get() : 0); SetUpdateMode(false); return 0; diff --git a/sw/source/ui/dbui/mmoutputpage.hxx b/sw/source/ui/dbui/mmoutputpage.hxx index 37cc92c34ee2..41e318884a15 100644 --- a/sw/source/ui/dbui/mmoutputpage.hxx +++ b/sw/source/ui/dbui/mmoutputpage.hxx @@ -45,42 +45,42 @@ namespace com{ namespace sun{ namespace star{ class SwMailMergeOutputPage : public svt::OWizardPage { - RadioButton* m_pSaveStartDocRB; - RadioButton* m_pSaveMergedDocRB; - RadioButton* m_pPrintRB; - RadioButton* m_pSendMailRB; + VclPtr<RadioButton> m_pSaveStartDocRB; + VclPtr<RadioButton> m_pSaveMergedDocRB; + VclPtr<RadioButton> m_pPrintRB; + VclPtr<RadioButton> m_pSendMailRB; - VclFrame* m_pSeparator; + VclPtr<VclFrame> m_pSeparator; - PushButton* m_pSaveStartDocPB; + VclPtr<PushButton> m_pSaveStartDocPB; - RadioButton* m_pSaveAsOneRB; - RadioButton* m_pSaveIndividualRB; - RadioButton* m_pPrintAllRB; //has to be here for tab control reasons - RadioButton* m_pSendAllRB; //has to be here for tab control reasons + VclPtr<RadioButton> m_pSaveAsOneRB; + VclPtr<RadioButton> m_pSaveIndividualRB; + VclPtr<RadioButton> m_pPrintAllRB; //has to be here for tab control reasons + VclPtr<RadioButton> m_pSendAllRB; //has to be here for tab control reasons //this group is used in save and print - RadioButton* m_pFromRB; - NumericField* m_pFromNF; - FixedText* m_pToFT; - NumericField* m_pToNF; - PushButton* m_pSaveNowPB; - - FixedText* m_pPrinterFT; - ListBox* m_pPrinterLB; - PushButton* m_pPrinterSettingsPB; - PushButton* m_pPrintNowPB; - - FixedText* m_pMailToFT; - ListBox* m_pMailToLB; - PushButton* m_pCopyToPB; - FixedText* m_pSubjectFT; - Edit* m_pSubjectED; - FixedText* m_pSendAsFT; - ListBox* m_pSendAsLB; - VclContainer* m_pAttachmentGroup; - Edit* m_pAttachmentED; - PushButton* m_pSendAsPB; - PushButton* m_pSendDocumentsPB; + VclPtr<RadioButton> m_pFromRB; + VclPtr<NumericField> m_pFromNF; + VclPtr<FixedText> m_pToFT; + VclPtr<NumericField> m_pToNF; + VclPtr<PushButton> m_pSaveNowPB; + + VclPtr<FixedText> m_pPrinterFT; + VclPtr<ListBox> m_pPrinterLB; + VclPtr<PushButton> m_pPrinterSettingsPB; + VclPtr<PushButton> m_pPrintNowPB; + + VclPtr<FixedText> m_pMailToFT; + VclPtr<ListBox> m_pMailToLB; + VclPtr<PushButton> m_pCopyToPB; + VclPtr<FixedText> m_pSubjectFT; + VclPtr<Edit> m_pSubjectED; + VclPtr<FixedText> m_pSendAsFT; + VclPtr<ListBox> m_pSendAsLB; + VclPtr<VclContainer> m_pAttachmentGroup; + VclPtr<Edit> m_pAttachmentED; + VclPtr<PushButton> m_pSendAsPB; + VclPtr<PushButton> m_pSendDocumentsPB; //some FixedLine labels OUString m_sSaveStartST; @@ -97,7 +97,7 @@ class SwMailMergeOutputPage : public svt::OWizardPage bool m_bCancelSaving; - SwMailMergeWizard* m_pWizard; + VclPtr<SwMailMergeWizard> m_pWizard; //some dialog data Printer* m_pTempPrinter; @@ -147,17 +147,17 @@ struct SwSendMailDialog_Impl; class SwMailMergeConfigItem; class SwSendMailDialog : public ModelessDialog //SfxModalDialog { - FixedText *m_pTransferStatus; - FixedText *m_pPaused; - ProgressBar *m_pProgressBar; - FixedText *m_pErrorStatus; + VclPtr<FixedText> m_pTransferStatus; + VclPtr<FixedText> m_pPaused; + VclPtr<ProgressBar> m_pProgressBar; + VclPtr<FixedText> m_pErrorStatus; - SvSimpleTableContainer *m_pContainer; - HeaderBar *m_pStatusHB; - SvSimpleTable *m_pStatus; + VclPtr<SvSimpleTableContainer> m_pContainer; + VclPtr<HeaderBar> m_pStatusHB; + VclPtr<SvSimpleTable> m_pStatus; - PushButton *m_pStop; - PushButton *m_pClose; + VclPtr<PushButton> m_pStop; + VclPtr<PushButton> m_pClose; OUString m_sContinue; OUString m_sStop; diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index cc4f519cd7f1..9ce000b6c072 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -48,6 +48,22 @@ SwMailMergeOutputTypePage::SwMailMergeOutputTypePage(SwMailMergeWizard* pParent) } +SwMailMergeOutputTypePage::~SwMailMergeOutputTypePage() +{ + dispose(); +} + +void SwMailMergeOutputTypePage::dispose() +{ + m_pLetterRB.clear(); + m_pMailRB.clear(); + m_pLetterHint.clear(); + m_pMailHint.clear(); + m_pWizard.clear(); + svt::OWizardPage::dispose(); +} + + IMPL_LINK_NOARG(SwMailMergeOutputTypePage, TypeHdl_Impl) { bool bLetter = m_pLetterRB->IsChecked(); @@ -123,7 +139,7 @@ const SwMailDescriptor* SwSendMailDialog_Impl::GetNextDescriptor() using namespace ::com::sun::star; class SwMailDispatcherListener_Impl : public IMailDispatcherListener { - SwSendMailDialog* m_pSendMailDialog; + VclPtr<SwSendMailDialog> m_pSendMailDialog; public: SwMailDispatcherListener_Impl(SwSendMailDialog& rParentDlg); @@ -208,9 +224,15 @@ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMa class SwSendWarningBox_Impl : public MessageDialog { - VclMultiLineEdit *m_pDetailED; + VclPtr<VclMultiLineEdit> m_pDetailED; public: SwSendWarningBox_Impl(vcl::Window* pParent, const OUString& rDetails); + virtual ~SwSendWarningBox_Impl() { dispose(); } + virtual void dispose() SAL_OVERRIDE + { + m_pDetailED.clear(); + MessageDialog::dispose(); + } }; SwSendWarningBox_Impl::SwSendWarningBox_Impl(vcl::Window* pParent, const OUString& rDetails) @@ -311,8 +333,16 @@ void SwSendMailDialog::dispose() { } } - delete m_pStatus; delete m_pImpl; + m_pStatus.clear(); + m_pTransferStatus.clear(); + m_pPaused.clear(); + m_pProgressBar.clear(); + m_pErrorStatus.clear(); + m_pContainer.clear(); + m_pStatusHB.clear(); + m_pStop.clear(); + m_pClose.clear(); ModelessDialog::dispose(); } diff --git a/sw/source/ui/dbui/mmoutputtypepage.hxx b/sw/source/ui/dbui/mmoutputtypepage.hxx index 81769f2b6863..9c967c05f7fb 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.hxx +++ b/sw/source/ui/dbui/mmoutputtypepage.hxx @@ -27,18 +27,20 @@ class SwMailMergeWizard; class SwMailMergeOutputTypePage : public svt::OWizardPage { - RadioButton* m_pLetterRB; - RadioButton* m_pMailRB; + VclPtr<RadioButton> m_pLetterRB; + VclPtr<RadioButton> m_pMailRB; - FixedText* m_pLetterHint; - FixedText* m_pMailHint; + VclPtr<FixedText> m_pLetterHint; + VclPtr<FixedText> m_pMailHint; - SwMailMergeWizard* m_pWizard; + VclPtr<SwMailMergeWizard> m_pWizard; DECL_LINK(TypeHdl_Impl, void *); public: SwMailMergeOutputTypePage( SwMailMergeWizard* _pParent); + virtual ~SwMailMergeOutputTypePage(); + virtual void dispose() SAL_OVERRIDE; }; #endif diff --git a/sw/source/ui/dbui/mmpreparemergepage.cxx b/sw/source/ui/dbui/mmpreparemergepage.cxx index 272ae0f6cb8e..d768c8842c95 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.cxx +++ b/sw/source/ui/dbui/mmpreparemergepage.cxx @@ -58,6 +58,24 @@ SwMailMergePrepareMergePage::SwMailMergePrepareMergePage( SwMailMergeWizard* _pP aMoveLink.Call(m_pRecordED); } +SwMailMergePrepareMergePage::~SwMailMergePrepareMergePage() +{ + dispose(); +} + +void SwMailMergePrepareMergePage::dispose() +{ + m_pFirstPB.clear(); + m_pPrevPB.clear(); + m_pRecordED.clear(); + m_pNextPB.clear(); + m_pLastPB.clear(); + m_pExcludeCB.clear(); + m_pEditPB.clear(); + m_pWizard.clear(); + svt::OWizardPage::dispose(); +} + IMPL_LINK_NOARG(SwMailMergePrepareMergePage, EditDocumentHdl_Impl) { m_pWizard->SetRestartPage(MM_PREPAREMERGEPAGE); diff --git a/sw/source/ui/dbui/mmpreparemergepage.hxx b/sw/source/ui/dbui/mmpreparemergepage.hxx index bdaef54ae3ff..8bfdfbe94158 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.hxx +++ b/sw/source/ui/dbui/mmpreparemergepage.hxx @@ -29,16 +29,16 @@ class SwMailMergeWizard; class SwMailMergePrepareMergePage : public svt::OWizardPage { - PushButton* m_pFirstPB; - PushButton* m_pPrevPB; - NumericField* m_pRecordED; - PushButton* m_pNextPB; - PushButton* m_pLastPB; - CheckBox* m_pExcludeCB; + VclPtr<PushButton> m_pFirstPB; + VclPtr<PushButton> m_pPrevPB; + VclPtr<NumericField> m_pRecordED; + VclPtr<PushButton> m_pNextPB; + VclPtr<PushButton> m_pLastPB; + VclPtr<CheckBox> m_pExcludeCB; - PushButton* m_pEditPB; + VclPtr<PushButton> m_pEditPB; - SwMailMergeWizard* m_pWizard; + VclPtr<SwMailMergeWizard> m_pWizard; DECL_LINK(EditDocumentHdl_Impl, void *); DECL_LINK(ExcludeHdl_Impl, CheckBox*); @@ -49,6 +49,8 @@ class SwMailMergePrepareMergePage : public svt::OWizardPage public: SwMailMergePrepareMergePage( SwMailMergeWizard* _pParent); + virtual ~SwMailMergePrepareMergePage(); + virtual void dispose() SAL_OVERRIDE; }; #endif diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx index ec74985f0875..c31485ad971c 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.cxx +++ b/sw/source/ui/dbui/selectdbtabledialog.cxx @@ -152,7 +152,8 @@ SwSelectDBTableDialog::~SwSelectDBTableDialog() void SwSelectDBTableDialog::dispose() { - delete m_pTable; + m_pTable.clear(); + m_pPreviewPB.clear(); SfxModalDialog::dispose(); } diff --git a/sw/source/ui/dbui/selectdbtabledialog.hxx b/sw/source/ui/dbui/selectdbtabledialog.hxx index 52c8c055fe0d..b02b74b2cb72 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.hxx +++ b/sw/source/ui/dbui/selectdbtabledialog.hxx @@ -35,8 +35,8 @@ class SwAddressTable; class SwSelectDBTableDialog : public SfxModalDialog { - SwAddressTable* m_pTable; - PushButton* m_pPreviewPB; + VclPtr<SwAddressTable> m_pTable; + VclPtr<PushButton> m_pPreviewPB; OUString m_sName; OUString m_sType; diff --git a/sw/source/ui/dialog/abstract.cxx b/sw/source/ui/dialog/abstract.cxx index f33577268b82..192da3c1db61 100644 --- a/sw/source/ui/dialog/abstract.cxx +++ b/sw/source/ui/dialog/abstract.cxx @@ -31,6 +31,18 @@ SwInsertAbstractDlg::SwInsertAbstractDlg(vcl::Window* pParent) get(m_pParaNF, "paras"); } +SwInsertAbstractDlg::~SwInsertAbstractDlg() +{ + dispose(); +} + +void SwInsertAbstractDlg::dispose() +{ + m_pLevelNF.clear(); + m_pParaNF.clear(); + SfxModalDialog::dispose(); +} + sal_uInt8 SwInsertAbstractDlg::GetLevel() const { return static_cast<sal_uInt8>(m_pLevelNF->GetValue() - 1); diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx index f097f0f89903..6960908454c5 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -242,8 +242,23 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh, SwAsciiFilterDlg::~SwAsciiFilterDlg() { + dispose(); } +void SwAsciiFilterDlg::dispose() +{ + m_pCharSetLB.clear(); + m_pFontFT.clear(); + m_pFontLB.clear(); + m_pLanguageFT.clear(); + m_pLanguageLB.clear(); + m_pCRLF_RB.clear(); + m_pCR_RB.clear(); + m_pLF_RB.clear(); + SfxModalDialog::dispose(); +} + + void SwAsciiFilterDlg::FillOptions( SwAsciiOptions& rOptions ) { sal_uLong nCCode = m_pCharSetLB->GetSelectTextEncoding(); diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx index 48ae2aa587d1..9e7612165935 100644 --- a/sw/source/ui/dialog/docstdlg.cxx +++ b/sw/source/ui/dialog/docstdlg.cxx @@ -73,8 +73,25 @@ SwDocStatPage::SwDocStatPage(vcl::Window *pParent, const SfxItemSet &rSet) } - SwDocStatPage::~SwDocStatPage() +SwDocStatPage::~SwDocStatPage() { + dispose(); +} + +void SwDocStatPage::dispose() +{ + m_pPageNo.clear(); + m_pTableNo.clear(); + m_pGrfNo.clear(); + m_pOLENo.clear(); + m_pParaNo.clear(); + m_pWordNo.clear(); + m_pCharNo.clear(); + m_pCharExclSpacesNo.clear(); + m_pLineLbl.clear(); + m_pLineNo.clear(); + m_pUpdatePB.clear(); + SfxTabPage::dispose(); } // Description: fill ItemSet when changed diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index a64cb0820089..a65a7cbccb6a 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -595,7 +595,6 @@ void AbstractSwWordCountFloatDlg_Impl::SetCounts(const SwDocStat &rCurrCnt, cons AbstractMailMergeWizard_Impl::~AbstractMailMergeWizard_Impl() { - delete pDlg; } void AbstractMailMergeWizard_Impl::StartExecuteModal( const Link& rEndDialogHdl ) diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 9e6ff470c404..ea38f7156601 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: \ - DialogClass* pDlg; \ + VclPtr<DialogClass> pDlg; \ public: \ Class( DialogClass* p) \ : pDlg(p) \ @@ -59,7 +59,6 @@ public: \ #define IMPL_ABSTDLG_BASE(Class) \ Class::~Class() \ { \ - delete pDlg; \ } \ short Class::Execute() \ { \ @@ -350,7 +349,7 @@ class AbstractAuthMarkFloatDlg_Impl : public AbstractMarkFloatDlg class SwMailMergeWizard; class AbstractMailMergeWizard_Impl : public AbstractMailMergeWizard { - SwMailMergeWizard* pDlg; + VclPtr<SwMailMergeWizard> pDlg; Link aEndDlgHdl; DECL_LINK( EndDialogHdl, SwMailMergeWizard* ); diff --git a/sw/source/ui/dialog/swmessdialog.cxx b/sw/source/ui/dialog/swmessdialog.cxx index 2e085f464686..a93e12a1de40 100644 --- a/sw/source/ui/dialog/swmessdialog.cxx +++ b/sw/source/ui/dialog/swmessdialog.cxx @@ -30,4 +30,19 @@ SwMessageAndEditDialog::SwMessageAndEditDialog(vcl::Window* pParent, const OUStr get(m_pEdit, "edit"); } +SwMessageAndEditDialog::~SwMessageAndEditDialog() +{ + dispose(); +} + +void SwMessageAndEditDialog::dispose() +{ + m_pOKPB.clear(); + m_pImageIM.clear(); + m_pPrimaryMessage.clear(); + m_pSecondaryMessage.clear(); + m_pEdit.clear(); + ModalDialog::dispose(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/swuiexp.cxx b/sw/source/ui/dialog/swuiexp.cxx index f90812fa4681..dbbac541e03a 100644 --- a/sw/source/ui/dialog/swuiexp.cxx +++ b/sw/source/ui/dialog/swuiexp.cxx @@ -18,7 +18,32 @@ */ #include "swdlgfact.hxx" + +#include "abstract.hxx" +#include "ascfldlg.hxx" +#include "break.hxx" +#include "convert.hxx" #include "dialmgr.hxx" +#include "dbinsdlg.hxx" +#include "DropDownFieldDialog.hxx" +#include "fldtdlg.hxx" +#include "glossary.hxx" +#include "inpdlg.hxx" +#include "insfnote.hxx" +#include "instable.hxx" +#include "javaedit.hxx" +#include "label.hxx" +#include "mailmrge.hxx" +#include "mailmergewizard.hxx" +#include "regionsw.hxx" +#include "selglos.hxx" +#include "splittbl.hxx" +#include "tautofmt.hxx" +#include "swmodalredlineacceptdlg.hxx" +#include "swrenamexnameddlg.hxx" +#include "swuiidxmrk.hxx" +#include "swuicnttab.hxx" +#include "wordcountdialog.hxx" #include <swuiexp.hxx> namespace swui diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 8d16c7aae2df..6896f5c9b457 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -529,6 +529,28 @@ void SwEditRegionDlg::dispose() } delete m_pDocInserter; + m_pCurName.clear(); + m_pTree.clear(); + m_pFileCB.clear(); + m_pDDECB.clear(); + m_pDDEFrame.clear(); + m_pFileNameFT.clear(); + m_pDDECommandFT.clear(); + m_pFileNameED.clear(); + m_pFilePB.clear(); + m_pSubRegionFT.clear(); + m_pSubRegionED.clear(); + m_pProtectCB.clear(); + m_pPasswdCB.clear(); + m_pPasswdPB.clear(); + m_pHideCB.clear(); + m_pConditionFT.clear(); + m_pConditionED.clear(); + m_pEditInReadonlyCB.clear(); + m_pOK.clear(); + m_pOptionsPB.clear(); + m_pDismiss.clear(); + m_pOldDefDlgParent.clear(); SfxModalDialog::dispose(); } @@ -1545,6 +1567,23 @@ SwInsertSectionTabPage::~SwInsertSectionTabPage() void SwInsertSectionTabPage::dispose() { delete m_pDocInserter; + m_pCurName.clear(); + m_pFileCB.clear(); + m_pDDECB.clear(); + m_pDDECommandFT.clear(); + m_pFileNameFT.clear(); + m_pFileNameED.clear(); + m_pFilePB.clear(); + m_pSubRegionFT.clear(); + m_pSubRegionED.clear(); + m_pProtectCB.clear(); + m_pPasswdCB.clear(); + m_pPasswdPB.clear(); + m_pHideCB.clear(); + m_pConditionFT.clear(); + m_pConditionED.clear(); + m_pEditInReadonlyCB.clear(); + m_pOldDefDlgParent.clear(); SfxTabPage::dispose(); } @@ -1847,6 +1886,32 @@ SwSectionFtnEndTabPage::SwSectionFtnEndTabPage( vcl::Window *pParent, SwSectionFtnEndTabPage::~SwSectionFtnEndTabPage() { + dispose(); +} + +void SwSectionFtnEndTabPage::dispose() +{ + pFtnNtAtTextEndCB.clear(); + pFtnNtNumCB.clear(); + pFtnOffsetLbl.clear(); + pFtnOffsetFld.clear(); + pFtnNtNumFmtCB.clear(); + pFtnPrefixFT.clear(); + pFtnPrefixED.clear(); + pFtnNumViewBox.clear(); + pFtnSuffixFT.clear(); + pFtnSuffixED.clear(); + pEndNtAtTextEndCB.clear(); + pEndNtNumCB.clear(); + pEndOffsetLbl.clear(); + pEndOffsetFld.clear(); + pEndNtNumFmtCB.clear(); + pEndPrefixFT.clear(); + pEndPrefixED.clear(); + pEndNumViewBox.clear(); + pEndSuffixFT.clear(); + pEndSuffixED.clear(); + SfxTabPage::dispose(); } bool SwSectionFtnEndTabPage::FillItemSet( SfxItemSet* rSet ) @@ -2108,6 +2173,15 @@ SwSectionIndentTabPage::SwSectionIndentTabPage(vcl::Window *pParent, const SfxIt SwSectionIndentTabPage::~SwSectionIndentTabPage() { + dispose(); +} + +void SwSectionIndentTabPage::dispose() +{ + m_pBeforeMF.clear(); + m_pAfterMF.clear(); + m_pPreviewWin.clear(); + SfxTabPage::dispose(); } bool SwSectionIndentTabPage::FillItemSet( SfxItemSet* rSet) diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx index 9f5f562c3990..8f0ff7daaefa 100644 --- a/sw/source/ui/dialog/wordcountdialog.cxx +++ b/sw/source/ui/dialog/wordcountdialog.cxx @@ -52,6 +52,19 @@ SwWordCountFloatDlg::~SwWordCountFloatDlg() void SwWordCountFloatDlg::dispose() { SwViewShell::SetCareWin( 0 ); + m_pCurrentWordFT.clear(); + m_pCurrentCharacterFT.clear(); + m_pCurrentCharacterExcludingSpacesFT.clear(); + m_pCurrentCjkcharsFT.clear(); + m_pCurrentStandardizedPagesFT.clear(); + m_pDocWordFT.clear(); + m_pDocCharacterFT.clear(); + m_pDocCharacterExcludingSpacesFT.clear(); + m_pDocCjkcharsFT.clear(); + m_pDocStandardizedPagesFT.clear(); + m_pCjkcharsLabelFT.clear(); + m_pStandardizedPagesLabelFT.clear(); + m_pClosePB.clear(); SfxModelessDialog::dispose(); } diff --git a/sw/source/ui/dochdl/selglos.cxx b/sw/source/ui/dochdl/selglos.cxx index 5cdc698f750d..5809ab2c5667 100644 --- a/sw/source/ui/dochdl/selglos.cxx +++ b/sw/source/ui/dochdl/selglos.cxx @@ -35,6 +35,17 @@ SwSelGlossaryDlg::SwSelGlossaryDlg(vcl::Window * pParent, const OUString &rShort m_pGlosBox->SetDoubleClickHdl(LINK(this, SwSelGlossaryDlg, DoubleClickHdl)); } +SwSelGlossaryDlg::~SwSelGlossaryDlg() +{ + dispose(); +} + +void SwSelGlossaryDlg::dispose() +{ + m_pGlosBox.clear(); + ModalDialog::dispose(); +} + IMPL_LINK(SwSelGlossaryDlg, DoubleClickHdl, ListBox*, /*pBox*/) { EndDialog(RET_OK); diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index a18dd071692e..943aa0b3c298 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -197,6 +197,27 @@ SwEnvFmtPage::SwEnvFmtPage(vcl::Window* pParent, const SfxItemSet& rSet) } +SwEnvFmtPage::~SwEnvFmtPage() +{ + dispose(); +} + +void SwEnvFmtPage::dispose() +{ + m_pAddrLeftField.clear(); + m_pAddrTopField.clear(); + m_pAddrEditButton.clear(); + m_pSendLeftField.clear(); + m_pSendTopField.clear(); + m_pSendEditButton.clear(); + m_pSizeFormatBox.clear(); + m_pSizeWidthField.clear(); + m_pSizeHeightField.clear(); + m_pPreview.clear(); + SfxTabPage::dispose(); +} + + IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit ) { long lWVal = static_cast< long >(GetFldVal(*m_pSizeWidthField )); diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx index 0d89e4f79d3e..6a0b09635daa 100644 --- a/sw/source/ui/envelp/envfmt.hxx +++ b/sw/source/ui/envelp/envfmt.hxx @@ -30,16 +30,16 @@ class SwTxtFmtColl; class SwEnvFmtPage : public SfxTabPage { - MetricField* m_pAddrLeftField; - MetricField* m_pAddrTopField; - MenuButton* m_pAddrEditButton; - MetricField* m_pSendLeftField; - MetricField* m_pSendTopField; - MenuButton* m_pSendEditButton; - ListBox* m_pSizeFormatBox; - MetricField* m_pSizeWidthField; - MetricField* m_pSizeHeightField; - SwEnvPreview* m_pPreview; + VclPtr<MetricField> m_pAddrLeftField; + VclPtr<MetricField> m_pAddrTopField; + VclPtr<MenuButton> m_pAddrEditButton; + VclPtr<MetricField> m_pSendLeftField; + VclPtr<MetricField> m_pSendTopField; + VclPtr<MenuButton> m_pSendEditButton; + VclPtr<ListBox> m_pSizeFormatBox; + VclPtr<MetricField> m_pSizeWidthField; + VclPtr<MetricField> m_pSizeHeightField; + VclPtr<SwEnvPreview> m_pPreview; std::vector<sal_uInt16> aIDs; @@ -59,6 +59,8 @@ class SwEnvFmtPage : public SfxTabPage using TabPage::DeactivatePage; public: + virtual ~SwEnvFmtPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet); diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index edaab64b424d..b0df406c14d0 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -235,6 +235,20 @@ SwEnvPage::SwEnvPage(vcl::Window* pParent, const SfxItemSet& rSet) SwEnvPage::~SwEnvPage() { + dispose(); +} + +void SwEnvPage::dispose() +{ + m_pAddrEdit.clear(); + m_pDatabaseLB.clear(); + m_pTableLB.clear(); + m_pDBFieldLB.clear(); + m_pInsertBT.clear(); + m_pSenderBox.clear(); + m_pSenderEdit.clear(); + m_pPreview.clear(); + SfxTabPage::dispose(); } IMPL_LINK( SwEnvPage, DatabaseHdl, ListBox *, pListBox ) diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx index 288884a9a2d2..02c99db21905 100644 --- a/sw/source/ui/envelp/envprt.cxx +++ b/sw/source/ui/envelp/envprt.cxx @@ -67,6 +67,23 @@ SwEnvPrtPage::SwEnvPrtPage(vcl::Window* pParent, const SfxItemSet& rSet) m_aIds[ENV_VER_RGHT] = m_pAlignBox->GetItemId("vertright"); } +SwEnvPrtPage::~SwEnvPrtPage() +{ + dispose(); +} + +void SwEnvPrtPage::dispose() +{ + m_pAlignBox.clear(); + m_pTopButton.clear(); + m_pBottomButton.clear(); + m_pRightField.clear(); + m_pDownField.clear(); + m_pPrinterInfo.clear(); + m_pPrtSetup.clear(); + SfxTabPage::dispose(); +} + IMPL_LINK_NOARG(SwEnvPrtPage, ClickHdl) { if (m_pBottomButton->IsChecked()) diff --git a/sw/source/ui/envelp/envprt.hxx b/sw/source/ui/envelp/envprt.hxx index bee494477667..e0f37dff6eef 100644 --- a/sw/source/ui/envelp/envprt.hxx +++ b/sw/source/ui/envelp/envprt.hxx @@ -35,13 +35,13 @@ class SwEnvDlg; class SwEnvPrtPage : public SfxTabPage { - ToolBox* m_pAlignBox; - RadioButton* m_pTopButton; - RadioButton* m_pBottomButton; - MetricField* m_pRightField; - MetricField* m_pDownField; - FixedText* m_pPrinterInfo; - PushButton* m_pPrtSetup; + VclPtr<ToolBox> m_pAlignBox; + VclPtr<RadioButton> m_pTopButton; + VclPtr<RadioButton> m_pBottomButton; + VclPtr<MetricField> m_pRightField; + VclPtr<MetricField> m_pDownField; + VclPtr<FixedText> m_pPrinterInfo; + VclPtr<PushButton> m_pPrtSetup; sal_uInt16 m_aIds[ENV_VER_RGHT-ENV_HOR_LEFT+1]; @@ -59,6 +59,8 @@ class SwEnvPrtPage : public SfxTabPage using TabPage::DeactivatePage; public: + virtual ~SwEnvPrtPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet); diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index 5f163c79f4ae..c91582b3a92c 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -176,6 +176,7 @@ SwLabDlg::~SwLabDlg() void SwLabDlg::dispose() { delete pRecs; + pPrtPage.clear(); SfxTabDialog::dispose(); } @@ -292,6 +293,29 @@ SwLabPage::SwLabPage(vcl::Window* pParent, const SfxItemSet& rSet) m_pMakeBox->GetSelectHdl().Call(m_pMakeBox); } +SwLabPage::~SwLabPage() +{ + dispose(); +} + +void SwLabPage::dispose() +{ + m_pAddressFrame.clear(); + m_pAddrBox.clear(); + m_pWritingEdit.clear(); + m_pDatabaseLB.clear(); + m_pTableLB.clear(); + m_pInsertBT.clear(); + m_pDBFieldLB.clear(); + m_pContButton.clear(); + m_pSheetButton.clear(); + m_pMakeBox.clear(); + m_pTypeBox.clear(); + m_pHiddenSortTypeBox.clear(); + m_pFormatInfo.clear(); + SfxTabPage::dispose(); +} + void SwLabPage::SetToBusinessCard() { SetHelpId(HID_BUSINESS_FMT_PAGE); @@ -603,6 +627,9 @@ void SwVisitingCardPage::dispose() ClearUserData(); delete pExampleFrame; + m_pAutoTextLB.clear(); + m_pAutoTextGroupLB.clear(); + m_pExampleWIN.clear(); SfxTabPage::dispose(); } @@ -739,6 +766,34 @@ SwPrivateDataPage::SwPrivateDataPage(vcl::Window* pParent, const SfxItemSet& rSe SetExchangeSupport(); } +SwPrivateDataPage::~SwPrivateDataPage() +{ + dispose(); +} + +void SwPrivateDataPage::dispose() +{ + m_pFirstNameED.clear(); + m_pNameED.clear(); + m_pShortCutED.clear(); + m_pFirstName2ED.clear(); + m_pName2ED.clear(); + m_pShortCut2ED.clear(); + m_pStreetED.clear(); + m_pZipED.clear(); + m_pCityED.clear(); + m_pCountryED.clear(); + m_pStateED.clear(); + m_pTitleED.clear(); + m_pProfessionED.clear(); + m_pPhoneED.clear(); + m_pMobilePhoneED.clear(); + m_pFaxED.clear(); + m_pHomePageED.clear(); + m_pMailED.clear(); + SfxTabPage::dispose(); +} + SfxTabPage* SwPrivateDataPage::Create(vcl::Window* pParent, const SfxItemSet* rSet) { return new SwPrivateDataPage(pParent, *rSet); @@ -827,6 +882,31 @@ SwBusinessDataPage::SwBusinessDataPage(vcl::Window* pParent, const SfxItemSet& r SetExchangeSupport(); } +SwBusinessDataPage::~SwBusinessDataPage() +{ + dispose(); +} + +void SwBusinessDataPage::dispose() +{ + m_pCompanyED.clear(); + m_pCompanyExtED.clear(); + m_pSloganED.clear(); + m_pStreetED.clear(); + m_pZipED.clear(); + m_pCityED.clear(); + m_pCountryED.clear(); + m_pStateED.clear(); + m_pPositionED.clear(); + m_pPhoneED.clear(); + m_pMobilePhoneED.clear(); + m_pFaxED.clear(); + m_pHomePageED.clear(); + m_pMailED.clear(); + SfxTabPage::dispose(); +} + + SfxTabPage* SwBusinessDataPage::Create(vcl::Window* pParent, const SfxItemSet* rSet) { return new SwBusinessDataPage(pParent, *rSet); diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index f0ce86273f93..0b2a826bfedf 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -353,8 +353,29 @@ SwLabFmtPage::SwLabFmtPage(vcl::Window* pParent, const SfxItemSet& rSet) SwLabFmtPage::~SwLabFmtPage() { + dispose(); } +void SwLabFmtPage::dispose() +{ + m_pMakeFI.clear(); + m_pTypeFI.clear(); + m_pPreview.clear(); + m_pHDistField.clear(); + m_pVDistField.clear(); + m_pWidthField.clear(); + m_pHeightField.clear(); + m_pLeftField.clear(); + m_pUpperField.clear(); + m_pColsField.clear(); + m_pRowsField.clear(); + m_pPWidthField.clear(); + m_pPHeightField.clear(); + m_pSavePB.clear(); + SfxTabPage::dispose(); +} + + // Modify-handler of MetricFields. start preview timer IMPL_LINK_NOARG_INLINE_START(SwLabFmtPage, ModifyHdl) { @@ -600,6 +621,20 @@ SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec) } } +SwSaveLabelDlg::~SwSaveLabelDlg() +{ + dispose(); +} + +void SwSaveLabelDlg::dispose() +{ + m_pMakeCB.clear(); + m_pTypeED.clear(); + m_pOKPB.clear(); + pLabPage.clear(); + ModalDialog::dispose(); +} + IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl) { SwLabelConfig& rCfg = pLabPage->GetParentSwLabDlg()->GetLabelsConfig(); diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx index 13dc53353229..1606ccd9ea27 100644 --- a/sw/source/ui/envelp/labfmt.hxx +++ b/sw/source/ui/envelp/labfmt.hxx @@ -69,20 +69,20 @@ public: class SwLabFmtPage : public SfxTabPage { - FixedText* m_pMakeFI; - FixedText* m_pTypeFI; - SwLabPreview* m_pPreview; - MetricField* m_pHDistField; - MetricField* m_pVDistField; - MetricField* m_pWidthField; - MetricField* m_pHeightField; - MetricField* m_pLeftField; - MetricField* m_pUpperField; - NumericField* m_pColsField; - NumericField* m_pRowsField; - MetricField* m_pPWidthField; - MetricField* m_pPHeightField; - PushButton* m_pSavePB; + VclPtr<FixedText> m_pMakeFI; + VclPtr<FixedText> m_pTypeFI; + VclPtr<SwLabPreview> m_pPreview; + VclPtr<MetricField> m_pHDistField; + VclPtr<MetricField> m_pVDistField; + VclPtr<MetricField> m_pWidthField; + VclPtr<MetricField> m_pHeightField; + VclPtr<MetricField> m_pLeftField; + VclPtr<MetricField> m_pUpperField; + VclPtr<NumericField> m_pColsField; + VclPtr<NumericField> m_pRowsField; + VclPtr<MetricField> m_pPWidthField; + VclPtr<MetricField> m_pPHeightField; + VclPtr<PushButton> m_pSavePB; Idle aPreviewIdle; bool bModified; @@ -90,7 +90,6 @@ class SwLabFmtPage : public SfxTabPage SwLabItem aItem; SwLabFmtPage(vcl::Window* pParent, const SfxItemSet& rSet); - virtual ~SwLabFmtPage(); DECL_LINK(ModifyHdl, void *); DECL_LINK(PreviewHdl, void *); @@ -103,6 +102,8 @@ class SwLabFmtPage : public SfxTabPage using TabPage::DeactivatePage; public: + virtual ~SwLabFmtPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet); @@ -117,12 +118,12 @@ public: class SwSaveLabelDlg : public ModalDialog { - ComboBox* m_pMakeCB; - Edit* m_pTypeED; - OKButton* m_pOKPB; + VclPtr<ComboBox> m_pMakeCB; + VclPtr<Edit> m_pTypeED; + VclPtr<OKButton> m_pOKPB; bool bSuccess; - SwLabFmtPage* pLabPage; + VclPtr<SwLabFmtPage> pLabPage; SwLabRec& rLabRec; DECL_LINK(OkHdl, void *); @@ -130,6 +131,8 @@ class SwSaveLabelDlg : public ModalDialog public: SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec); + virtual ~SwSaveLabelDlg(); + virtual void dispose() SAL_OVERRIDE; void SetLabel(const OUString& rMake, const OUString& rType) { diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx index dab2e8ac8e42..c52b88f07885 100644 --- a/sw/source/ui/envelp/labprt.cxx +++ b/sw/source/ui/envelp/labprt.cxx @@ -68,6 +68,15 @@ SwLabPrtPage::~SwLabPrtPage() void SwLabPrtPage::dispose() { delete pPrinter; + m_pPageButton.clear(); + m_pSingleButton.clear(); + m_pSingleGrid.clear(); + m_pPrinterFrame.clear(); + m_pColField.clear(); + m_pRowField.clear(); + m_pSynchronCB.clear(); + m_pPrinterInfo.clear(); + m_pPrtSetup.clear(); SfxTabPage::dispose(); } diff --git a/sw/source/ui/envelp/labprt.hxx b/sw/source/ui/envelp/labprt.hxx index ee0bf43f1602..1953c29ffceb 100644 --- a/sw/source/ui/envelp/labprt.hxx +++ b/sw/source/ui/envelp/labprt.hxx @@ -33,20 +33,18 @@ class SwLabPrtPage : public SfxTabPage { Printer* pPrinter; // for the shaft setting - unfortunately - RadioButton* m_pPageButton; - RadioButton* m_pSingleButton; - VclContainer* m_pSingleGrid; - VclContainer* m_pPrinterFrame; - NumericField* m_pColField; - NumericField* m_pRowField; - CheckBox* m_pSynchronCB; + VclPtr<RadioButton> m_pPageButton; + VclPtr<RadioButton> m_pSingleButton; + VclPtr<VclContainer> m_pSingleGrid; + VclPtr<VclContainer> m_pPrinterFrame; + VclPtr<NumericField> m_pColField; + VclPtr<NumericField> m_pRowField; + VclPtr<CheckBox> m_pSynchronCB; - FixedText* m_pPrinterInfo; - PushButton* m_pPrtSetup; + VclPtr<FixedText> m_pPrinterInfo; + VclPtr<PushButton> m_pPrtSetup; SwLabPrtPage(vcl::Window* pParent, const SfxItemSet& rSet); - virtual ~SwLabPrtPage(); - virtual void dispose() SAL_OVERRIDE; DECL_LINK( CountHdl, Button * ); @@ -56,6 +54,8 @@ class SwLabPrtPage : public SfxTabPage using TabPage::DeactivatePage; public: + virtual ~SwLabPrtPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet); diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index 315f0965c65c..e7f9173940cc 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -406,6 +406,38 @@ void SwMailMergeDlg::dispose() delete pData; } delete pImpl; + m_pBeamerWin.clear(); + m_pAllRB.clear(); + m_pMarkedRB.clear(); + m_pFromRB.clear(); + m_pFromNF.clear(); + m_pToNF.clear(); + m_pPrinterRB.clear(); + m_pMailingRB.clear(); + m_pFileRB.clear(); + m_pSingleJobsCB.clear(); + m_pSaveMergedDocumentFT.clear(); + m_pSaveSingleDocRB.clear(); + m_pSaveIndividualRB.clear(); + m_pGenerateFromDataBaseCB.clear(); + m_pColumnFT.clear(); + m_pColumnLB.clear(); + m_pPathFT.clear(); + m_pPathED.clear(); + m_pPathPB.clear(); + m_pFilterFT.clear(); + m_pFilterLB.clear(); + m_pAddressFldLB.clear(); + m_pSubjectFT.clear(); + m_pSubjectED.clear(); + m_pFormatFT.clear(); + m_pAttachFT.clear(); + m_pAttachED.clear(); + m_pAttachPB.clear(); + m_pFormatHtmlCB.clear(); + m_pFormatRtfCB.clear(); + m_pFormatSwCB.clear(); + m_pOkBTN.clear(); SvxStandardDialog::dispose(); } @@ -639,6 +671,17 @@ SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(vcl::Window* pParent) get(m_pThisDocRB, "document"); } +SwMailMergeCreateFromDlg::~SwMailMergeCreateFromDlg() +{ + dispose(); +} + +void SwMailMergeCreateFromDlg::dispose() +{ + m_pThisDocRB.clear(); + ModalDialog::dispose(); +} + SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(vcl::Window* pParent) : ModalDialog(pParent, "MergeConnectDialog", "modules/swriter/ui/mergeconnectdialog.ui") @@ -646,4 +689,15 @@ SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(vcl::Window* pPar get(m_pUseExistingRB, "existing"); } +SwMailMergeFieldConnectionsDlg::~SwMailMergeFieldConnectionsDlg() +{ + dispose(); +} + +void SwMailMergeFieldConnectionsDlg::dispose() +{ + m_pUseExistingRB.clear(); + ModalDialog::dispose(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx index 126c1a752793..f6ca588c7045 100644 --- a/sw/source/ui/envelp/swuilabimp.hxx +++ b/sw/source/ui/envelp/swuilabimp.hxx @@ -29,21 +29,21 @@ class SwLabPage : public SfxTabPage OUString sActDBName; SwLabItem aItem; - VclContainer* m_pAddressFrame; - - CheckBox* m_pAddrBox; - VclMultiLineEdit* m_pWritingEdit; - ListBox* m_pDatabaseLB; - ListBox* m_pTableLB; - PushButton* m_pInsertBT; - ListBox* m_pDBFieldLB; - - RadioButton* m_pContButton; - RadioButton* m_pSheetButton; - ListBox* m_pMakeBox; - ListBox* m_pTypeBox; - ListBox* m_pHiddenSortTypeBox; - FixedText* m_pFormatInfo; + VclPtr<VclContainer> m_pAddressFrame; + + VclPtr<CheckBox> m_pAddrBox; + VclPtr<VclMultiLineEdit> m_pWritingEdit; + VclPtr<ListBox> m_pDatabaseLB; + VclPtr<ListBox> m_pTableLB; + VclPtr<PushButton> m_pInsertBT; + VclPtr<ListBox> m_pDBFieldLB; + + VclPtr<RadioButton> m_pContButton; + VclPtr<RadioButton> m_pSheetButton; + VclPtr<ListBox> m_pMakeBox; + VclPtr<ListBox> m_pTypeBox; + VclPtr<ListBox> m_pHiddenSortTypeBox; + VclPtr<FixedText> m_pFormatInfo; bool m_bLabel; @@ -63,6 +63,8 @@ class SwLabPage : public SfxTabPage using TabPage::DeactivatePage; public: + virtual ~SwLabPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet); @@ -84,9 +86,9 @@ public: class SwOneExampleFrame; class SwVisitingCardPage : public SfxTabPage { - SvTreeListBox* m_pAutoTextLB; - ListBox* m_pAutoTextGroupLB; - vcl::Window* m_pExampleWIN; + VclPtr<SvTreeListBox> m_pAutoTextLB; + VclPtr<ListBox> m_pAutoTextGroupLB; + VclPtr<vcl::Window> m_pExampleWIN; OUString sTempURL; @@ -127,26 +129,26 @@ public: class SwPrivateDataPage : public SfxTabPage { - Edit* m_pFirstNameED; - Edit* m_pNameED; - Edit* m_pShortCutED; - - Edit* m_pFirstName2ED; - Edit* m_pName2ED; - Edit* m_pShortCut2ED; - - Edit* m_pStreetED; - Edit* m_pZipED; - Edit* m_pCityED; - Edit* m_pCountryED; - Edit* m_pStateED; - Edit* m_pTitleED; - Edit* m_pProfessionED; - Edit* m_pPhoneED; - Edit* m_pMobilePhoneED; - Edit* m_pFaxED; - Edit* m_pHomePageED; - Edit* m_pMailED; + VclPtr<Edit> m_pFirstNameED; + VclPtr<Edit> m_pNameED; + VclPtr<Edit> m_pShortCutED; + + VclPtr<Edit> m_pFirstName2ED; + VclPtr<Edit> m_pName2ED; + VclPtr<Edit> m_pShortCut2ED; + + VclPtr<Edit> m_pStreetED; + VclPtr<Edit> m_pZipED; + VclPtr<Edit> m_pCityED; + VclPtr<Edit> m_pCountryED; + VclPtr<Edit> m_pStateED; + VclPtr<Edit> m_pTitleED; + VclPtr<Edit> m_pProfessionED; + VclPtr<Edit> m_pPhoneED; + VclPtr<Edit> m_pMobilePhoneED; + VclPtr<Edit> m_pFaxED; + VclPtr<Edit> m_pHomePageED; + VclPtr<Edit> m_pMailED; SwPrivateDataPage(vcl::Window* pParent, const SfxItemSet& rSet); @@ -154,6 +156,8 @@ class SwPrivateDataPage : public SfxTabPage using TabPage::DeactivatePage; public: + virtual ~SwPrivateDataPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet); @@ -165,24 +169,24 @@ public: class SwBusinessDataPage : public SfxTabPage { - Edit* m_pCompanyED; - Edit* m_pCompanyExtED; - Edit* m_pSloganED; + VclPtr<Edit> m_pCompanyED; + VclPtr<Edit> m_pCompanyExtED; + VclPtr<Edit> m_pSloganED; - Edit* m_pStreetED; - Edit* m_pZipED; - Edit* m_pCityED; - Edit* m_pCountryED; - Edit* m_pStateED; + VclPtr<Edit> m_pStreetED; + VclPtr<Edit> m_pZipED; + VclPtr<Edit> m_pCityED; + VclPtr<Edit> m_pCountryED; + VclPtr<Edit> m_pStateED; - Edit* m_pPositionED; + VclPtr<Edit> m_pPositionED; - Edit* m_pPhoneED; - Edit* m_pMobilePhoneED; - Edit* m_pFaxED; + VclPtr<Edit> m_pPhoneED; + VclPtr<Edit> m_pMobilePhoneED; + VclPtr<Edit> m_pFaxED; - Edit* m_pHomePageED; - Edit* m_pMailED; + VclPtr<Edit> m_pHomePageED; + VclPtr<Edit> m_pMailED; SwBusinessDataPage(vcl::Window* pParent, const SfxItemSet& rSet); @@ -190,6 +194,8 @@ class SwBusinessDataPage : public SfxTabPage using TabPage::DeactivatePage; public: + virtual ~SwBusinessDataPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet); diff --git a/sw/source/ui/fldui/DropDownFieldDialog.cxx b/sw/source/ui/fldui/DropDownFieldDialog.cxx index fce5029d6e32..13453cadb517 100644 --- a/sw/source/ui/fldui/DropDownFieldDialog.cxx +++ b/sw/source/ui/fldui/DropDownFieldDialog.cxx @@ -71,6 +71,20 @@ sw::DropDownFieldDialog::DropDownFieldDialog(vcl::Window *pParent, SwWrtShell &r m_pListItemsLB->GrabFocus(); } +sw::DropDownFieldDialog::~DropDownFieldDialog() +{ + dispose(); +} + +void sw::DropDownFieldDialog::dispose() +{ + m_pListItemsLB.clear(); + m_pOKPB.clear(); + m_pNextPB.clear(); + m_pEditPB.clear(); + SvxStandardDialog::dispose(); +} + void sw::DropDownFieldDialog::Apply() { if(pDropField) diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx index a2a9c7c1e6b6..224f56b9184e 100644 --- a/sw/source/ui/fldui/changedb.cxx +++ b/sw/source/ui/fldui/changedb.cxx @@ -170,6 +170,11 @@ SwChangeDBDlg::~SwChangeDBDlg() void SwChangeDBDlg::dispose() { delete pMgr; + m_pUsedDBTLB.clear(); + m_pAvailDBTLB.clear(); + m_pAddDBPB.clear(); + m_pDocDBNameFT.clear(); + m_pDefineBT.clear(); SvxStandardDialog::dispose(); } diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index a2af66a9d61a..5faa704ee43c 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -74,6 +74,24 @@ SwFldDBPage::SwFldDBPage(vcl::Window* pParent, const SfxItemSet& rCoreSet) SwFldDBPage::~SwFldDBPage() { + dispose(); +} + +void SwFldDBPage::dispose() +{ + m_pTypeLB.clear(); + m_pDatabaseTLB.clear(); + m_pAddDBPB.clear(); + m_pCondition.clear(); + m_pConditionED.clear(); + m_pValue.clear(); + m_pValueED.clear(); + m_pDBFormatRB.clear(); + m_pNewFormatRB.clear(); + m_pNumFormatLB.clear(); + m_pFormatLB.clear(); + m_pFormat.clear(); + SwFldPage::dispose(); } // initialise TabPage diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx index 6163cb9566d3..a54efb90095d 100644 --- a/sw/source/ui/fldui/flddb.hxx +++ b/sw/source/ui/fldui/flddb.hxx @@ -32,20 +32,20 @@ class SwFldDBPage : public SwFldPage { - ListBox* m_pTypeLB; - SwDBTreeList* m_pDatabaseTLB; + VclPtr<ListBox> m_pTypeLB; + VclPtr<SwDBTreeList> m_pDatabaseTLB; - PushButton* m_pAddDBPB; + VclPtr<PushButton> m_pAddDBPB; - VclContainer* m_pCondition; - ConditionEdit* m_pConditionED; - VclContainer* m_pValue; - Edit* m_pValueED; - RadioButton* m_pDBFormatRB; - RadioButton* m_pNewFormatRB; - NumFormatListBox* m_pNumFormatLB; - ListBox* m_pFormatLB; - VclContainer* m_pFormat; + VclPtr<VclContainer> m_pCondition; + VclPtr<ConditionEdit> m_pConditionED; + VclPtr<VclContainer> m_pValue; + VclPtr<Edit> m_pValueED; + VclPtr<RadioButton> m_pDBFormatRB; + VclPtr<RadioButton> m_pNewFormatRB; + VclPtr<NumFormatListBox> m_pNumFormatLB; + VclPtr<ListBox> m_pFormatLB; + VclPtr<VclContainer> m_pFormat; OUString m_sOldDBName; OUString m_sOldTableName; @@ -71,6 +71,7 @@ public: SwFldDBPage(vcl::Window* pParent, const SfxItemSet& rSet); virtual ~SwFldDBPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rAttrSet); diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index 1655f570b768..58a9fd04a051 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -89,6 +89,18 @@ SwFldDokInfPage::SwFldDokInfPage(vcl::Window* pParent, const SfxItemSet& rCoreSe SwFldDokInfPage::~SwFldDokInfPage() { + dispose(); +} + +void SwFldDokInfPage::dispose() +{ + m_pTypeTLB.clear(); + m_pSelection.clear(); + m_pSelectionLB.clear(); + m_pFormat.clear(); + m_pFormatLB.clear(); + m_pFixedCB.clear(); + SwFldPage::dispose(); } void SwFldDokInfPage::Reset(const SfxItemSet* ) diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx index 596d3bc2d3b7..5b7f44451a4d 100644 --- a/sw/source/ui/fldui/flddinf.hxx +++ b/sw/source/ui/fldui/flddinf.hxx @@ -36,12 +36,12 @@ namespace com{namespace sun{ namespace star{ namespace beans{ class SwFldDokInfPage : public SwFldPage { - SvTreeListBox* m_pTypeTLB; - VclContainer* m_pSelection; - ListBox* m_pSelectionLB; - VclContainer* m_pFormat; - NumFormatListBox* m_pFormatLB; - CheckBox* m_pFixedCB; + VclPtr<SvTreeListBox> m_pTypeTLB; + VclPtr<VclContainer> m_pSelection; + VclPtr<ListBox> m_pSelectionLB; + VclPtr<VclContainer> m_pFormat; + VclPtr<NumFormatListBox> m_pFormatLB; + VclPtr<CheckBox> m_pFixedCB; SvTreeListEntry* pSelEntry; com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > xCustomPropertySet; @@ -62,6 +62,7 @@ public: SwFldDokInfPage(vcl::Window* pWindow, const SfxItemSet& rSet); virtual ~SwFldDokInfPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rAttrSet); diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index ea3ec74a5bb9..18df09e769c6 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -80,8 +80,29 @@ SwFldDokPage::SwFldDokPage(vcl::Window* pParent, const SfxItemSet& rCoreSet ) SwFldDokPage::~SwFldDokPage() { + dispose(); } +void SwFldDokPage::dispose() +{ + m_pTypeLB.clear(); + m_pSelection.clear(); + m_pSelectionLB.clear(); + m_pValueFT.clear(); + m_pValueED.clear(); + m_pLevelFT.clear(); + m_pLevelED.clear(); + m_pDateFT.clear(); + m_pTimeFT.clear(); + m_pDateOffsetED.clear(); + m_pFormat.clear(); + m_pFormatLB.clear(); + m_pNumFormatLB.clear(); + m_pFixedCB.clear(); + SwFldPage::dispose(); +} + + void SwFldDokPage::Reset(const SfxItemSet* ) { SavePos(m_pTypeLB); diff --git a/sw/source/ui/fldui/flddok.hxx b/sw/source/ui/fldui/flddok.hxx index 4e8abc27e2b0..ab98dc558cd3 100644 --- a/sw/source/ui/fldui/flddok.hxx +++ b/sw/source/ui/fldui/flddok.hxx @@ -32,20 +32,20 @@ class SwFldDokPage : public SwFldPage { - ListBox* m_pTypeLB; - VclContainer* m_pSelection; - ListBox* m_pSelectionLB; - FixedText* m_pValueFT; - Edit* m_pValueED; - FixedText* m_pLevelFT; - NumericField* m_pLevelED; - FixedText* m_pDateFT; - FixedText* m_pTimeFT; - NumericField* m_pDateOffsetED; - VclContainer* m_pFormat; - ListBox* m_pFormatLB; - NumFormatListBox* m_pNumFormatLB; - CheckBox* m_pFixedCB; + VclPtr<ListBox> m_pTypeLB; + VclPtr<VclContainer> m_pSelection; + VclPtr<ListBox> m_pSelectionLB; + VclPtr<FixedText> m_pValueFT; + VclPtr<Edit> m_pValueED; + VclPtr<FixedText> m_pLevelFT; + VclPtr<NumericField> m_pLevelED; + VclPtr<FixedText> m_pDateFT; + VclPtr<FixedText> m_pTimeFT; + VclPtr<NumericField> m_pDateOffsetED; + VclPtr<VclContainer> m_pFormat; + VclPtr<ListBox> m_pFormatLB; + VclPtr<NumFormatListBox> m_pNumFormatLB; + VclPtr<CheckBox> m_pFixedCB; sal_Int32 nOldSel; sal_uLong nOldFormat; @@ -64,6 +64,7 @@ public: SwFldDokPage(vcl::Window* pWindow, const SfxItemSet& rSet); virtual ~SwFldDokPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rAttrSet); diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index fc40ec580b7c..f936b66cff47 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -221,6 +221,9 @@ void SwFldEditDlg::dispose() { SwViewShell::SetCareWin(NULL); pSh->EnterStdMode(); + m_pPrevBT.clear(); + m_pNextBT.clear(); + m_pAddressBT.clear(); SfxSingleTabDialog::dispose(); } diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index b190d69c67bd..944512b429d8 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -91,6 +91,37 @@ SwFldFuncPage::SwFldFuncPage(vcl::Window* pParent, const SfxItemSet& rCoreSet) SwFldFuncPage::~SwFldFuncPage() { + dispose(); +} + +void SwFldFuncPage::dispose() +{ + m_pTypeLB.clear(); + m_pSelectionLB.clear(); + m_pFormat.clear(); + m_pFormatLB.clear(); + m_pNameFT.clear(); + m_pNameED.clear(); + m_pValueGroup.clear(); + m_pValueFT.clear(); + m_pValueED.clear(); + m_pCond1FT.clear(); + m_pCond1ED.clear(); + m_pCond2FT.clear(); + m_pCond2ED.clear(); + m_pMacroBT.clear(); + m_pListGroup.clear(); + m_pListItemFT.clear(); + m_pListItemED.clear(); + m_pListAddPB.clear(); + m_pListItemsFT.clear(); + m_pListItemsLB.clear(); + m_pListRemovePB.clear(); + m_pListUpPB.clear(); + m_pListDownPB.clear(); + m_pListNameFT.clear(); + m_pListNameED.clear(); + SwFldPage::dispose(); } void SwFldFuncPage::Reset(const SfxItemSet* ) diff --git a/sw/source/ui/fldui/fldfunc.hxx b/sw/source/ui/fldui/fldfunc.hxx index fb8cfa906969..6ec851baa848 100644 --- a/sw/source/ui/fldui/fldfunc.hxx +++ b/sw/source/ui/fldui/fldfunc.hxx @@ -32,33 +32,33 @@ class SwFldFuncPage : public SwFldPage { - ListBox* m_pTypeLB; - ListBox* m_pSelectionLB; - VclContainer* m_pFormat; - ListBox* m_pFormatLB; - FixedText* m_pNameFT; - ConditionEdit* m_pNameED; - VclContainer* m_pValueGroup; - FixedText* m_pValueFT; - Edit* m_pValueED; - FixedText* m_pCond1FT; - ConditionEdit* m_pCond1ED; - FixedText* m_pCond2FT; - ConditionEdit* m_pCond2ED; - PushButton* m_pMacroBT; + VclPtr<ListBox> m_pTypeLB; + VclPtr<ListBox> m_pSelectionLB; + VclPtr<VclContainer> m_pFormat; + VclPtr<ListBox> m_pFormatLB; + VclPtr<FixedText> m_pNameFT; + VclPtr<ConditionEdit> m_pNameED; + VclPtr<VclContainer> m_pValueGroup; + VclPtr<FixedText> m_pValueFT; + VclPtr<Edit> m_pValueED; + VclPtr<FixedText> m_pCond1FT; + VclPtr<ConditionEdit> m_pCond1ED; + VclPtr<FixedText> m_pCond2FT; + VclPtr<ConditionEdit> m_pCond2ED; + VclPtr<PushButton> m_pMacroBT; //controls of "Input list" - VclContainer* m_pListGroup; - FixedText* m_pListItemFT; - ReturnActionEdit* m_pListItemED; - PushButton* m_pListAddPB; - FixedText* m_pListItemsFT; - ListBox* m_pListItemsLB; - PushButton* m_pListRemovePB; - PushButton* m_pListUpPB; - PushButton* m_pListDownPB; - FixedText* m_pListNameFT; - Edit* m_pListNameED; + VclPtr<VclContainer> m_pListGroup; + VclPtr<FixedText> m_pListItemFT; + VclPtr<ReturnActionEdit> m_pListItemED; + VclPtr<PushButton> m_pListAddPB; + VclPtr<FixedText> m_pListItemsFT; + VclPtr<ListBox> m_pListItemsLB; + VclPtr<PushButton> m_pListRemovePB; + VclPtr<PushButton> m_pListUpPB; + VclPtr<PushButton> m_pListDownPB; + VclPtr<FixedText> m_pListNameFT; + VclPtr<Edit> m_pListNameED; OUString m_sOldValueFT; OUString m_sOldNameFT; @@ -86,6 +86,7 @@ public: SwFldFuncPage(vcl::Window* pParent, const SfxItemSet& rSet); virtual ~SwFldFuncPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rAttrSet); diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 247dda169e18..4bb357ea51f0 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -107,6 +107,21 @@ SwFldRefPage::SwFldRefPage(vcl::Window* pParent, const SfxItemSet& rCoreSet ) SwFldRefPage::~SwFldRefPage() { + dispose(); +} + +void SwFldRefPage::dispose() +{ + m_pTypeLB.clear(); + m_pSelection.clear(); + m_pSelectionLB.clear(); + m_pSelectionToolTipLB.clear(); + m_pFormat.clear(); + m_pFormatLB.clear(); + m_pNameFT.clear(); + m_pNameED.clear(); + m_pValueED.clear(); + SwFldPage::dispose(); } // #i83479# diff --git a/sw/source/ui/fldui/fldref.hxx b/sw/source/ui/fldui/fldref.hxx index 27e5ab4fb22e..959c1e00382f 100644 --- a/sw/source/ui/fldui/fldref.hxx +++ b/sw/source/ui/fldui/fldref.hxx @@ -34,16 +34,16 @@ class SwTxtNode; class SwFldRefPage : public SwFldPage { - ListBox* m_pTypeLB; - VclContainer* m_pSelection; - ListBox* m_pSelectionLB; + VclPtr<ListBox> m_pTypeLB; + VclPtr<VclContainer> m_pSelection; + VclPtr<ListBox> m_pSelectionLB; // #i83479# - SwFldRefTreeListBox* m_pSelectionToolTipLB; - VclContainer* m_pFormat; - ListBox* m_pFormatLB; - FixedText* m_pNameFT; - Edit* m_pNameED; - Edit* m_pValueED; + VclPtr<SwFldRefTreeListBox> m_pSelectionToolTipLB; + VclPtr<VclContainer> m_pFormat; + VclPtr<ListBox> m_pFormatLB; + VclPtr<FixedText> m_pNameFT; + VclPtr<Edit> m_pNameED; + VclPtr<Edit> m_pValueED; OUString sBookmarkTxt; OUString sFootnoteTxt; OUString sEndnoteTxt; @@ -77,6 +77,7 @@ public: SwFldRefPage(vcl::Window* pParent, const SfxItemSet& rSet); virtual ~SwFldRefPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rAttrSet); diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index a72e4c99662e..9452d9847eac 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -87,6 +87,28 @@ SwFldVarPage::SwFldVarPage(vcl::Window* pParent, const SfxItemSet& rCoreSet ) SwFldVarPage::~SwFldVarPage() { + dispose(); +} + +void SwFldVarPage::dispose() +{ + m_pTypeLB.clear(); + m_pSelection.clear(); + m_pSelectionLB.clear(); + m_pNameFT.clear(); + m_pNameED.clear(); + m_pValueFT.clear(); + m_pValueED.clear(); + m_pFormat.clear(); + m_pNumFormatLB.clear(); + m_pFormatLB.clear(); + m_pChapterFrame.clear(); + m_pChapterLevelLB.clear(); + m_pInvisibleCB.clear(); + m_pSeparatorFT.clear(); + m_pSeparatorED.clear(); + m_pNewDelTBX.clear(); + SwFldPage::dispose(); } void SwFldVarPage::Reset(const SfxItemSet* ) diff --git a/sw/source/ui/fldui/fldvar.hxx b/sw/source/ui/fldui/fldvar.hxx index 9d1a37f0a5a9..bac7fc733d46 100644 --- a/sw/source/ui/fldui/fldvar.hxx +++ b/sw/source/ui/fldui/fldvar.hxx @@ -51,22 +51,22 @@ class SwFldVarPage : public SwFldPage { friend class SelectionListBox; - ListBox* m_pTypeLB; - VclContainer* m_pSelection; - SelectionListBox* m_pSelectionLB; - FixedText* m_pNameFT; - Edit* m_pNameED; - FixedText* m_pValueFT; - ConditionEdit* m_pValueED; - VclContainer* m_pFormat; - NumFormatListBox* m_pNumFormatLB; - ListBox* m_pFormatLB; - VclContainer* m_pChapterFrame; - ListBox* m_pChapterLevelLB; - CheckBox* m_pInvisibleCB; - FixedText* m_pSeparatorFT; - Edit* m_pSeparatorED; - ToolBox* m_pNewDelTBX; + VclPtr<ListBox> m_pTypeLB; + VclPtr<VclContainer> m_pSelection; + VclPtr<SelectionListBox> m_pSelectionLB; + VclPtr<FixedText> m_pNameFT; + VclPtr<Edit> m_pNameED; + VclPtr<FixedText> m_pValueFT; + VclPtr<ConditionEdit> m_pValueED; + VclPtr<VclContainer> m_pFormat; + VclPtr<NumFormatListBox> m_pNumFormatLB; + VclPtr<ListBox> m_pFormatLB; + VclPtr<VclContainer> m_pChapterFrame; + VclPtr<ListBox> m_pChapterLevelLB; + VclPtr<CheckBox> m_pInvisibleCB; + VclPtr<FixedText> m_pSeparatorFT; + VclPtr<Edit> m_pSeparatorED; + VclPtr<ToolBox> m_pNewDelTBX; sal_uInt16 m_nApplyId; sal_uInt16 m_nDeleteId; @@ -93,6 +93,7 @@ public: SwFldVarPage(vcl::Window* pParent, const SfxItemSet& rSet); virtual ~SwFldVarPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rAttrSet); diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx index 3346d84d9615..38226fa20b53 100644 --- a/sw/source/ui/fldui/inpdlg.cxx +++ b/sw/source/ui/fldui/inpdlg.cxx @@ -106,6 +106,20 @@ SwFldInputDlg::SwFldInputDlg( vcl::Window *pParent, SwWrtShell &rS, m_pEditED->SetText(convertLineEnd(aStr, GetSystemLineEnd())); } +SwFldInputDlg::~SwFldInputDlg() +{ + dispose(); +} + +void SwFldInputDlg::dispose() +{ + m_pLabelED.clear(); + m_pEditED.clear(); + m_pOKBT.clear(); + m_pNextBT.clear(); + SvxStandardDialog::dispose(); +} + void SwFldInputDlg::StateChanged( StateChangedType nType ) { if ( nType == StateChangedType::INITSHOW ) diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index 8a7cf86638a6..a265ff895ddf 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -97,6 +97,16 @@ void SwJavaEditDialog::dispose() delete pMgr; delete pFileDlg; Application::SetDefDialogParent( pOldDefDlgParent ); + m_pTypeED.clear(); + m_pUrlRB.clear(); + m_pEditRB.clear(); + m_pUrlPB.clear(); + m_pUrlED.clear(); + m_pEditED.clear(); + m_pOKBtn.clear(); + m_pPrevBtn.clear(); + m_pNextBtn.clear(); + pOldDefDlgParent.clear(); SvxStandardDialog::dispose(); } diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index bf0ca5f19e57..01eab608b18c 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -219,10 +219,11 @@ SwColumnDlg::~SwColumnDlg() void SwColumnDlg::dispose() { - delete pTabPage; delete pPageSet; delete pSectionSet; delete pSelectionSet; + m_pApplyToLB.clear(); + pTabPage.clear(); SfxModalDialog::dispose(); } @@ -554,6 +555,29 @@ SwColumnPage::~SwColumnPage() void SwColumnPage::dispose() { delete pColMgr; + m_pCLNrEdt.clear(); + m_pDefaultVS.clear(); + m_pBalanceColsCB.clear(); + m_pBtnBack.clear(); + m_pLbl1.clear(); + m_pLbl2.clear(); + m_pLbl3.clear(); + m_pBtnNext.clear(); + m_pAutoWidthBox.clear(); + m_pLineTypeLbl.clear(); + m_pLineTypeDLB.clear(); + m_pLineWidthLbl.clear(); + m_pLineWidthEdit.clear(); + m_pLineColorLbl.clear(); + m_pLineColorDLB.clear(); + m_pLineHeightLbl.clear(); + m_pLineHeightEdit.clear(); + m_pLinePosLbl.clear(); + m_pLinePosDLB.clear(); + m_pTextDirectionFT.clear(); + m_pTextDirectionLB.clear(); + m_pPgeExampleWN.clear(); + m_pFrmExampleWN.clear(); SfxTabPage::dispose(); } diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx index 89b798c8d7b7..82d350bddb20 100644 --- a/sw/source/ui/frmdlg/cption.cxx +++ b/sw/source/ui/frmdlg/cption.cxx @@ -51,14 +51,14 @@ using namespace ::com::sun::star; class SwSequenceOptionDialog : public SvxStandardDialog { - ListBox* m_pLbLevel; - Edit* m_pEdDelim; + VclPtr<ListBox> m_pLbLevel; + VclPtr<Edit> m_pEdDelim; - ListBox* m_pLbCharStyle; - CheckBox* m_pApplyBorderAndShadowCB; + VclPtr<ListBox> m_pLbCharStyle; + VclPtr<CheckBox> m_pApplyBorderAndShadowCB; //#i61007# order of captions - ListBox* m_pLbCaptionOrder; + VclPtr<ListBox> m_pLbCaptionOrder; SwView& rView; OUString aFldTypeName; @@ -67,6 +67,7 @@ public: SwSequenceOptionDialog( vcl::Window *pParent, SwView &rV, const OUString& rSeqFldType ); virtual ~SwSequenceOptionDialog(); + virtual void dispose() SAL_OVERRIDE; virtual void Apply() SAL_OVERRIDE; bool IsApplyBorderAndShadow( void ) { return m_pApplyBorderAndShadowCB->IsChecked(); } @@ -417,6 +418,20 @@ SwCaptionDialog::~SwCaptionDialog() void SwCaptionDialog::dispose() { delete pMgr; + m_pTextEdit.clear(); + m_pCategoryBox.clear(); + m_pFormatText.clear(); + m_pFormatBox.clear(); + m_pNumberingSeparatorFT.clear(); + m_pNumberingSeparatorED.clear(); + m_pSepText.clear(); + m_pSepEdit.clear(); + m_pPosText.clear(); + m_pPosBox.clear(); + m_pOKButton.clear(); + m_pAutoCaptionButton.clear(); + m_pOptionButton.clear(); + m_pPreview.clear(); SvxStandardDialog::dispose(); } @@ -461,8 +476,20 @@ SwSequenceOptionDialog::SwSequenceOptionDialog( vcl::Window *pParent, SwView &rV SwSequenceOptionDialog::~SwSequenceOptionDialog() { + dispose(); +} + +void SwSequenceOptionDialog::dispose() +{ + m_pLbLevel.clear(); + m_pEdDelim.clear(); + m_pLbCharStyle.clear(); + m_pApplyBorderAndShadowCB.clear(); + m_pLbCaptionOrder.clear(); + SvxStandardDialog::dispose(); } + void SwSequenceOptionDialog::Apply() { SwWrtShell &rSh = rView.GetWrtShell(); diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index dfa735d06136..34254ac6b705 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -712,6 +712,49 @@ SwFrmPage::SwFrmPage(vcl::Window *pParent, const SfxItemSet &rSet) m_pAutoHeightCB->SetClickHdl( LINK( this, SwFrmPage, AutoHeightClickHdl ) ); } +SwFrmPage::~SwFrmPage() +{ + dispose(); +} + +void SwFrmPage::dispose() +{ + m_pWidthFT.clear(); + m_pWidthAutoFT.clear(); + m_pRelWidthCB.clear(); + m_pRelWidthRelationLB.clear(); + m_pAutoWidthCB.clear(); + m_pHeightFT.clear(); + m_pHeightAutoFT.clear(); + m_pRelHeightCB.clear(); + m_pRelHeightRelationLB.clear(); + m_pAutoHeightCB.clear(); + m_pFixedRatioCB.clear(); + m_pRealSizeBT.clear(); + m_pAnchorFrame.clear(); + m_pAnchorAtPageRB.clear(); + m_pAnchorAtParaRB.clear(); + m_pAnchorAtCharRB.clear(); + m_pAnchorAsCharRB.clear(); + m_pAnchorAtFrameRB.clear(); + m_pHorizontalFT.clear(); + m_pHorizontalDLB.clear(); + m_pAtHorzPosFT.clear(); + m_pAtHorzPosED.clear(); + m_pHoriRelationFT.clear(); + m_pHoriRelationLB.clear(); + m_pMirrorPagesCB.clear(); + m_pVerticalFT.clear(); + m_pVerticalDLB.clear(); + m_pAtVertPosFT.clear(); + m_pAtVertPosED.clear(); + m_pVertRelationFT.clear(); + m_pVertRelationLB.clear(); + m_pFollowTextFlowCB.clear(); + m_pExampleWN.clear(); + SfxTabPage::dispose(); +} + namespace { struct FrmMaps @@ -815,10 +858,6 @@ void SwFrmPage::setOptimalRelWidth() m_pHoriRelationLB->Clear(); } -SwFrmPage::~SwFrmPage() -{ -} - SfxTabPage* SwFrmPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { return new SwFrmPage( pParent, *rSet ); @@ -2370,6 +2409,15 @@ SwGrfExtPage::~SwGrfExtPage() void SwGrfExtPage::dispose() { delete pGrfDlg; + m_pMirror.clear(); + m_pMirrorVertBox.clear(); + m_pMirrorHorzBox.clear(); + m_pAllPagesRB.clear(); + m_pLeftPagesRB.clear(); + m_pRightPagesRB.clear(); + m_pBmpWin.clear(); + m_pConnectED.clear(); + m_pBrowseBT.clear(); SfxTabPage::dispose(); } @@ -2708,6 +2756,18 @@ SwFrmURLPage::SwFrmURLPage( vcl::Window *pParent, const SfxItemSet &rSet ) : SwFrmURLPage::~SwFrmURLPage() { + dispose(); +} + +void SwFrmURLPage::dispose() +{ + pURLED.clear(); + pSearchPB.clear(); + pNameED.clear(); + pFrameCB.clear(); + pServerCB.clear(); + pClientCB.clear(); + SfxTabPage::dispose(); } void SwFrmURLPage::Reset( const SfxItemSet *rSet ) @@ -2850,8 +2910,35 @@ SwFrmAddPage::SwFrmAddPage(vcl::Window *pParent, const SfxItemSet &rSet) SwFrmAddPage::~SwFrmAddPage() { + dispose(); } +void SwFrmAddPage::dispose() +{ + pNameFrame.clear(); + pNameFT.clear(); + pNameED.clear(); + pAltNameFT.clear(); + pAltNameED.clear(); + pPrevFT.clear(); + pPrevLB.clear(); + pNextFT.clear(); + pNextLB.clear(); + pProtectFrame.clear(); + pProtectContentCB.clear(); + pProtectFrameCB.clear(); + pProtectSizeCB.clear(); + m_pContentAlignFrame.clear(); + m_pVertAlignLB.clear(); + pPropertiesFrame.clear(); + pEditInReadonlyCB.clear(); + pPrintFrameCB.clear(); + pTextFlowFT.clear(); + pTextFlowLB.clear(); + SfxTabPage::dispose(); +} + + SfxTabPage* SwFrmAddPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { return new SwFrmAddPage(pParent, *rSet); diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index 898a1c69e568..df3c5c76e676 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -133,6 +133,26 @@ SwWrapTabPage::SwWrapTabPage(vcl::Window *pParent, const SfxItemSet &rSet) SwWrapTabPage::~SwWrapTabPage() { + dispose(); +} + +void SwWrapTabPage::dispose() +{ + m_pNoWrapRB.clear(); + m_pWrapLeftRB.clear(); + m_pWrapRightRB.clear(); + m_pWrapParallelRB.clear(); + m_pWrapThroughRB.clear(); + m_pIdealWrapRB.clear(); + m_pLeftMarginED.clear(); + m_pRightMarginED.clear(); + m_pTopMarginED.clear(); + m_pBottomMarginED.clear(); + m_pWrapAnchorOnlyCB.clear(); + m_pWrapTransparentCB.clear(); + m_pWrapOutlineCB.clear(); + m_pWrapOutsideCB.clear(); + SfxTabPage::dispose(); } SfxTabPage* SwWrapTabPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 0005136836ed..589d1a75ded7 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -188,9 +188,9 @@ public: class SwAutoMarkDlg_Impl : public ModalDialog { - OKButton* m_pOKPB; + VclPtr<OKButton> m_pOKPB; - SwEntryBrowseBox* m_pEntriesBB; + VclPtr<SwEntryBrowseBox> m_pEntriesBB; OUString sAutoMarkURL; @@ -344,6 +344,8 @@ void SwMultiTOXTabDialog::dispose() delete[] pDescArr; delete pMgr; delete pExampleFrame; + m_pExampleContainerWIN.clear(); + m_pShowExampleCB.clear(); SfxTabDialog::dispose(); } @@ -509,7 +511,7 @@ IMPL_LINK_NOARG( SwMultiTOXTabDialog, ShowPreviewHdl ) && pExampleFrame && pExampleFrame->IsServiceAvailable(); m_pExampleContainerWIN->Show( bSetViewWindow ); - SetViewWindow( bSetViewWindow ? m_pExampleContainerWIN : 0 ); + SetViewWindow( bSetViewWindow ? m_pExampleContainerWIN.get() : 0 ); setOptimalLayoutSize(); @@ -626,11 +628,11 @@ void SwIndexTreeLB::setColSizes() class SwAddStylesDlg_Impl : public SfxModalDialog { - OKButton* m_pOk; + VclPtr<OKButton> m_pOk; - SwIndexTreeLB* m_pHeaderTree; - PushButton* m_pLeftPB; - PushButton* m_pRightPB; + VclPtr<SwIndexTreeLB> m_pHeaderTree; + VclPtr<PushButton> m_pLeftPB; + VclPtr<PushButton> m_pRightPB; OUString* pStyleArr; @@ -721,7 +723,10 @@ SwAddStylesDlg_Impl::~SwAddStylesDlg_Impl() void SwAddStylesDlg_Impl::dispose() { - delete m_pHeaderTree; + m_pHeaderTree.clear(); + m_pOk.clear(); + m_pLeftPB.clear(); + m_pRightPB.clear(); SfxModalDialog::dispose(); } @@ -904,6 +909,47 @@ void SwTOXSelectTabPage::dispose() { delete pIndexRes; delete pIndexEntryWrapper; + m_pTitleED.clear(); + m_pTypeFT.clear(); + m_pTypeLB.clear(); + m_pReadOnlyCB.clear(); + m_pAreaFrame.clear(); + m_pAreaLB.clear(); + m_pLevelFT.clear(); + m_pLevelNF.clear(); + m_pCreateFrame.clear(); + m_pFromHeadingsCB.clear(); + m_pAddStylesCB.clear(); + m_pAddStylesPB.clear(); + m_pFromTablesCB.clear(); + m_pFromFramesCB.clear(); + m_pFromGraphicsCB.clear(); + m_pFromOLECB.clear(); + m_pLevelFromChapterCB.clear(); + m_pFromCaptionsRB.clear(); + m_pFromObjectNamesRB.clear(); + m_pCaptionSequenceFT.clear(); + m_pCaptionSequenceLB.clear(); + m_pDisplayTypeFT.clear(); + m_pDisplayTypeLB.clear(); + m_pTOXMarksCB.clear(); + m_pIdxOptionsFrame.clear(); + m_pCollectSameCB.clear(); + m_pUseFFCB.clear(); + m_pUseDashCB.clear(); + m_pCaseSensitiveCB.clear(); + m_pInitialCapsCB.clear(); + m_pKeyAsEntryCB.clear(); + m_pFromFileCB.clear(); + m_pAutoMarkPB.clear(); + m_pFromObjCLB.clear(); + m_pFromObjFrame.clear(); + m_pSequenceCB.clear(); + m_pBracketLB.clear(); + m_pAuthorityFrame.clear(); + m_pSortFrame.clear(); + m_pLanguageLB.clear(); + m_pSortAlgorithmLB.clear(); SfxTabPage::dispose(); } @@ -1482,7 +1528,7 @@ class SwTOXEdit : public Edit SwFormToken aFormToken; Link aPrevNextControlLink; bool bNextControl; - SwTokenWindow* m_pParent; + VclPtr<SwTokenWindow> m_pParent; public: SwTOXEdit( vcl::Window* pParent, SwTokenWindow* pTokenWin, const SwFormToken& aToken) @@ -1492,6 +1538,8 @@ public: m_pParent( pTokenWin ) { } + virtual ~SwTOXEdit() { dispose(); } + virtual void dispose() SAL_OVERRIDE { m_pParent.clear(); Edit::dispose(); } virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE; @@ -1567,7 +1615,7 @@ class SwTOXButton : public PushButton SwFormToken aFormToken; Link aPrevNextControlLink; bool bNextControl; - SwTokenWindow* m_pParent; + VclPtr<SwTokenWindow> m_pParent; public: SwTOXButton( vcl::Window* pParent, SwTokenWindow* pTokenWin, const SwFormToken& rToken) @@ -1577,6 +1625,8 @@ public: m_pParent(pTokenWin) { } + virtual ~SwTOXButton() { dispose(); } + virtual void dispose() SAL_OVERRIDE { m_pParent.clear(); PushButton::dispose(); } virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE; @@ -1697,6 +1747,17 @@ SwIdxTreeListBox::SwIdxTreeListBox(vcl::Window* pPar, WinBits nStyle) { } +SwIdxTreeListBox::~SwIdxTreeListBox() +{ + dispose(); +} + +void SwIdxTreeListBox::dispose() +{ + pParent.clear(); + SvTreeListBox::dispose(); +} + extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSwIdxTreeListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap) { WinBits nWinStyle = WB_TABSTOP; @@ -1895,6 +1956,63 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(vcl::Window* pParent, const SfxItemSet& rAt m_pSecondKeyLB->SelectEntryPos(0); m_pThirdKeyLB->SelectEntryPos(0); } + +SwTOXEntryTabPage::~SwTOXEntryTabPage() +{ + dispose(); +} + +void SwTOXEntryTabPage::dispose() +{ + m_pLevelFT.clear(); + m_pLevelLB.clear(); + m_pTokenWIN.clear(); + m_pAllLevelsPB.clear(); + m_pEntryNoPB.clear(); + m_pEntryPB.clear(); + m_pTabPB.clear(); + m_pChapterInfoPB.clear(); + m_pPageNoPB.clear(); + m_pHyperLinkPB.clear(); + m_pAuthFieldsLB.clear(); + m_pAuthInsertPB.clear(); + m_pAuthRemovePB.clear(); + m_pCharStyleLB.clear(); + m_pEditStylePB.clear(); + m_pChapterEntryFT.clear(); + m_pChapterEntryLB.clear(); + m_pNumberFormatFT.clear(); + m_pNumberFormatLB.clear(); + m_pEntryOutlineLevelFT.clear(); + m_pEntryOutlineLevelNF.clear(); + m_pFillCharFT.clear(); + m_pFillCharCB.clear(); + m_pTabPosFT.clear(); + m_pTabPosMF.clear(); + m_pAutoRightCB.clear(); + m_pFormatFrame.clear(); + m_pMainEntryStyleFT.clear(); + m_pMainEntryStyleLB.clear(); + m_pAlphaDelimCB.clear(); + m_pCommaSeparatedCB.clear(); + m_pRelToStyleCB.clear(); + m_pSortingFrame.clear(); + m_pSortDocPosRB.clear(); + m_pSortContentRB.clear(); + m_pSortKeyFrame.clear(); + m_pFirstKeyLB.clear(); + m_pFirstSortUpRB.clear(); + m_pFirstSortDownRB.clear(); + m_pSecondKeyLB.clear(); + m_pSecondSortUpRB.clear(); + m_pSecondSortDownRB.clear(); + m_pThirdKeyLB.clear(); + m_pThirdSortUpRB.clear(); + m_pThirdSortDownRB.clear(); + SfxTabPage::dispose(); +} + + // pVoid is used as signal to change all levels of the example IMPL_LINK(SwTOXEntryTabPage, ModifyHdl, void*, pVoid) { @@ -1912,10 +2030,6 @@ IMPL_LINK(SwTOXEntryTabPage, ModifyHdl, void*, pVoid) return 0; } -SwTOXEntryTabPage::~SwTOXEntryTabPage() -{ -} - bool SwTOXEntryTabPage::FillItemSet( SfxItemSet* ) { // nothing to do @@ -2660,6 +2774,11 @@ void SwTokenWindow::dispose() } aControlList.clear(); disposeBuilder(); + m_pLeftScrollWin.clear(); + m_pCtrlParentWin.clear(); + m_pRightScrollWin.clear(); + pActiveCtrl.clear(); + m_pParent.clear(); VclHBox::dispose(); } @@ -2671,9 +2790,6 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) if(pForm) { //apply current level settings to the form - for (ctrl_iterator iter = aControlList.begin(); iter != aControlList.end(); ++iter) - delete (*iter); - aControlList.clear(); } @@ -2755,9 +2871,9 @@ void SwTokenWindow::SetActiveControl(Control* pSet) //it must be a SwTOXEdit const SwFormToken* pFToken; if( WINDOW_EDIT == pActiveCtrl->GetType() ) - pFToken = &static_cast<SwTOXEdit*>(pActiveCtrl)->GetFormToken(); + pFToken = &static_cast<SwTOXEdit*>(pActiveCtrl.get())->GetFormToken(); else - pFToken = &static_cast<SwTOXButton*>(pActiveCtrl)->GetFormToken(); + pFToken = &static_cast<SwTOXButton*>(pActiveCtrl.get())->GetFormToken(); SwFormToken aTemp( *pFToken ); aButtonSelectedHdl.Call( &aTemp ); @@ -2978,15 +3094,15 @@ void SwTokenWindow::InsertAtSelection(const OUString& rText, const SwFormToken& { ++iterActive; - Selection aSel = static_cast<SwTOXEdit*>(pActiveCtrl)->GetSelection(); + Selection aSel = static_cast<SwTOXEdit*>(pActiveCtrl.get())->GetSelection(); aSel.Justify(); - const OUString sEditText = static_cast<SwTOXEdit*>(pActiveCtrl)->GetText(); + const OUString sEditText = static_cast<SwTOXEdit*>(pActiveCtrl.get())->GetText(); const OUString sLeft = sEditText.copy( 0, aSel.A() ); const OUString sRight = sEditText.copy( aSel.B() ); - static_cast<SwTOXEdit*>(pActiveCtrl)->SetText(sLeft); - static_cast<SwTOXEdit*>(pActiveCtrl)->AdjustSize(); + static_cast<SwTOXEdit*>(pActiveCtrl.get())->SetText(sLeft); + static_cast<SwTOXEdit*>(pActiveCtrl.get())->AdjustSize(); SwFormToken aTmpToken(TOKEN_TEXT); SwTOXEdit* pEdit = new SwTOXEdit(m_pCtrlParentWin, this, aTmpToken); @@ -3017,7 +3133,7 @@ void SwTokenWindow::InsertAtSelection(const OUString& rText, const SwFormToken& { iterActive = aControlList.erase(iterActive); pActiveCtrl->Hide(); - delete pActiveCtrl; + pActiveCtrl.clear(); } //now the new button @@ -3082,7 +3198,7 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, bool bInternalCall ) aControlList.erase(it); pActiveCtrl->Hide(); - delete pActiveCtrl; + pActiveCtrl.clear(); SetActiveControl(pLeftEdit); AdjustPositions(); @@ -3541,6 +3657,11 @@ SwTOXStylesTabPage::~SwTOXStylesTabPage() void SwTOXStylesTabPage::dispose() { delete m_pCurrentForm; + m_pLevelLB.clear(); + m_pAssignBT.clear(); + m_pParaLayLB.clear(); + m_pStdBT.clear(); + m_pEditStyleBT.clear(); SfxTabPage::dispose(); } @@ -4095,7 +4216,8 @@ SwAutoMarkDlg_Impl::~SwAutoMarkDlg_Impl() void SwAutoMarkDlg_Impl::dispose() { - delete m_pEntriesBB; + m_pEntriesBB.clear(); + m_pOKPB.clear(); ModalDialog::dispose(); } diff --git a/sw/source/ui/index/multmrk.cxx b/sw/source/ui/index/multmrk.cxx index 7fe0e656888e..5d1dfa03fbee 100644 --- a/sw/source/ui/index/multmrk.cxx +++ b/sw/source/ui/index/multmrk.cxx @@ -61,6 +61,17 @@ void SwMultiTOXMarkDlg::Apply() rMgr.SetCurTOXMark(nPos); } -SwMultiTOXMarkDlg::~SwMultiTOXMarkDlg() {} +SwMultiTOXMarkDlg::~SwMultiTOXMarkDlg() +{ + dispose(); +} + +void SwMultiTOXMarkDlg::dispose() +{ + m_pTextFT.clear(); + m_pTOXLB.clear(); + SvxStandardDialog::dispose(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 9a5f7985b783..75e48ab27b8a 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -546,8 +546,8 @@ void SwIndexMarkPane::UpdateKeyBoxes() class SwNewUserIdxDlg : public ModalDialog { - OKButton* m_pOKPB; - Edit* m_pNameED; + VclPtr<OKButton> m_pOKPB; + VclPtr<Edit> m_pNameED; SwIndexMarkPane* m_pDlg; @@ -565,6 +565,13 @@ class SwNewUserIdxDlg : public ModalDialog m_pOKPB->Enable(false); m_pNameED->GrabFocus(); } + virtual ~SwNewUserIdxDlg() { dispose(); } + virtual void dispose() SAL_OVERRIDE + { + m_pOKPB.clear(); + m_pNameED.clear(); + ModalDialog::dispose(); + } OUString GetName(){return m_pNameED->GetText();} }; @@ -982,12 +989,12 @@ void SwIndexMarkModalDlg::Apply() class SwCreateAuthEntryDlg_Impl : public ModalDialog { - FixedText* pFixedTexts[AUTH_FIELD_END]; - ListBox* pTypeListBox; - ComboBox* pIdentifierBox; - Edit* pEdits[AUTH_FIELD_END]; + VclPtr<FixedText> pFixedTexts[AUTH_FIELD_END]; + VclPtr<ListBox> pTypeListBox; + VclPtr<ComboBox> pIdentifierBox; + VclPtr<Edit> pEdits[AUTH_FIELD_END]; - OKButton* m_pOKBT; + VclPtr<OKButton> m_pOKBT; Link aShortNameCheckLink; @@ -1527,11 +1534,12 @@ void SwCreateAuthEntryDlg_Impl::dispose() { for(int i = 0; i < AUTH_FIELD_END; i++) { - delete pFixedTexts[i]; - delete pEdits[i]; + pFixedTexts[i].clear(); + pEdits[i].clear(); } - delete pTypeListBox; - delete pIdentifierBox; + pTypeListBox.clear(); + pIdentifierBox.clear(); + m_pOKBT.clear(); ModalDialog::dispose(); } diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 59576289d831..13bc3e733168 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -147,6 +147,15 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( vcl::Window *pParent, SwWrtShell &rS, SwInsertBookmarkDlg::~SwInsertBookmarkDlg() { + dispose(); +} + +void SwInsertBookmarkDlg::dispose() +{ + m_pBookmarkBox.clear(); + m_pOkBtn.clear(); + m_pDeleteBtn.clear(); + SvxStandardDialog::dispose(); } BookmarkCombo::BookmarkCombo(vcl::Window* pWin, WinBits nStyle) diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index 15cfb9493333..49bd6c9e0624 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -117,6 +117,33 @@ SwEndNoteOptionPage::SwEndNoteOptionPage(vcl::Window *pParent, bool bEN, get(m_pFtnCharTextTemplBox, "charstylelb"); } +SwEndNoteOptionPage::~SwEndNoteOptionPage() +{ + dispose(); +} + +void SwEndNoteOptionPage::dispose() +{ + m_pNumViewBox.clear(); + m_pOffsetLbl.clear(); + m_pOffsetFld.clear(); + m_pNumCountBox.clear(); + m_pPrefixED.clear(); + m_pSuffixED.clear(); + m_pPosFT.clear(); + m_pPosPageBox.clear(); + m_pPosChapterBox.clear(); + m_pStylesContainer.clear(); + m_pParaTemplBox.clear(); + m_pPageTemplLbl.clear(); + m_pPageTemplBox.clear(); + m_pFtnCharAnchorTemplBox.clear(); + m_pFtnCharTextTemplBox.clear(); + m_pContEdit.clear(); + m_pContFromEdit.clear(); + SfxTabPage::dispose(); +} + void SwEndNoteOptionPage::Reset( const SfxItemSet* ) { boost::scoped_ptr<SwEndNoteInfo> pInf(bEndNote ? new SwEndNoteInfo( pSh->GetEndNoteInfo() ) @@ -219,10 +246,6 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet* ) m_pPageTemplBox->SelectEntry( pInf->GetPageDesc( *pSh->GetDoc() )->GetName()); } -SwEndNoteOptionPage::~SwEndNoteOptionPage() -{ -} - SfxTabPage *SwEndNoteOptionPage::Create( vcl::Window *pParent, const SfxItemSet *rSet ) { return new SwEndNoteOptionPage( pParent, true, *rSet ); diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index fcdec5ab38bf..26b2b9407202 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -112,6 +112,18 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(vcl::Window * pParent, SwGlossaryGroupDlg::~SwGlossaryGroupDlg() { + dispose(); +} + +void SwGlossaryGroupDlg::dispose() +{ + m_pNameED.clear(); + m_pPathLB.clear(); + m_pGroupTLB.clear(); + m_pNewPB.clear(); + m_pDelPB.clear(); + m_pRenamePB.clear(); + SvxStandardDialog::dispose(); } void SwGlossaryGroupDlg::Apply() diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 47fb56870532..42f0b992a54c 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -115,12 +115,12 @@ struct GroupUserData // dialog for new block name class SwNewGlosNameDlg : public ModalDialog { - Edit* m_pNewName; - TextFilter m_aNoSpaceFilter; - Edit* m_pNewShort; - OKButton* m_pOk; - Edit* m_pOldName; - Edit* m_pOldShort; + VclPtr<Edit> m_pNewName; + TextFilter m_aNoSpaceFilter; + VclPtr<Edit> m_pNewShort; + VclPtr<OKButton> m_pOk; + VclPtr<Edit> m_pOldName; + VclPtr<Edit> m_pOldShort; protected: DECL_LINK( Modify, Edit * ); @@ -130,6 +130,8 @@ public: SwNewGlosNameDlg( vcl::Window* pParent, const OUString& rOldName, const OUString& rOldShort ); + virtual ~SwNewGlosNameDlg(); + virtual void dispose() SAL_OVERRIDE; OUString GetNewName() const { return m_pNewName->GetText(); } OUString GetNewShort() const { return m_pNewShort->GetText(); } @@ -156,6 +158,21 @@ SwNewGlosNameDlg::SwNewGlosNameDlg(vcl::Window* pParent, m_pNewName->GrabFocus(); } +SwNewGlosNameDlg::~SwNewGlosNameDlg() +{ + dispose(); +} + +void SwNewGlosNameDlg::dispose() +{ + m_pNewName.clear(); + m_pNewShort.clear(); + m_pOk.clear(); + m_pOldName.clear(); + m_pOldShort.clear(); + ModalDialog::dispose(); +} + // query / set currently set group OUString SwGlossaryDlg::GetCurrGroup() { @@ -239,6 +256,18 @@ void SwGlossaryDlg::dispose() { m_pCategoryBox->Clear(); delete pExampleFrame; + m_pInsertTipCB.clear(); + m_pNameED.clear(); + m_pShortNameLbl.clear(); + m_pShortNameEdit.clear(); + m_pCategoryBox.clear(); + m_pFileRelCB.clear(); + m_pNetRelCB.clear(); + m_pExampleWIN.clear(); + m_pInsertBtn.clear(); + m_pEditBtn.clear(); + m_pBibBtn.clear(); + m_pPathBtn.clear(); SvxStandardDialog::dispose(); } diff --git a/sw/source/ui/misc/impfnote.hxx b/sw/source/ui/misc/impfnote.hxx index f9808c4dc040..02f4c076bb05 100644 --- a/sw/source/ui/misc/impfnote.hxx +++ b/sw/source/ui/misc/impfnote.hxx @@ -30,27 +30,27 @@ class SwWrtShell; class SwEndNoteOptionPage : public SfxTabPage { - SwNumberingTypeListBox* m_pNumViewBox; - FixedText* m_pOffsetLbl; - NumericField* m_pOffsetFld; - ListBox* m_pNumCountBox; - Edit* m_pPrefixED; - Edit* m_pSuffixED; - FixedText* m_pPosFT; - RadioButton* m_pPosPageBox; - RadioButton* m_pPosChapterBox; + VclPtr<SwNumberingTypeListBox> m_pNumViewBox; + VclPtr<FixedText> m_pOffsetLbl; + VclPtr<NumericField> m_pOffsetFld; + VclPtr<ListBox> m_pNumCountBox; + VclPtr<Edit> m_pPrefixED; + VclPtr<Edit> m_pSuffixED; + VclPtr<FixedText> m_pPosFT; + VclPtr<RadioButton> m_pPosPageBox; + VclPtr<RadioButton> m_pPosChapterBox; - VclContainer *m_pStylesContainer; + VclPtr<VclContainer> m_pStylesContainer; - ListBox* m_pParaTemplBox; - FixedText* m_pPageTemplLbl; - ListBox* m_pPageTemplBox; + VclPtr<ListBox> m_pParaTemplBox; + VclPtr<FixedText> m_pPageTemplLbl; + VclPtr<ListBox> m_pPageTemplBox; - ListBox* m_pFtnCharAnchorTemplBox; - ListBox* m_pFtnCharTextTemplBox; + VclPtr<ListBox> m_pFtnCharAnchorTemplBox; + VclPtr<ListBox> m_pFtnCharTextTemplBox; - Edit* m_pContEdit; - Edit* m_pContFromEdit; + VclPtr<Edit> m_pContEdit; + VclPtr<Edit> m_pContFromEdit; OUString aNumDoc; OUString aNumPage; @@ -70,6 +70,7 @@ public: SwEndNoteOptionPage( vcl::Window *pParent, bool bEndNote, const SfxItemSet &rSet ); virtual ~SwEndNoteOptionPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage *Create(vcl::Window *pParent, const SfxItemSet *rSet); virtual bool FillItemSet(SfxItemSet *rSet) SAL_OVERRIDE; diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index dd403bcb0b78..023db178128d 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -214,6 +214,16 @@ void SwInsFootNoteDlg::dispose() if (bEdit) rSh.ResetSelect(0, false); + m_pNumberFrame.clear(); + m_pNumberAutoBtn.clear(); + m_pNumberCharBtn.clear(); + m_pNumberCharEdit.clear(); + m_pNumberExtChar.clear(); + m_pFtnBtn.clear(); + m_pEndNoteBtn.clear(); + m_pOkBtn.clear(); + m_pPrevBT.clear(); + m_pNextBT.clear(); SvxStandardDialog::dispose(); } diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx index db98b1ce87b1..ee634066417d 100644 --- a/sw/source/ui/misc/linenum.cxx +++ b/sw/source/ui/misc/linenum.cxx @@ -169,8 +169,30 @@ SwLineNumberingDlg::SwLineNumberingDlg(SwView *pVw) SwLineNumberingDlg::~SwLineNumberingDlg() { + dispose(); } +void SwLineNumberingDlg::dispose() +{ + m_pBodyContent.clear(); + m_pDivIntervalFT.clear(); + m_pDivIntervalNF.clear(); + m_pDivRowsFT.clear(); + m_pNumIntervalNF.clear(); + m_pCharStyleLB.clear(); + m_pFormatLB.clear(); + m_pPosLB.clear(); + m_pOffsetMF.clear(); + m_pDivisorED.clear(); + m_pCountEmptyLinesCB.clear(); + m_pCountFrameLinesCB.clear(); + m_pRestartEachPageCB.clear(); + m_pNumberingOnCB.clear(); + m_pNumberingOnFooterHeader.clear(); + SfxModalDialog::dispose(); +} + + IMPL_LINK_NOARG(SwLineNumberingDlg, OKHdl) { SwLineNumberInfo aInf(pSh->GetLineNumberInfo()); diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index 65543804b845..69d7d24f605e 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -169,6 +169,30 @@ SwNumPositionTabPage::~SwNumPositionTabPage() void SwNumPositionTabPage::dispose() { delete pActNum; + m_pLevelLB.clear(); + m_pPositionFrame.clear(); + m_pDistBorderFT.clear(); + m_pDistBorderMF.clear(); + m_pRelativeCB.clear(); + m_pIndentFT.clear(); + m_pIndentMF.clear(); + m_pDistNumFT.clear(); + m_pDistNumMF.clear(); + m_pAlignFT.clear(); + m_pAlignLB.clear(); + m_pLabelFollowedByFT.clear(); + m_pLabelFollowedByLB.clear(); + m_pListtabFT.clear(); + m_pListtabMF.clear(); + m_pAlign2FT.clear(); + m_pAlign2LB.clear(); + m_pAlignedAtFT.clear(); + m_pAlignedAtMF.clear(); + m_pIndentAtFT.clear(); + m_pIndentAtMF.clear(); + m_pStandardPB.clear(); + m_pPreviewWIN.clear(); + pOutlineDlg.clear(); SfxTabPage::dispose(); } @@ -181,9 +205,9 @@ void SwNumPositionTabPage::InitControls() USHRT_MAX != nActNumLvl; m_pDistBorderMF->Enable( !bLabelAlignmentPosAndSpaceModeActive && - ( bSingleSelection || bRelative || pOutlineDlg != 0 ) ); + ( bSingleSelection || bRelative || pOutlineDlg.get() != 0 ) ); m_pDistBorderFT->Enable( !bLabelAlignmentPosAndSpaceModeActive && - ( bSingleSelection || bRelative || pOutlineDlg != 0 ) ); + ( bSingleSelection || bRelative || pOutlineDlg.get() != 0 ) ); bool bSetDistEmpty = false; bool bSameDistBorderNum = !bLabelAlignmentPosAndSpaceModeActive; diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 0230c94e4e2e..c4216d09eab1 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -60,9 +60,9 @@ using namespace ::com::sun::star; class SwNumNamesDlg : public ModalDialog { - Edit* m_pFormEdit; - ListBox* m_pFormBox; - OKButton* m_pOKBtn; + VclPtr<Edit> m_pFormEdit; + VclPtr<ListBox> m_pFormBox; + VclPtr<OKButton> m_pOKBtn; DECL_LINK( ModifyHdl, Edit * ); DECL_LINK( SelectHdl, ListBox * ); @@ -70,11 +70,27 @@ class SwNumNamesDlg : public ModalDialog public: SwNumNamesDlg(vcl::Window *pParent); + virtual ~SwNumNamesDlg(); + virtual void dispose() SAL_OVERRIDE; void SetUserNames(const OUString *pList[]); OUString GetName() const { return m_pFormEdit->GetText(); } sal_Int32 GetCurEntryPos() const { return m_pFormBox->GetSelectEntryPos(); } }; +SwNumNamesDlg::~SwNumNamesDlg() +{ + dispose(); +} + +void SwNumNamesDlg::dispose() +{ + m_pFormEdit.clear(); + m_pFormBox.clear(); + m_pOKBtn.clear(); + ModalDialog::dispose(); +} + + // remember selected entry IMPL_LINK_INLINE_START( SwNumNamesDlg, SelectHdl, ListBox *, pBox ) { @@ -746,8 +762,25 @@ IMPL_LINK_NOARG(SwOutlineSettingsTabPage, CharFmtHdl) SwOutlineSettingsTabPage::~SwOutlineSettingsTabPage() { + dispose(); +} + +void SwOutlineSettingsTabPage::dispose() +{ + m_pLevelLB.clear(); + m_pCollBox.clear(); + m_pNumberBox.clear(); + m_pCharFmtLB.clear(); + m_pAllLevelFT.clear(); + m_pAllLevelNF.clear(); + m_pPrefixED.clear(); + m_pSuffixED.clear(); + m_pStartEdit.clear(); + m_pPreviewWIN.clear(); + SfxTabPage::dispose(); } + void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell) { pSh = pShell; diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index 68e6d1a1d510..cd75060e3e82 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -135,8 +135,25 @@ SwFootNotePage::SwFootNotePage(vcl::Window *pParent, const SfxItemSet &rSet) SwFootNotePage::~SwFootNotePage() { + dispose(); } +void SwFootNotePage::dispose() +{ + m_pMaxHeightPageBtn.clear(); + m_pMaxHeightBtn.clear(); + m_pMaxHeightEdit.clear(); + m_pDistEdit.clear(); + m_pLinePosBox.clear(); + m_pLineTypeBox.clear(); + m_pLineWidthEdit.clear(); + m_pLineColorBox.clear(); + m_pLineLengthEdit.clear(); + m_pLineDistEdit.clear(); + SfxTabPage::dispose(); +} + + SfxTabPage* SwFootNotePage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { return new SwFootNotePage(pParent, *rSet); diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index 76ab9a1c80a9..0ff7f97a51ac 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -151,6 +151,33 @@ SwTextGridPage::SwTextGridPage(vcl::Window *pParent, const SfxItemSet &rSet) : SwTextGridPage::~SwTextGridPage() { + dispose(); +} + +void SwTextGridPage::dispose() +{ + m_pNoGridRB.clear(); + m_pLinesGridRB.clear(); + m_pCharsGridRB.clear(); + m_pSnapToCharsCB.clear(); + m_pExampleWN.clear(); + m_pLayoutFL.clear(); + m_pLinesPerPageNF.clear(); + m_pLinesRangeFT.clear(); + m_pTextSizeMF.clear(); + m_pCharsPerLineFT.clear(); + m_pCharsPerLineNF.clear(); + m_pCharsRangeFT.clear(); + m_pCharWidthFT.clear(); + m_pCharWidthMF.clear(); + m_pRubySizeFT.clear(); + m_pRubySizeMF.clear(); + m_pRubyBelowCB.clear(); + m_pDisplayFL.clear(); + m_pDisplayCB.clear(); + m_pPrintCB.clear(); + m_pColorLB.clear(); + SfxTabPage::dispose(); } SfxTabPage *SwTextGridPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) @@ -460,7 +487,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField) IMPL_LINK(SwTextGridPage, GridTypeHdl, RadioButton*, pButton) { - bool bEnable = m_pNoGridRB != pButton; + bool bEnable = m_pNoGridRB.get() != pButton; m_pLayoutFL->Enable(bEnable); m_pDisplayFL->Enable(bEnable); diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx index 90904c54bc06..1b947836bced 100644 --- a/sw/source/ui/misc/srtdlg.cxx +++ b/sw/source/ui/misc/srtdlg.cxx @@ -259,6 +259,31 @@ void SwSortDlg::dispose() ::lcl_ClearLstBoxAndDelUserData(*m_pTypDLB2); ::lcl_ClearLstBoxAndDelUserData(*m_pTypDLB3); delete pColRes; + m_pColLbl.clear(); + m_pTypLbl.clear(); + m_pKeyCB1.clear(); + m_pColEdt1.clear(); + m_pTypDLB1.clear(); + m_pSortUp1RB.clear(); + m_pSortDn1RB.clear(); + m_pKeyCB2.clear(); + m_pColEdt2.clear(); + m_pTypDLB2.clear(); + m_pSortUp2RB.clear(); + m_pSortDn2RB.clear(); + m_pKeyCB3.clear(); + m_pColEdt3.clear(); + m_pTypDLB3.clear(); + m_pSortUp3RB.clear(); + m_pSortDn3RB.clear(); + m_pColumnRB.clear(); + m_pRowRB.clear(); + m_pDelimTabRB.clear(); + m_pDelimFreeRB.clear(); + m_pDelimEdt.clear(); + m_pDelimPB.clear(); + m_pLangLB.clear(); + m_pCaseCB.clear(); SvxStandardDialog::dispose(); } @@ -387,7 +412,8 @@ IMPL_LINK_NOARG(SwSortDlg, DelimCharHdl) IMPL_LINK( SwSortDlg, CheckHdl, void *, pControl ) { - if( pControl == m_pRowRB) + if( pControl == m_pRowRB.get()) +r { m_pColLbl->SetText(aColTxt); m_pColEdt1->SetMax(nY); @@ -398,7 +424,7 @@ IMPL_LINK( SwSortDlg, CheckHdl, void *, pControl ) m_pColEdt2->SetAccessibleName(aColTxt); m_pColEdt3->SetAccessibleName(aColTxt); } - else if( pControl == m_pColumnRB) + else if( pControl == m_pColumnRB.get()) { m_pColLbl->SetText(aRowTxt); m_pColEdt1->SetMax(nX); diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx index 76fe927955f8..da0a0d42e712 100644 --- a/sw/source/ui/misc/titlepage.cxx +++ b/sw/source/ui/misc/titlepage.cxx @@ -276,6 +276,18 @@ SwTitlePageDlg::~SwTitlePageDlg() void SwTitlePageDlg::dispose() { delete mpPageFmtDesc; + m_pUseExistingPagesRB.clear(); + m_pPageCountNF.clear(); + m_pDocumentStartRB.clear(); + m_pPageStartRB.clear(); + m_pPageStartNF.clear(); + m_pRestartNumberingCB.clear(); + m_pRestartNumberingNF.clear(); + m_pSetPageNumberCB.clear(); + m_pSetPageNumberNF.clear(); + m_pPagePropertiesLB.clear(); + m_pPagePropertiesPB.clear(); + m_pOkPB.clear(); SfxModalDialog::dispose(); } diff --git a/sw/source/ui/table/colwd.cxx b/sw/source/ui/table/colwd.cxx index 751b5a4c029d..b7a212bf6891 100644 --- a/sw/source/ui/table/colwd.cxx +++ b/sw/source/ui/table/colwd.cxx @@ -66,6 +66,18 @@ SwTableWidthDlg::SwTableWidthDlg(vcl::Window *pParent, SwTableFUNC &rTableFnc ) LoseFocusHdl(); } +SwTableWidthDlg::~SwTableWidthDlg() +{ + dispose(); +} + +void SwTableWidthDlg::dispose() +{ + m_pColNF.clear(); + m_pWidthMF.clear(); + SvxStandardDialog::dispose(); +} + void SwTableWidthDlg::Apply() { rFnc.InitTabCols(); diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx index 5d0567df4ed0..907b6cdc8d39 100644 --- a/sw/source/ui/table/convert.cxx +++ b/sw/source/ui/table/convert.cxx @@ -180,6 +180,20 @@ SwConvertTableDlg:: ~SwConvertTableDlg() void SwConvertTableDlg::dispose() { delete pTAutoFmt; + mpTabBtn.clear(); + mpSemiBtn.clear(); + mpParaBtn.clear(); + mpOtherBtn.clear(); + mpOtherEd.clear(); + mpKeepColumn.clear(); + mpOptions.clear(); + mpHeaderCB.clear(); + mpRepeatHeaderCB.clear(); + mpRepeatRows.clear(); + mpRepeatHeaderNF.clear(); + mpDontSplitCB.clear(); + mpBorderCB.clear(); + mpAutoFmtBtn.clear(); SfxModalDialog::dispose(); } diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx index 817667f020d9..d4f9d3a23dfb 100644 --- a/sw/source/ui/table/instable.cxx +++ b/sw/source/ui/table/instable.cxx @@ -143,6 +143,17 @@ SwInsTableDlg::~SwInsTableDlg() void SwInsTableDlg::dispose() { delete pTAutoFmt; + m_pNameEdit.clear(); + m_pColNF.clear(); + m_pRowNF.clear(); + m_pHeaderCB.clear(); + m_pRepeatHeaderCB.clear(); + m_pRepeatHeaderNF.clear(); + m_pRepeatGroup.clear(); + m_pDontSplitCB.clear(); + m_pBorderCB.clear(); + m_pInsertBtn.clear(); + m_pAutoFmtBtn.clear(); SfxModalDialog::dispose(); } diff --git a/sw/source/ui/table/mergetbl.cxx b/sw/source/ui/table/mergetbl.cxx index 6c1dd9449336..6e687b7658ce 100644 --- a/sw/source/ui/table/mergetbl.cxx +++ b/sw/source/ui/table/mergetbl.cxx @@ -28,6 +28,18 @@ SwMergeTblDlg::SwMergeTblDlg( vcl::Window *pParent, bool& rWithPrev ) m_pMergePrevRB->Check(); } +SwMergeTblDlg::~SwMergeTblDlg() +{ + dispose(); +} + +void SwMergeTblDlg::dispose() +{ + m_pMergePrevRB.clear(); + SvxStandardDialog::dispose(); +} + + void SwMergeTblDlg::Apply() { m_rMergePrev = m_pMergePrevRB->IsChecked(); diff --git a/sw/source/ui/table/rowht.cxx b/sw/source/ui/table/rowht.cxx index f745f3f9356d..70cc897d4280 100644 --- a/sw/source/ui/table/rowht.cxx +++ b/sw/source/ui/table/rowht.cxx @@ -75,4 +75,16 @@ SwTableHeightDlg::SwTableHeightDlg(vcl::Window *pParent, SwWrtShell &rS) } } +SwTableHeightDlg::~SwTableHeightDlg() +{ + dispose(); +} + +void SwTableHeightDlg::dispose() +{ + m_pHeightEdit.clear(); + m_pAutoHeightCB.clear(); + SvxStandardDialog::dispose(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/splittbl.cxx b/sw/source/ui/table/splittbl.cxx index d6d7b62ca16b..7fab28173baf 100644 --- a/sw/source/ui/table/splittbl.cxx +++ b/sw/source/ui/table/splittbl.cxx @@ -33,6 +33,20 @@ SwSplitTblDlg::SwSplitTblDlg( vcl::Window *pParent, SwWrtShell &rSh ) get(mpBorderCopyRB, "noheading"); } +SwSplitTblDlg::~SwSplitTblDlg() +{ + dispose(); +} + +void SwSplitTblDlg::dispose() +{ + mpCntntCopyRB.clear(); + mpBoxAttrCopyWithParaRB.clear(); + mpBoxAttrCopyNoParaRB.clear(); + mpBorderCopyRB.clear(); + SvxStandardDialog::dispose(); +} + void SwSplitTblDlg::Apply() { m_nSplit = HEADLINE_CNTNTCOPY; diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 0f4930909dec..b3d529ce14a8 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -105,6 +105,32 @@ SwFormatTablePage::SwFormatTablePage(vcl::Window* pParent, const SfxItemSet& rSe Init(); } +SwFormatTablePage::~SwFormatTablePage() +{ + dispose(); +} + +void SwFormatTablePage::dispose() +{ + m_pNameED.clear(); + m_pWidthFT.clear(); + m_pRelWidthCB.clear(); + m_pFullBtn.clear(); + m_pLeftBtn.clear(); + m_pFromLeftBtn.clear(); + m_pRightBtn.clear(); + m_pCenterBtn.clear(); + m_pFreeBtn.clear(); + m_pLeftFT.clear(); + m_pRightFT.clear(); + m_pTopFT.clear(); + m_pTopMF.clear(); + m_pBottomFT.clear(); + m_pBottomMF.clear(); + m_pTextDirectionLB.clear(); + SfxTabPage::dispose(); +} + void SwFormatTablePage::Init() { m_aLeftMF.SetMetricFieldMin(-999999); @@ -749,9 +775,22 @@ SwTableColumnPage::SwTableColumnPage(vcl::Window* pParent, const SfxItemSet& rSe && static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON)); } -//Description: Page column configuration - SwTableColumnPage::~SwTableColumnPage() +SwTableColumnPage::~SwTableColumnPage() { + dispose(); +} + +void SwTableColumnPage::dispose() +{ + m_pModifyTableCB.clear(); + m_pProportionalCB.clear(); + m_pSpaceFT.clear(); + m_pSpaceED.clear(); + m_pUpBtn.clear(); + m_pDownBtn.clear(); + for (auto p : m_pTextArr) + p.clear(); + SfxTabPage::dispose(); } SfxTabPage* SwTableColumnPage::Create( vcl::Window* pParent, @@ -832,7 +871,7 @@ void SwTableColumnPage::Init(bool bWeb) IMPL_LINK( SwTableColumnPage, AutoClickHdl, void *, pControl ) { //move display window - if(pControl == m_pDownBtn) + if(pControl == m_pDownBtn.get()) { if(aValueTbl[0] > 0) { @@ -840,7 +879,7 @@ IMPL_LINK( SwTableColumnPage, AutoClickHdl, void *, pControl ) aValueTbl[i] -= 1; } } - if (pControl == m_pUpBtn) + if (pControl == m_pUpBtn.get()) { if( aValueTbl[ MET_FIELDS -1 ] < nNoOfVisibleCols -1 ) { @@ -1311,8 +1350,31 @@ SwTextFlowPage::SwTextFlowPage(vcl::Window* pParent, const SfxItemSet& rSet) HeadLineCBClickHdl(); } - SwTextFlowPage::~SwTextFlowPage() +SwTextFlowPage::~SwTextFlowPage() +{ + dispose(); +} + +void SwTextFlowPage::dispose() { + m_pPgBrkCB.clear(); + m_pPgBrkRB.clear(); + m_pColBrkRB.clear(); + m_pPgBrkBeforeRB.clear(); + m_pPgBrkAfterRB.clear(); + m_pPageCollCB.clear(); + m_pPageCollLB.clear(); + m_pPageNoFT.clear(); + m_pPageNoNF.clear(); + m_pSplitCB.clear(); + m_pSplitRowCB.clear(); + m_pKeepCB.clear(); + m_pHeadLineCB.clear(); + m_pRepeatHeaderNF.clear(); + m_pRepeatHeaderCombo.clear(); + m_pTextDirectionLB.clear(); + m_pVertOrientLB.clear(); + SfxTabPage::dispose(); } SfxTabPage* SwTextFlowPage::Create( vcl::Window* pParent, diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 49107998bec0..7ddf9351d0d7 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -106,11 +106,12 @@ public: const OUString& rEditTitle, const OUString& rDefault ); virtual ~SwStringInputDlg(); + virtual void dispose() SAL_OVERRIDE; OUString GetInputString() const; private: - Edit* m_pEdInput; // Edit obtains the focus. + VclPtr<Edit> m_pEdInput; // Edit obtains the focus. }; SwStringInputDlg::SwStringInputDlg(vcl::Window* pParent, const OUString& rTitle, @@ -131,6 +132,13 @@ OUString SwStringInputDlg::GetInputString() const SwStringInputDlg::~SwStringInputDlg() { + dispose(); +} + +void SwStringInputDlg::dispose() +{ + m_pEdInput.clear(); + ModalDialog::dispose(); } // AutoFormat-Dialogue: @@ -183,6 +191,19 @@ void SwAutoFormatDlg::dispose() if (bCoreDataChanged) pTableTbl->Save(); delete pTableTbl; + m_pLbFormat.clear(); + m_pFormatting.clear(); + m_pBtnNumFormat.clear(); + m_pBtnBorder.clear(); + m_pBtnFont.clear(); + m_pBtnPattern.clear(); + m_pBtnAlignment.clear(); + m_pBtnOk.clear(); + m_pBtnCancel.clear(); + m_pBtnAdd.clear(); + m_pBtnRemove.clear(); + m_pBtnRename.clear(); + m_pWndPreview.clear(); SfxModalDialog::dispose(); } diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx index 15902b8a076a..34aae676751f 100644 --- a/sw/source/ui/utlui/swrenamexnameddlg.cxx +++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx @@ -74,6 +74,18 @@ SwRenameXNamedDlg::SwRenameXNamedDlg( vcl::Window* pWin, m_pOk->Enable(false); } +SwRenameXNamedDlg::~SwRenameXNamedDlg() +{ + dispose(); +} + +void SwRenameXNamedDlg::dispose() +{ + m_pNewNameED.clear(); + m_pOk.clear(); + ModalDialog::dispose(); +} + IMPL_LINK_NOARG(SwRenameXNamedDlg, OkHdl) { try diff --git a/sw/source/uibase/dbui/dbui.cxx b/sw/source/uibase/dbui/dbui.cxx index fd94b2818d49..b768d117527f 100644 --- a/sw/source/uibase/dbui/dbui.cxx +++ b/sw/source/uibase/dbui/dbui.cxx @@ -42,6 +42,20 @@ PrintMonitor::PrintMonitor(vcl::Window *pParent, bool modal, PrintMonitorType eT m_pPrinting->Show(); } +PrintMonitor::~PrintMonitor() +{ + dispose(); +} + +void PrintMonitor::dispose() +{ + m_pDocName.clear(); + m_pPrinting.clear(); + m_pPrinter.clear(); + m_pPrintInfo.clear(); + CancelableModelessDialog::dispose(); +} + // Progress Indicator for Creation of personalized Mail Merge documents: CreateMonitor::CreateMonitor( vcl::Window *pParent, bool modal ) : CancelableDialog(pParent, modal, "MMCreatingDialog", @@ -57,6 +71,18 @@ CreateMonitor::CreateMonitor( vcl::Window *pParent, bool modal ) m_pCounting->SetText("..."); } +CreateMonitor::~CreateMonitor() +{ + dispose(); +} + +void CreateMonitor::dispose() +{ + m_pCancelButton.clear(); + m_pCounting.clear(); + CancelableModelessDialog::dispose(); +} + void CreateMonitor::UpdateCountingText() { OUString sText(m_sCountingPattern); @@ -88,7 +114,14 @@ CancelableDialog::CancelableDialog( vcl::Window *pParent, bool modal, CancelableDialog::~CancelableDialog() { + dispose(); +} + +void CancelableDialog::dispose() +{ EndDialog( 0 ); + m_pCancelButton.clear(); + ModelessDialog::dispose(); } void CancelableDialog::SetCancelHdl( const Link& rLink ) diff --git a/sw/source/uibase/dbui/mailmergechildwindow.cxx b/sw/source/uibase/dbui/mailmergechildwindow.cxx index e43731b1e399..df756fb7be3a 100644 --- a/sw/source/uibase/dbui/mailmergechildwindow.cxx +++ b/sw/source/uibase/dbui/mailmergechildwindow.cxx @@ -59,7 +59,7 @@ SwMailMergeChildWindow::SwMailMergeChildWindow( vcl::Window* _pParent, pInfo->aSize = pWindow->GetSizePixel(); } - static_cast<SwMailMergeChildWin *>(pWindow)->Initialize(pInfo); + static_cast<SwMailMergeChildWin *>(pWindow.get())->Initialize(pInfo); pWindow->Show(); } @@ -73,6 +73,17 @@ SwMailMergeChildWin::SwMailMergeChildWin(SfxBindings* _pBindings, m_pBackTB->SetButtonType( ButtonType::SYMBOLTEXT ); } +SwMailMergeChildWin::~SwMailMergeChildWin() +{ + dispose(); +} + +void SwMailMergeChildWin::dispose() +{ + m_pBackTB.clear(); + SfxFloatingWindow::dispose(); +} + IMPL_LINK_NOARG(SwMailMergeChildWin, BackHdl) { GetBindings().GetDispatcher()->Execute(FN_MAILMERGE_WIZARD, SfxCallMode::ASYNCHRON); diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx index 5474731df15d..12d958655b91 100644 --- a/sw/source/uibase/docvw/HeaderFooterWin.cxx +++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx @@ -175,7 +175,7 @@ SwHeaderFooterWin::~SwHeaderFooterWin( ) void SwHeaderFooterWin::dispose() { delete m_pPopupMenu; - delete m_pLine; + m_pLine.clear(); MenuButton::dispose(); } diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 01d95bab3a76..b8e459dcf2ce 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -56,12 +56,14 @@ namespace class SwBreakDashedLine : public SwDashedLine { private: - SwPageBreakWin* m_pWin; + VclPtr<SwPageBreakWin> m_pWin; public: SwBreakDashedLine( vcl::Window* pParent, Color& ( *pColorFn )(), SwPageBreakWin* pWin ) : SwDashedLine( pParent, pColorFn ), m_pWin( pWin ) {}; + virtual ~SwBreakDashedLine() { dispose(); } + virtual void dispose() SAL_OVERRIDE { m_pWin.clear(); SwDashedLine::dispose(); } virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE; }; @@ -124,13 +126,12 @@ void SwPageBreakWin::dispose() m_bDestroyed = true; m_aFadeTimer.Stop(); - delete m_pLine; - m_pLine = NULL; delete m_pPopupMenu; m_pPopupMenu = NULL; delete m_pMousePt; m_pMousePt = NULL; + m_pLine.clear(); MenuButton::dispose(); } diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 85834017931d..b16c1c6d41b6 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -193,8 +193,6 @@ void SwPostItMgr::CheckForRemovedPostIts() mvPostItFlds.remove(*it); if (GetActiveSidebarWin() == p->pPostIt) SetActiveSidebarWin(0); - if (p->pPostIt) - delete p->pPostIt; delete p; bRemoved = true; } @@ -244,7 +242,6 @@ void SwPostItMgr::RemoveItem( SfxBroadcaster* pBroadcast ) if (GetActiveSidebarWin() == p->pPostIt) SetActiveSidebarWin(0); mvPostItFlds.erase(i); - delete p->pPostIt; delete p; break; } @@ -1177,8 +1174,6 @@ void SwPostItMgr::RemoveSidebarWin() for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i != mvPostItFlds.end() ; ++i) { EndListening( *(const_cast<SfxBroadcaster*>((*i)->GetBroadCaster())) ); - if ((*i)->pPostIt) - delete (*i)->pPostIt; delete (*i); } mvPostItFlds.clear(); @@ -1497,7 +1492,7 @@ sw::annotation::SwAnnotationWin* SwPostItMgr::GetAnnotationWin(const SwPostItFie for(const_iterator i = mvPostItFlds.begin(); i != mvPostItFlds.end() ; ++i) { if ( (*i)->GetFmtFld().GetField() == pFld ) - return dynamic_cast<sw::annotation::SwAnnotationWin*>((*i)->pPostIt); + return dynamic_cast<sw::annotation::SwAnnotationWin*>((*i)->pPostIt.get()); } return NULL; } @@ -2030,13 +2025,13 @@ void SwPostItMgr::AssureStdModeAtShell() bool SwPostItMgr::HasActiveSidebarWin() const { - return mpActivePostIt != 0; + return mpActivePostIt != nullptr; } bool SwPostItMgr::HasActiveAnnotationWin() const { return HasActiveSidebarWin() && - dynamic_cast<sw::annotation::SwAnnotationWin*>(mpActivePostIt) != 0; + dynamic_cast<sw::annotation::SwAnnotationWin*>(mpActivePostIt.get()) != 0; } void SwPostItMgr::GrabFocusOnActiveSidebarWin() diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx index 21e6404427ba..4db2d5d8ab6f 100644 --- a/sw/source/uibase/docvw/SidebarWin.cxx +++ b/sw/source/uibase/docvw/SidebarWin.cxx @@ -156,9 +156,8 @@ void SwSidebarWin::dispose() { mpOutlinerView->SetWindow( 0 ); } - delete mpSidebarTxtControl; - mpSidebarTxtControl = 0; } + mpSidebarTxtControl.clear(); if ( mpOutlinerView ) { @@ -175,23 +174,20 @@ void SwSidebarWin::dispose() if (mpMetadataAuthor) { mpMetadataAuthor->RemoveEventListener( LINK( this, SwSidebarWin, WindowEventListener ) ); - delete mpMetadataAuthor; - mpMetadataAuthor = 0; } + mpMetadataAuthor.clear(); if (mpMetadataDate) { mpMetadataDate->RemoveEventListener( LINK( this, SwSidebarWin, WindowEventListener ) ); - delete mpMetadataDate; - mpMetadataDate = 0; } + mpMetadataDate.clear(); if (mpVScrollbar) { mpVScrollbar->RemoveEventListener( LINK( this, SwSidebarWin, WindowEventListener ) ); - delete mpVScrollbar; - mpVScrollbar = 0; } + mpVScrollbar.clear(); RemoveEventListener( LINK( this, SwSidebarWin, WindowEventListener ) ); @@ -204,8 +200,7 @@ void SwSidebarWin::dispose() delete mpTextRangeOverlay; mpTextRangeOverlay = NULL; - delete mpMenuButton; - mpMenuButton = 0; + mpMenuButton.clear(); if (mnEventId) Application::RemoveUserEvent( mnEventId ); @@ -1380,7 +1375,7 @@ void SwSidebarWin::SetChangeTracking( const SwPostItHelper::SwLayoutStatus aLayo bool SwSidebarWin::HasScrollbar() const { - return mpVScrollbar != 0; + return mpVScrollbar != nullptr; } bool SwSidebarWin::IsScrollbarVisible() const diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index 013fb24355ce..0522f13caee1 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -289,13 +289,12 @@ void SwSrcEditWindow::dispose() EndListening( *pTextEngine ); pTextEngine->RemoveView( pTextView ); - delete pHScrollbar; - delete pVScrollbar; - delete pTextView; delete pTextEngine; } - delete pOutWin; + pOutWin.clear(); + pHScrollbar.clear(); + pVScrollbar.clear(); vcl::Window::dispose(); } diff --git a/sw/source/uibase/envelp/syncbtn.cxx b/sw/source/uibase/envelp/syncbtn.cxx index a6b73da14126..361f2ba30989 100644 --- a/sw/source/uibase/envelp/syncbtn.cxx +++ b/sw/source/uibase/envelp/syncbtn.cxx @@ -53,7 +53,7 @@ SwSyncChildWin::SwSyncChildWin( vcl::Window* _pParent, pInfo->aSize = pWindow->GetSizePixel(); } - static_cast<SwSyncBtnDlg *>(pWindow)->Initialize(pInfo); + static_cast<SwSyncBtnDlg *>(pWindow.get())->Initialize(pInfo); pWindow->Show(); } @@ -68,6 +68,17 @@ SwSyncBtnDlg::SwSyncBtnDlg( SfxBindings* _pBindings, Show(); } +SwSyncBtnDlg::~SwSyncBtnDlg() +{ + dispose(); +} + +void SwSyncBtnDlg::dispose() +{ + m_pSyncBtn.clear(); + SfxFloatingWindow::dispose(); +} + IMPL_LINK_NOARG(SwSyncBtnDlg, BtnHdl) { SfxViewFrame::Current()->GetDispatcher()->Execute(FN_UPDATE_ALL_LINKS, SfxCallMode::ASYNCHRON); diff --git a/sw/source/uibase/inc/DropDownFieldDialog.hxx b/sw/source/uibase/inc/DropDownFieldDialog.hxx index 19c42cf7dbfc..a7ef05f126f1 100644 --- a/sw/source/uibase/inc/DropDownFieldDialog.hxx +++ b/sw/source/uibase/inc/DropDownFieldDialog.hxx @@ -33,12 +33,12 @@ namespace sw { class DropDownFieldDialog : public SvxStandardDialog { - ListBox* m_pListItemsLB; + VclPtr<ListBox> m_pListItemsLB; - OKButton* m_pOKPB; - PushButton* m_pNextPB; + VclPtr<OKButton> m_pOKPB; + VclPtr<PushButton> m_pNextPB; - PushButton* m_pEditPB; + VclPtr<PushButton> m_pEditPB; SwWrtShell &rSh; SwDropDownField* pDropField; @@ -48,6 +48,8 @@ class DropDownFieldDialog : public SvxStandardDialog public: DropDownFieldDialog( vcl::Window *pParent, SwWrtShell &rSh, SwField* pField, bool bNextButton = false ); + virtual ~DropDownFieldDialog(); + virtual void dispose() SAL_OVERRIDE; }; } //namespace sw diff --git a/sw/source/uibase/inc/FrameControl.hxx b/sw/source/uibase/inc/FrameControl.hxx index 0235084c4160..936be2a1cbc8 100644 --- a/sw/source/uibase/inc/FrameControl.hxx +++ b/sw/source/uibase/inc/FrameControl.hxx @@ -17,7 +17,7 @@ class Point; */ class SwFrameControl { - SwEditWin* m_pEditWin; + VclPtr<SwEditWin> m_pEditWin; const SwFrm* m_pFrm; public: diff --git a/sw/source/uibase/inc/FrameControlsManager.hxx b/sw/source/uibase/inc/FrameControlsManager.hxx index 42584a1c1da3..e87124b64be5 100644 --- a/sw/source/uibase/inc/FrameControlsManager.hxx +++ b/sw/source/uibase/inc/FrameControlsManager.hxx @@ -30,7 +30,7 @@ typedef std::map<const SwFrm*, SwFrameControlPtr> SwFrameControlPtrMap; class SwFrameControlsManager { private: - SwEditWin* m_pEditWin; + VclPtr<SwEditWin> m_pEditWin; std::map< FrameControlType, SwFrameControlPtrMap > m_aControls; public: diff --git a/sw/source/uibase/inc/HeaderFooterWin.hxx b/sw/source/uibase/inc/HeaderFooterWin.hxx index 78005bdb5777..32e30f5cc70b 100644 --- a/sw/source/uibase/inc/HeaderFooterWin.hxx +++ b/sw/source/uibase/inc/HeaderFooterWin.hxx @@ -20,10 +20,10 @@ */ class SwHeaderFooterWin : public MenuButton, public SwFrameControl { - OUString m_sLabel; + OUString m_sLabel; bool m_bIsHeader; PopupMenu* m_pPopupMenu; - vcl::Window* m_pLine; + VclPtr<vcl::Window> m_pLine; bool m_bIsAppearing; int m_nFadeRate; Timer m_aFadeTimer; diff --git a/sw/source/uibase/inc/PageBreakWin.hxx b/sw/source/uibase/inc/PageBreakWin.hxx index 1c6987b5dec5..d1b048fbc1a3 100644 --- a/sw/source/uibase/inc/PageBreakWin.hxx +++ b/sw/source/uibase/inc/PageBreakWin.hxx @@ -23,7 +23,7 @@ class SwPageFrm; class SwPageBreakWin : public MenuButton, public SwFrameControl { PopupMenu* m_pPopupMenu; - vcl::Window* m_pLine; + VclPtr<vcl::Window> m_pLine; bool m_bIsAppearing; int m_nFadeRate; int m_nDelayAppearing; ///< Before we show the control, let it transparent for a few timer ticks to avoid appearing with every mouse over. diff --git a/sw/source/uibase/inc/abstract.hxx b/sw/source/uibase/inc/abstract.hxx index 92443efa9d9d..0c12d35e1812 100644 --- a/sw/source/uibase/inc/abstract.hxx +++ b/sw/source/uibase/inc/abstract.hxx @@ -25,13 +25,13 @@ class SwInsertAbstractDlg : public SfxModalDialog { - NumericField* m_pLevelNF; - NumericField* m_pParaNF; - -protected: + VclPtr<NumericField> m_pLevelNF; + VclPtr<NumericField> m_pParaNF; public: SwInsertAbstractDlg( vcl::Window* pParent ); + virtual ~SwInsertAbstractDlg(); + virtual void dispose() SAL_OVERRIDE; sal_uInt8 GetLevel() const; sal_uInt8 GetPara() const; diff --git a/sw/source/uibase/inc/ascfldlg.hxx b/sw/source/uibase/inc/ascfldlg.hxx index 827d5032bcbc..b7e693814c3c 100644 --- a/sw/source/uibase/inc/ascfldlg.hxx +++ b/sw/source/uibase/inc/ascfldlg.hxx @@ -32,14 +32,14 @@ class SwDocShell; class SwAsciiFilterDlg : public SfxModalDialog { - SvxTextEncodingBox* m_pCharSetLB; - FixedText* m_pFontFT; - ListBox* m_pFontLB; - FixedText* m_pLanguageFT; - SvxLanguageBox* m_pLanguageLB; - RadioButton* m_pCRLF_RB; - RadioButton* m_pCR_RB; - RadioButton* m_pLF_RB; + VclPtr<SvxTextEncodingBox> m_pCharSetLB; + VclPtr<FixedText> m_pFontFT; + VclPtr<ListBox> m_pFontLB; + VclPtr<FixedText> m_pLanguageFT; + VclPtr<SvxLanguageBox> m_pLanguageLB; + VclPtr<RadioButton> m_pCRLF_RB; + VclPtr<RadioButton> m_pCR_RB; + VclPtr<RadioButton> m_pLF_RB; bool m_bSaveLineStatus; DECL_LINK( CharSetSelHdl, SvxTextEncodingBox* ); @@ -53,6 +53,7 @@ public: SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh, SvStream* pStream ); virtual ~SwAsciiFilterDlg(); + virtual void dispose() SAL_OVERRIDE; void FillOptions( SwAsciiOptions& rOptions ); }; diff --git a/sw/source/uibase/inc/bookmark.hxx b/sw/source/uibase/inc/bookmark.hxx index d64a08e69a8f..1185317191d6 100644 --- a/sw/source/uibase/inc/bookmark.hxx +++ b/sw/source/uibase/inc/bookmark.hxx @@ -47,9 +47,9 @@ public: class SwInsertBookmarkDlg: public SvxStandardDialog { - BookmarkCombo* m_pBookmarkBox; - OKButton* m_pOkBtn; - PushButton* m_pDeleteBtn; + VclPtr<BookmarkCombo> m_pBookmarkBox; + VclPtr<OKButton> m_pOkBtn; + VclPtr<PushButton> m_pDeleteBtn; OUString sRemoveWarning; SwWrtShell &rSh; @@ -63,6 +63,7 @@ class SwInsertBookmarkDlg: public SvxStandardDialog public: SwInsertBookmarkDlg(vcl::Window *pParent, SwWrtShell &rSh, SfxRequest& rReq); virtual ~SwInsertBookmarkDlg(); + virtual void dispose() SAL_OVERRIDE; }; #endif diff --git a/sw/source/uibase/inc/break.hxx b/sw/source/uibase/inc/break.hxx index 55610b7dbe8c..85ce67b0ce26 100644 --- a/sw/source/uibase/inc/break.hxx +++ b/sw/source/uibase/inc/break.hxx @@ -37,13 +37,13 @@ class SwWrtShell; class SwBreakDlg: public SvxStandardDialog { SwWrtShell &rSh; - RadioButton* m_pLineBtn; - RadioButton* m_pColumnBtn; - RadioButton* m_pPageBtn; - FixedText* m_pPageCollText; - ListBox* m_pPageCollBox; - CheckBox* m_pPageNumBox; - NumericField* m_pPageNumEdit; + VclPtr<RadioButton> m_pLineBtn; + VclPtr<RadioButton> m_pColumnBtn; + VclPtr<RadioButton> m_pPageBtn; + VclPtr<FixedText> m_pPageCollText; + VclPtr<ListBox> m_pPageCollBox; + VclPtr<CheckBox> m_pPageNumBox; + VclPtr<NumericField> m_pPageNumEdit; OUString aTemplate; sal_uInt16 nKind; @@ -64,6 +64,7 @@ protected: public: SwBreakDlg( vcl::Window *pParent, SwWrtShell &rSh ); virtual ~SwBreakDlg(); + virtual void dispose() SAL_OVERRIDE; OUString GetTemplateName() { return aTemplate; } sal_uInt16 GetKind() { return nKind; } diff --git a/sw/source/uibase/inc/changedb.hxx b/sw/source/uibase/inc/changedb.hxx index 558ea2f2d9e9..c10948bab9c2 100644 --- a/sw/source/uibase/inc/changedb.hxx +++ b/sw/source/uibase/inc/changedb.hxx @@ -35,11 +35,11 @@ struct SwDBData; // exchange database at fields class SwChangeDBDlg: public SvxStandardDialog { - SvTreeListBox* m_pUsedDBTLB; - SwDBTreeList* m_pAvailDBTLB; - PushButton* m_pAddDBPB; - FixedText* m_pDocDBNameFT; - PushButton* m_pDefineBT; + VclPtr<SvTreeListBox> m_pUsedDBTLB; + VclPtr<SwDBTreeList> m_pAvailDBTLB; + VclPtr<PushButton> m_pAddDBPB; + VclPtr<FixedText> m_pDocDBNameFT; + VclPtr<PushButton> m_pDefineBT; ImageList aImageList; diff --git a/sw/source/uibase/inc/chrdlg.hxx b/sw/source/uibase/inc/chrdlg.hxx index 27e394ce5529..66914be44690 100644 --- a/sw/source/uibase/inc/chrdlg.hxx +++ b/sw/source/uibase/inc/chrdlg.hxx @@ -59,17 +59,17 @@ public: class SwCharURLPage : public SfxTabPage { - Edit* m_pURLED; - FixedText* m_pTextFT; - Edit* m_pTextED; - Edit* m_pNameED; - ComboBox* m_pTargetFrmLB; - PushButton* m_pURLPB; - PushButton* m_pEventPB; - ListBox* m_pVisitedLB; - ListBox* m_pNotVisitedLB; - - VclContainer* m_pCharStyleContainer; + VclPtr<Edit> m_pURLED; + VclPtr<FixedText> m_pTextFT; + VclPtr<Edit> m_pTextED; + VclPtr<Edit> m_pNameED; + VclPtr<ComboBox> m_pTargetFrmLB; + VclPtr<PushButton> m_pURLPB; + VclPtr<PushButton> m_pEventPB; + VclPtr<ListBox> m_pVisitedLB; + VclPtr<ListBox> m_pNotVisitedLB; + + VclPtr<VclContainer> m_pCharStyleContainer; SvxMacroItem* pINetItem; bool bModified; diff --git a/sw/source/uibase/inc/column.hxx b/sw/source/uibase/inc/column.hxx index 548784e3ee46..19d3f72dd20b 100644 --- a/sw/source/uibase/inc/column.hxx +++ b/sw/source/uibase/inc/column.hxx @@ -42,10 +42,10 @@ class SwColumnPage; class SwColumnDlg : public SfxModalDialog { - ListBox* m_pApplyToLB; + VclPtr<ListBox> m_pApplyToLB; SwWrtShell& rWrtShell; - SwColumnPage* pTabPage; + VclPtr<SwColumnPage> pTabPage; SfxItemSet* pPageSet; SfxItemSet* pSectionSet; SfxItemSet* pSelectionSet; @@ -89,39 +89,39 @@ public: // column dialog now as TabPage class SwColumnPage : public SfxTabPage { - NumericField* m_pCLNrEdt; - ColumnValueSet* m_pDefaultVS; - CheckBox* m_pBalanceColsCB; + VclPtr<NumericField> m_pCLNrEdt; + VclPtr<ColumnValueSet> m_pDefaultVS; + VclPtr<CheckBox> m_pBalanceColsCB; - PushButton* m_pBtnBack; - FixedText* m_pLbl1; + VclPtr<PushButton> m_pBtnBack; + VclPtr<FixedText> m_pLbl1; PercentField aEd1; - FixedText* m_pLbl2; + VclPtr<FixedText> m_pLbl2; PercentField aEd2; - FixedText* m_pLbl3; + VclPtr<FixedText> m_pLbl3; PercentField aEd3; - PushButton* m_pBtnNext; + VclPtr<PushButton> m_pBtnNext; PercentField aDistEd1; PercentField aDistEd2; - CheckBox* m_pAutoWidthBox; - - FixedText* m_pLineTypeLbl; - LineListBox* m_pLineTypeDLB; - FixedText* m_pLineWidthLbl; - MetricField* m_pLineWidthEdit; - FixedText* m_pLineColorLbl; - ColorListBox* m_pLineColorDLB; - FixedText* m_pLineHeightLbl; - MetricField* m_pLineHeightEdit; - FixedText* m_pLinePosLbl; - ListBox* m_pLinePosDLB; - - FixedText* m_pTextDirectionFT; - ListBox* m_pTextDirectionLB; + VclPtr<CheckBox> m_pAutoWidthBox; + + VclPtr<FixedText> m_pLineTypeLbl; + VclPtr<LineListBox> m_pLineTypeDLB; + VclPtr<FixedText> m_pLineWidthLbl; + VclPtr<MetricField> m_pLineWidthEdit; + VclPtr<FixedText> m_pLineColorLbl; + VclPtr<ColorListBox> m_pLineColorDLB; + VclPtr<FixedText> m_pLineHeightLbl; + VclPtr<MetricField> m_pLineHeightEdit; + VclPtr<FixedText> m_pLinePosLbl; + VclPtr<ListBox> m_pLinePosDLB; + + VclPtr<FixedText> m_pTextDirectionFT; + VclPtr<ListBox> m_pTextDirectionLB; // Example - SwColExample* m_pPgeExampleWN; - SwColumnOnlyExample* m_pFrmExampleWN; + VclPtr<SwColExample> m_pPgeExampleWN; + VclPtr<SwColumnOnlyExample> m_pFrmExampleWN; SwColMgr* pColMgr; @@ -132,7 +132,7 @@ class SwColumnPage : public SfxTabPage sal_uInt16 nMinWidth; PercentField* pModifiedField; - std::map<MetricField*, PercentField*> m_aPercentFieldsMap; + std::map<VclPtr<MetricField>, PercentField*> m_aPercentFieldsMap; bool bFormat; bool bFrm; diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index 1d955ad5d851..18a69d987dcb 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -233,11 +233,11 @@ private: ImageList aEntryImages; SwWrtShell* pActiveShell; - SvTreeListEntry* pEmphasisEntry; // Drag'n Drop emphasis - SvTreeListEntry* pDDSource; // source for Drag'n Drop + SvTreeListEntry* pEmphasisEntry; // Drag'n Drop emphasis + SvTreeListEntry* pDDSource; // source for Drag'n Drop SwGlblDocContents* pSwGlblDocContents; // array with sorted content - vcl::Window* pDefParentWin; + VclPtr<vcl::Window> pDefParentWin; SwGlblDocContent* pDocContent; sfx2::DocumentInserter* pDocInserter; diff --git a/sw/source/uibase/inc/convert.hxx b/sw/source/uibase/inc/convert.hxx index 083103728c8c..1a52d8ba2c99 100644 --- a/sw/source/uibase/inc/convert.hxx +++ b/sw/source/uibase/inc/convert.hxx @@ -32,24 +32,24 @@ struct SwInsertTableOptions; class SwConvertTableDlg: public SfxModalDialog { - RadioButton* mpTabBtn; - RadioButton* mpSemiBtn; - RadioButton* mpParaBtn; - RadioButton* mpOtherBtn; - Edit* mpOtherEd; - CheckBox* mpKeepColumn; + VclPtr<RadioButton> mpTabBtn; + VclPtr<RadioButton> mpSemiBtn; + VclPtr<RadioButton> mpParaBtn; + VclPtr<RadioButton> mpOtherBtn; + VclPtr<Edit> mpOtherEd; + VclPtr<CheckBox> mpKeepColumn; - VclContainer* mpOptions; + VclPtr<VclContainer> mpOptions; - CheckBox* mpHeaderCB; - CheckBox* mpRepeatHeaderCB; + VclPtr<CheckBox> mpHeaderCB; + VclPtr<CheckBox> mpRepeatHeaderCB; - VclContainer* mpRepeatRows; - NumericField* mpRepeatHeaderNF; + VclPtr<VclContainer> mpRepeatRows; + VclPtr<NumericField> mpRepeatHeaderNF; - CheckBox* mpDontSplitCB; - CheckBox* mpBorderCB; - PushButton* mpAutoFmtBtn; + VclPtr<CheckBox> mpDontSplitCB; + VclPtr<CheckBox> mpBorderCB; + VclPtr<PushButton> mpAutoFmtBtn; OUString sConvertTextTable; SwTableAutoFmt* pTAutoFmt; diff --git a/sw/source/uibase/inc/cption.hxx b/sw/source/uibase/inc/cption.hxx index 4fef9bbbabe9..5f99c2025360 100644 --- a/sw/source/uibase/inc/cption.hxx +++ b/sw/source/uibase/inc/cption.hxx @@ -63,24 +63,24 @@ public: class SwCaptionDialog : public SvxStandardDialog { - Edit* m_pTextEdit; - ComboBox* m_pCategoryBox; + VclPtr<Edit> m_pTextEdit; + VclPtr<ComboBox> m_pCategoryBox; OUString m_sNone; TextFilterAutoConvert m_aTextFilter; - FixedText* m_pFormatText; - ListBox* m_pFormatBox; + VclPtr<FixedText> m_pFormatText; + VclPtr<ListBox> m_pFormatBox; //#i61007# order of captions - FixedText* m_pNumberingSeparatorFT; - Edit* m_pNumberingSeparatorED; - FixedText* m_pSepText; - Edit* m_pSepEdit; - FixedText* m_pPosText; - ListBox* m_pPosBox; - OKButton* m_pOKButton; - PushButton* m_pAutoCaptionButton; - PushButton* m_pOptionButton; - - SwCaptionPreview* m_pPreview; + VclPtr<FixedText> m_pNumberingSeparatorFT; + VclPtr<Edit> m_pNumberingSeparatorED; + VclPtr<FixedText> m_pSepText; + VclPtr<Edit> m_pSepEdit; + VclPtr<FixedText> m_pPosText; + VclPtr<ListBox> m_pPosBox; + VclPtr<OKButton> m_pOKButton; + VclPtr<PushButton> m_pAutoCaptionButton; + VclPtr<PushButton> m_pOptionButton; + + VclPtr<SwCaptionPreview> m_pPreview; SwView &rView; // search per active, avoid View SwFldMgr *pMgr; // pointer to save the include diff --git a/sw/source/uibase/inc/dbinsdlg.hxx b/sw/source/uibase/inc/dbinsdlg.hxx index 4d6471536ff7..260a7fcc96e1 100644 --- a/sw/source/uibase/inc/dbinsdlg.hxx +++ b/sw/source/uibase/inc/dbinsdlg.hxx @@ -87,38 +87,38 @@ public: class SwInsertDBColAutoPilot : public SfxModalDialog, public utl::ConfigItem { - RadioButton* m_pRbAsTable; - RadioButton* m_pRbAsField; - RadioButton* m_pRbAsText; + VclPtr<RadioButton> m_pRbAsTable; + VclPtr<RadioButton> m_pRbAsField; + VclPtr<RadioButton> m_pRbAsText; - VclFrame* m_pHeadFrame; + VclPtr<VclFrame> m_pHeadFrame; - ListBox* m_pLbTblDbColumn; - ListBox* m_pLbTxtDbColumn; + VclPtr<ListBox> m_pLbTblDbColumn; + VclPtr<ListBox> m_pLbTxtDbColumn; - VclFrame* m_pFormatFrame; - RadioButton* m_pRbDbFmtFromDb; - RadioButton* m_pRbDbFmtFromUsr; - NumFormatListBox* m_pLbDbFmtFromUsr; + VclPtr<VclFrame> m_pFormatFrame; + VclPtr<RadioButton> m_pRbDbFmtFromDb; + VclPtr<RadioButton> m_pRbDbFmtFromUsr; + VclPtr<NumFormatListBox> m_pLbDbFmtFromUsr; // Page Text/Field - PushButton* m_pIbDbcolToEdit; - VclMultiLineEdit* m_pEdDbText; - FixedText* m_pFtDbParaColl; - ListBox* m_pLbDbParaColl; + VclPtr<PushButton> m_pIbDbcolToEdit; + VclPtr<VclMultiLineEdit> m_pEdDbText; + VclPtr<FixedText> m_pFtDbParaColl; + VclPtr<ListBox> m_pLbDbParaColl; // Page Table - PushButton* m_pIbDbcolAllTo; - PushButton* m_pIbDbcolOneTo; - PushButton* m_pIbDbcolOneFrom; - PushButton* m_pIbDbcolAllFrom; - FixedText* m_pFtTableCol; - ListBox* m_pLbTableCol; - CheckBox* m_pCbTableHeadon; - RadioButton* m_pRbHeadlColnms; - RadioButton* m_pRbHeadlEmpty; - PushButton* m_pPbTblFormat; - PushButton* m_pPbTblAutofmt; + VclPtr<PushButton> m_pIbDbcolAllTo; + VclPtr<PushButton> m_pIbDbcolOneTo; + VclPtr<PushButton> m_pIbDbcolOneFrom; + VclPtr<PushButton> m_pIbDbcolAllFrom; + VclPtr<FixedText> m_pFtTableCol; + VclPtr<ListBox> m_pLbTableCol; + VclPtr<CheckBox> m_pCbTableHeadon; + VclPtr<RadioButton> m_pRbHeadlColnms; + VclPtr<RadioButton> m_pRbHeadlEmpty; + VclPtr<PushButton> m_pPbTblFormat; + VclPtr<PushButton> m_pPbTblAutofmt; SwInsDBColumns aDBColumns; const SwDBData aDBData; diff --git a/sw/source/uibase/inc/dbui.hxx b/sw/source/uibase/inc/dbui.hxx index 0649bcb9ca6e..00f1320ea75a 100644 --- a/sw/source/uibase/inc/dbui.hxx +++ b/sw/source/uibase/inc/dbui.hxx @@ -29,7 +29,7 @@ class SW_DLLPUBLIC CancelableDialog : public Dialog bool mbModal; protected: - CancelButton* m_pCancelButton; + VclPtr<CancelButton> m_pCancelButton; CancelableDialog( vcl::Window *pParent, bool modal, const OUString& rID, const OUString& rUIXMLDescription ); @@ -39,7 +39,9 @@ protected: using Dialog::StartExecuteModal; public: - virtual ~CancelableDialog(); + virtual ~CancelableModelessDialog(); + virtual void dispose() SAL_OVERRIDE; + void SetCancelHdl( const Link& rLink ); void Show(); }; @@ -53,18 +55,22 @@ public: MONITOR_TYPE_SAVE }; - FixedText* m_pDocName; - FixedText* m_pPrinting; - FixedText* m_pPrinter; - FixedText* m_pPrintInfo; + VclPtr<FixedText> m_pDocName; + VclPtr<FixedText> m_pPrinting; + VclPtr<FixedText> m_pPrinter; + VclPtr<FixedText> m_pPrintInfo; PrintMonitor( vcl::Window *pParent, bool modal, PrintMonitorType eType ); + virtual ~PrintMonitor(); + virtual void dispose() SAL_OVERRIDE; }; class CreateMonitor : public CancelableDialog { public: CreateMonitor( vcl::Window *pParent, bool modal ); + virtual ~CreateMonitor(); + virtual void dispose() SAL_OVERRIDE; void SetTotalCount( sal_Int32 nTotal ); void SetCurrentPosition( sal_Int32 nCurrent ); @@ -73,7 +79,7 @@ private: void UpdateCountingText(); private: - FixedText* m_pCounting; + VclPtr<FixedText> m_pCounting; OUString m_sCountingPattern; OUString m_sVariable_Total; diff --git a/sw/source/uibase/inc/docstdlg.hxx b/sw/source/uibase/inc/docstdlg.hxx index e02a80ea0369..67c5d5484e6a 100644 --- a/sw/source/uibase/inc/docstdlg.hxx +++ b/sw/source/uibase/inc/docstdlg.hxx @@ -32,6 +32,7 @@ class SwDocStatPage: public SfxTabPage public: SwDocStatPage(vcl::Window *pParent, const SfxItemSet &rSet); virtual ~SwDocStatPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage *Create(vcl::Window *pParent, const SfxItemSet *rSet); @@ -42,18 +43,18 @@ protected: DECL_LINK(UpdateHdl, void *); private: - FixedText* m_pPageNo; - FixedText* m_pTableNo; - FixedText* m_pGrfNo; - FixedText* m_pOLENo; - FixedText* m_pParaNo; - FixedText* m_pWordNo; - FixedText* m_pCharNo; - FixedText* m_pCharExclSpacesNo; + VclPtr<FixedText> m_pPageNo; + VclPtr<FixedText> m_pTableNo; + VclPtr<FixedText> m_pGrfNo; + VclPtr<FixedText> m_pOLENo; + VclPtr<FixedText> m_pParaNo; + VclPtr<FixedText> m_pWordNo; + VclPtr<FixedText> m_pCharNo; + VclPtr<FixedText> m_pCharExclSpacesNo; - FixedText* m_pLineLbl; - FixedText* m_pLineNo; - PushButton* m_pUpdatePB; + VclPtr<FixedText> m_pLineLbl; + VclPtr<FixedText> m_pLineNo; + VclPtr<PushButton> m_pUpdatePB; SwDocStat aDocStat; diff --git a/sw/source/uibase/inc/drawbase.hxx b/sw/source/uibase/inc/drawbase.hxx index b6aa7ea849ce..42c3adada3d1 100644 --- a/sw/source/uibase/inc/drawbase.hxx +++ b/sw/source/uibase/inc/drawbase.hxx @@ -33,7 +33,7 @@ class SwDrawBase protected: SwView* m_pView; SwWrtShell* m_pSh; - SwEditWin* m_pWin; + VclPtr<SwEditWin> m_pWin; Point m_aStartPos; // position of BeginCreate Point m_aMDPos; // position of MouseButtonDown sal_uInt16 m_nSlotId; diff --git a/sw/source/uibase/inc/drpcps.hxx b/sw/source/uibase/inc/drpcps.hxx index da73ac61c573..2cfb11f25385 100644 --- a/sw/source/uibase/inc/drpcps.hxx +++ b/sw/source/uibase/inc/drpcps.hxx @@ -45,20 +45,20 @@ class SwDropCapsPict; class SwDropCapsPage : public SfxTabPage { friend class SwDropCapsPict; - CheckBox* m_pDropCapsBox; - CheckBox* m_pWholeWordCB; - FixedText* m_pSwitchText; - NumericField* m_pDropCapsField; - FixedText* m_pLinesText; - NumericField* m_pLinesField; - FixedText* m_pDistanceText; - MetricField* m_pDistanceField; - FixedText* m_pTextText; - Edit* m_pTextEdit; - FixedText* m_pTemplateText; - ListBox* m_pTemplateBox; - - SwDropCapsPict* m_pPict; + VclPtr<CheckBox> m_pDropCapsBox; + VclPtr<CheckBox> m_pWholeWordCB; + VclPtr<FixedText> m_pSwitchText; + VclPtr<NumericField> m_pDropCapsField; + VclPtr<FixedText> m_pLinesText; + VclPtr<NumericField> m_pLinesField; + VclPtr<FixedText> m_pDistanceText; + VclPtr<MetricField> m_pDistanceField; + VclPtr<FixedText> m_pTextText; + VclPtr<Edit> m_pTextEdit; + VclPtr<FixedText> m_pTemplateText; + VclPtr<ListBox> m_pTemplateBox; + + VclPtr<SwDropCapsPict> m_pPict; bool bModified; bool bFormat; @@ -66,8 +66,7 @@ friend class SwDropCapsPict; SwWrtShell &rSh; - SwDropCapsPage(vcl::Window *pParent, const SfxItemSet &rSet); - virtual ~SwDropCapsPage(); + SwDropCapsPage(vcl::Window *pParent, const SfxItemSet &rSet); virtual int DeactivatePage(SfxItemSet *pSet) SAL_OVERRIDE; void FillSet( SfxItemSet &rSet ); @@ -83,6 +82,8 @@ friend class SwDropCapsPict; static const sal_uInt16 aPageRg[]; public: + virtual ~SwDropCapsPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage *Create(vcl::Window *pParent, const SfxItemSet *rSet); static const sal_uInt16* GetRanges() { return aPageRg; } diff --git a/sw/source/uibase/inc/envlop.hxx b/sw/source/uibase/inc/envlop.hxx index 9245e9ec5c49..84d369bfd624 100644 --- a/sw/source/uibase/inc/envlop.hxx +++ b/sw/source/uibase/inc/envlop.hxx @@ -78,20 +78,19 @@ public: class SwEnvPage : public SfxTabPage { - VclMultiLineEdit* m_pAddrEdit; - ListBox* m_pDatabaseLB; - ListBox* m_pTableLB; - ListBox* m_pDBFieldLB; - PushButton* m_pInsertBT; - CheckBox* m_pSenderBox; - VclMultiLineEdit* m_pSenderEdit; - SwEnvPreview* m_pPreview; + VclPtr<VclMultiLineEdit> m_pAddrEdit; + VclPtr<ListBox> m_pDatabaseLB; + VclPtr<ListBox> m_pTableLB; + VclPtr<ListBox> m_pDBFieldLB; + VclPtr<PushButton> m_pInsertBT; + VclPtr<CheckBox> m_pSenderBox; + VclPtr<VclMultiLineEdit> m_pSenderEdit; + VclPtr<SwEnvPreview> m_pPreview; SwWrtShell* pSh; OUString sActDBName; SwEnvPage(vcl::Window* pParent, const SfxItemSet& rSet); - virtual ~SwEnvPage(); DECL_LINK( DatabaseHdl, ListBox * ); DECL_LINK(FieldHdl, void *); @@ -105,6 +104,8 @@ class SwEnvPage : public SfxTabPage using SfxTabPage::DeactivatePage; public: + virtual ~SwEnvPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet); diff --git a/sw/source/uibase/inc/fldedt.hxx b/sw/source/uibase/inc/fldedt.hxx index 23f0685f6270..cb7bd4f718f7 100644 --- a/sw/source/uibase/inc/fldedt.hxx +++ b/sw/source/uibase/inc/fldedt.hxx @@ -28,9 +28,9 @@ class SwFldMgr; class SwFldEditDlg : public SfxSingleTabDialog { SwWrtShell* pSh; - PushButton* m_pPrevBT; - PushButton* m_pNextBT; - PushButton* m_pAddressBT; + VclPtr<PushButton> m_pPrevBT; + VclPtr<PushButton> m_pNextBT; + VclPtr<PushButton> m_pAddressBT; DECL_LINK(AddressHdl, void *); DECL_LINK(NextPrevHdl, Button *pBt = 0); diff --git a/sw/source/uibase/inc/fldmgr.hxx b/sw/source/uibase/inc/fldmgr.hxx index e24f19d89303..57cfeda448c8 100644 --- a/sw/source/uibase/inc/fldmgr.hxx +++ b/sw/source/uibase/inc/fldmgr.hxx @@ -24,6 +24,7 @@ #include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Any.h> #include <vector> +#include <vcl/vclptr.hxx> namespace com{namespace sun{namespace star{ namespace container{ @@ -75,7 +76,7 @@ struct SwInsertFld_Data ::com::sun::star::uno::Any aDBDataSource; ::com::sun::star::uno::Any aDBConnection; ::com::sun::star::uno::Any aDBColumn; - vcl::Window* pParent; // parent dialog used for SwWrtShell::StartInputFldDlg() + VclPtr<vcl::Window> pParent; // parent dialog used for SwWrtShell::StartInputFldDlg() SwInsertFld_Data(sal_uInt16 nType, sal_uInt16 nSub, const OUString& rPar1, const OUString& rPar2, sal_uLong nFmtId, SwWrtShell* pShell = NULL, sal_Unicode cSep = ' ', bool bIsAutoLanguage = true) : diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx index 6a3b396eb776..f87adb2f073c 100644 --- a/sw/source/uibase/inc/frmpage.hxx +++ b/sw/source/uibase/inc/frmpage.hxx @@ -42,52 +42,52 @@ struct SwPosition; class SwFrmPage: public SfxTabPage { // size - FixedText* m_pWidthFT; - FixedText* m_pWidthAutoFT; - PercentField m_aWidthED; - CheckBox* m_pRelWidthCB; - ListBox* m_pRelWidthRelationLB; - CheckBox* m_pAutoWidthCB; - - FixedText* m_pHeightFT; - FixedText* m_pHeightAutoFT; - PercentField m_aHeightED; - CheckBox* m_pRelHeightCB; - ListBox* m_pRelHeightRelationLB; - CheckBox* m_pAutoHeightCB; - - CheckBox* m_pFixedRatioCB; - PushButton* m_pRealSizeBT; + VclPtr<FixedText> m_pWidthFT; + VclPtr<FixedText> m_pWidthAutoFT; + PercentField m_aWidthED; + VclPtr<CheckBox> m_pRelWidthCB; + VclPtr<ListBox> m_pRelWidthRelationLB; + VclPtr<CheckBox> m_pAutoWidthCB; + + VclPtr<FixedText> m_pHeightFT; + VclPtr<FixedText> m_pHeightAutoFT; + PercentField m_aHeightED; + VclPtr<CheckBox> m_pRelHeightCB; + VclPtr<ListBox> m_pRelHeightRelationLB; + VclPtr<CheckBox> m_pAutoHeightCB; + + VclPtr<CheckBox> m_pFixedRatioCB; + VclPtr<PushButton> m_pRealSizeBT; // anchor - VclContainer* m_pAnchorFrame; - RadioButton* m_pAnchorAtPageRB; - RadioButton* m_pAnchorAtParaRB; - RadioButton* m_pAnchorAtCharRB; - RadioButton* m_pAnchorAsCharRB; - RadioButton* m_pAnchorAtFrameRB; + VclPtr<VclContainer> m_pAnchorFrame; + VclPtr<RadioButton> m_pAnchorAtPageRB; + VclPtr<RadioButton> m_pAnchorAtParaRB; + VclPtr<RadioButton> m_pAnchorAtCharRB; + VclPtr<RadioButton> m_pAnchorAsCharRB; + VclPtr<RadioButton> m_pAnchorAtFrameRB; // position - FixedText* m_pHorizontalFT; - ListBox* m_pHorizontalDLB; - FixedText* m_pAtHorzPosFT; - MetricField* m_pAtHorzPosED; - FixedText* m_pHoriRelationFT; - ListBox* m_pHoriRelationLB; - - CheckBox* m_pMirrorPagesCB; - - FixedText* m_pVerticalFT; - ListBox* m_pVerticalDLB; - FixedText* m_pAtVertPosFT; - MetricField* m_pAtVertPosED; - FixedText* m_pVertRelationFT; - ListBox* m_pVertRelationLB; + VclPtr<FixedText> m_pHorizontalFT; + VclPtr<ListBox> m_pHorizontalDLB; + VclPtr<FixedText> m_pAtHorzPosFT; + VclPtr<MetricField> m_pAtHorzPosED; + VclPtr<FixedText> m_pHoriRelationFT; + VclPtr<ListBox> m_pHoriRelationLB; + + VclPtr<CheckBox> m_pMirrorPagesCB; + + VclPtr<FixedText> m_pVerticalFT; + VclPtr<ListBox> m_pVerticalDLB; + VclPtr<FixedText> m_pAtVertPosFT; + VclPtr<MetricField> m_pAtVertPosED; + VclPtr<FixedText> m_pVertRelationFT; + VclPtr<ListBox> m_pVertRelationLB; // #i18732# - check box for new option 'FollowTextFlow' - CheckBox* m_pFollowTextFlowCB; + VclPtr<CheckBox> m_pFollowTextFlowCB; // example - SvxSwFrameExample* m_pExampleWN; + VclPtr<SvxSwFrameExample> m_pExampleWN; //'string provider' SvxSwFramePosString aFramePosString; @@ -175,7 +175,6 @@ class SwFrmPage: public SfxTabPage void EnableGraficMode( void ); // hides auto check boxes and re-org controls for "Real Size" button SwFrmPage(vcl::Window *pParent, const SfxItemSet &rSet); - virtual ~SwFrmPage(); SwWrtShell *getFrmDlgParentShell(); @@ -185,6 +184,8 @@ class SwFrmPage: public SfxTabPage static const sal_uInt16 aPageRg[]; public: + virtual ~SwFrmPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage *Create(vcl::Window *pParent, const SfxItemSet *rSet); static const sal_uInt16* GetRanges() { return aPageRg; } @@ -202,16 +203,16 @@ public: class SwGrfExtPage: public SfxTabPage { // mirror - VclContainer* m_pMirror; - CheckBox* m_pMirrorVertBox; - CheckBox* m_pMirrorHorzBox; - RadioButton* m_pAllPagesRB; - RadioButton* m_pLeftPagesRB; - RadioButton* m_pRightPagesRB; - BmpWindow* m_pBmpWin; + VclPtr<VclContainer> m_pMirror; + VclPtr<CheckBox> m_pMirrorVertBox; + VclPtr<CheckBox> m_pMirrorHorzBox; + VclPtr<RadioButton> m_pAllPagesRB; + VclPtr<RadioButton> m_pLeftPagesRB; + VclPtr<RadioButton> m_pRightPagesRB; + VclPtr<BmpWindow> m_pBmpWin; - Edit* m_pConnectED; - PushButton* m_pBrowseBT; + VclPtr<Edit> m_pConnectED; + VclPtr<PushButton> m_pBrowseBT; OUString aFilterName; OUString aGrfName, aNewGrfName; @@ -244,24 +245,25 @@ public: class SwFrmURLPage : public SfxTabPage { // hyperlink - Edit* pURLED; - PushButton* pSearchPB; - Edit* pNameED; - ComboBox* pFrameCB; + VclPtr<Edit> pURLED; + VclPtr<PushButton> pSearchPB; + VclPtr<Edit> pNameED; + VclPtr<ComboBox> pFrameCB; // image map - CheckBox* pServerCB; - CheckBox* pClientCB; + VclPtr<CheckBox> pServerCB; + VclPtr<CheckBox> pClientCB; DECL_LINK(InsertFileHdl, void *); SwFrmURLPage(vcl::Window *pParent, const SfxItemSet &rSet); - virtual ~SwFrmURLPage(); using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; public: + virtual ~SwFrmURLPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage *Create(vcl::Window *pParent, const SfxItemSet *rSet); @@ -271,29 +273,29 @@ public: class SwFrmAddPage : public SfxTabPage { - VclContainer* pNameFrame; - FixedText* pNameFT; - Edit* pNameED; - FixedText* pAltNameFT; - Edit* pAltNameED; - FixedText* pPrevFT; - ListBox* pPrevLB; - FixedText* pNextFT; - ListBox* pNextLB; - - VclContainer* pProtectFrame; - CheckBox* pProtectContentCB; - CheckBox* pProtectFrameCB; - CheckBox* pProtectSizeCB; - - VclContainer* m_pContentAlignFrame; - ListBox* m_pVertAlignLB; - - VclContainer* pPropertiesFrame; - CheckBox* pEditInReadonlyCB; - CheckBox* pPrintFrameCB; - FixedText* pTextFlowFT; - ListBox* pTextFlowLB; + VclPtr<VclContainer> pNameFrame; + VclPtr<FixedText> pNameFT; + VclPtr<Edit> pNameED; + VclPtr<FixedText> pAltNameFT; + VclPtr<Edit> pAltNameED; + VclPtr<FixedText> pPrevFT; + VclPtr<ListBox> pPrevLB; + VclPtr<FixedText> pNextFT; + VclPtr<ListBox> pNextLB; + + VclPtr<VclContainer> pProtectFrame; + VclPtr<CheckBox> pProtectContentCB; + VclPtr<CheckBox> pProtectFrameCB; + VclPtr<CheckBox> pProtectSizeCB; + + VclPtr<VclContainer> m_pContentAlignFrame; + VclPtr<ListBox> m_pVertAlignLB; + + VclPtr<VclContainer> pPropertiesFrame; + VclPtr<CheckBox> pEditInReadonlyCB; + VclPtr<CheckBox> pPrintFrameCB; + VclPtr<FixedText> pTextFlowFT; + VclPtr<ListBox> pTextFlowLB; SwWrtShell* pWrtSh; @@ -306,11 +308,12 @@ class SwFrmAddPage : public SfxTabPage DECL_LINK(ChainModifyHdl, ListBox*); SwFrmAddPage(vcl::Window *pParent, const SfxItemSet &rSet); - virtual ~SwFrmAddPage(); static const sal_uInt16 aAddPgRg[]; public: + virtual ~SwFrmAddPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create(vcl::Window *pParent, const SfxItemSet *rSet); static const sal_uInt16* GetRanges() { return aAddPgRg; } diff --git a/sw/source/uibase/inc/glosbib.hxx b/sw/source/uibase/inc/glosbib.hxx index 622b3cb20692..bcfe4a229eae 100644 --- a/sw/source/uibase/inc/glosbib.hxx +++ b/sw/source/uibase/inc/glosbib.hxx @@ -70,13 +70,13 @@ public: class SwGlossaryGroupDlg : public SvxStandardDialog { - FEdit* m_pNameED; - ListBox* m_pPathLB; - SwGlossaryGroupTLB* m_pGroupTLB; + VclPtr<FEdit> m_pNameED; + VclPtr<ListBox> m_pPathLB; + VclPtr<SwGlossaryGroupTLB> m_pGroupTLB; - PushButton* m_pNewPB; - PushButton* m_pDelPB; - PushButton* m_pRenamePB; + VclPtr<PushButton> m_pNewPB; + VclPtr<PushButton> m_pDelPB; + VclPtr<PushButton> m_pRenamePB; typedef std::vector< OUString> OUVector_t; OUVector_t m_RemovedArr; @@ -102,6 +102,7 @@ public: std::vector<OUString> const& rPathArr, SwGlossaryHdl *pGlosHdl); virtual ~SwGlossaryGroupDlg(); + virtual void dispose() SAL_OVERRIDE; const OUString& GetCreatedGroupName() const {return sCreatedGroup;} }; diff --git a/sw/source/uibase/inc/glossary.hxx b/sw/source/uibase/inc/glossary.hxx index 53b1d5c32d74..62ae7b46198e 100644 --- a/sw/source/uibase/inc/glossary.hxx +++ b/sw/source/uibase/inc/glossary.hxx @@ -88,19 +88,19 @@ class SwGlossaryDlg : public SvxStandardDialog friend class SwNewGlosNameDlg; friend class SwGlTreeListBox; - CheckBox* m_pInsertTipCB; - Edit* m_pNameED; - FixedText* m_pShortNameLbl; + VclPtr<CheckBox> m_pInsertTipCB; + VclPtr<Edit> m_pNameED; + VclPtr<FixedText> m_pShortNameLbl; TextFilter m_aNoSpaceFilter; - Edit* m_pShortNameEdit; - SwGlTreeListBox* m_pCategoryBox; - CheckBox* m_pFileRelCB; - CheckBox* m_pNetRelCB; - vcl::Window* m_pExampleWIN; - PushButton* m_pInsertBtn; - MenuButton* m_pEditBtn; - PushButton* m_pBibBtn; - PushButton* m_pPathBtn; + VclPtr<Edit> m_pShortNameEdit; + VclPtr<SwGlTreeListBox> m_pCategoryBox; + VclPtr<CheckBox> m_pFileRelCB; + VclPtr<CheckBox> m_pNetRelCB; + VclPtr<vcl::Window> m_pExampleWIN; + VclPtr<PushButton> m_pInsertBtn; + VclPtr<MenuButton> m_pEditBtn; + VclPtr<PushButton> m_pBibBtn; + VclPtr<PushButton> m_pPathBtn; OUString sReadonlyPath; diff --git a/sw/source/uibase/inc/inpdlg.hxx b/sw/source/uibase/inc/inpdlg.hxx index bf42fa788cf6..260423a01ba4 100644 --- a/sw/source/uibase/inc/inpdlg.hxx +++ b/sw/source/uibase/inc/inpdlg.hxx @@ -42,17 +42,19 @@ class SwFldInputDlg: public SvxStandardDialog SwSetExpField* pSetFld; SwUserFieldType* pUsrType; - Edit* m_pLabelED; + VclPtr<Edit> m_pLabelED; - VclMultiLineEdit* m_pEditED; + VclPtr<VclMultiLineEdit> m_pEditED; - OKButton* m_pOKBT; - PushButton* m_pNextBT; + VclPtr<OKButton> m_pOKBT; + VclPtr<PushButton> m_pNextBT; DECL_LINK(NextHdl, void *); public: SwFldInputDlg( vcl::Window *pParent, SwWrtShell &rSh, SwField* pField, bool bNextButton = false ); + virtual ~SwFldInputDlg(); + virtual void dispose() SAL_OVERRIDE; }; #endif diff --git a/sw/source/uibase/inc/inputwin.hxx b/sw/source/uibase/inc/inputwin.hxx index c4af0b0f8fc0..fdb4a6f4fb69 100644 --- a/sw/source/uibase/inc/inputwin.hxx +++ b/sw/source/uibase/inc/inputwin.hxx @@ -109,9 +109,9 @@ public: virtual ~SwInputChild(); SFX_DECL_CHILDWINDOW_WITHID( SwInputChild ); void SetFormula( const OUString& rFormula, bool bDelSel = true ) - { static_cast<SwInputWindow*>(pWindow)->SetFormula( + { static_cast<SwInputWindow*>(pWindow.get())->SetFormula( rFormula, bDelSel ); } - const SwView* GetView() const{return static_cast<SwInputWindow*>(pWindow)->GetView();} + const SwView* GetView() const{return static_cast<SwInputWindow*>(pWindow.get())->GetView();} }; diff --git a/sw/source/uibase/inc/insfnote.hxx b/sw/source/uibase/inc/insfnote.hxx index 05aace768913..8fee498f4022 100644 --- a/sw/source/uibase/inc/insfnote.hxx +++ b/sw/source/uibase/inc/insfnote.hxx @@ -40,19 +40,19 @@ class SwInsFootNoteDlg: public SvxStandardDialog bool bExtCharAvailable; bool bEdit; - VclFrame* m_pNumberFrame; - RadioButton* m_pNumberAutoBtn; - RadioButton* m_pNumberCharBtn; - Edit* m_pNumberCharEdit; - PushButton* m_pNumberExtChar; + VclPtr<VclFrame> m_pNumberFrame; + VclPtr<RadioButton> m_pNumberAutoBtn; + VclPtr<RadioButton> m_pNumberCharBtn; + VclPtr<Edit> m_pNumberCharEdit; + VclPtr<PushButton> m_pNumberExtChar; // everything for the selection footnote/endnote - RadioButton* m_pFtnBtn; - RadioButton* m_pEndNoteBtn; + VclPtr<RadioButton> m_pFtnBtn; + VclPtr<RadioButton> m_pEndNoteBtn; - PushButton* m_pOkBtn; - PushButton* m_pPrevBT; - PushButton* m_pNextBT; + VclPtr<PushButton> m_pOkBtn; + VclPtr<PushButton> m_pPrevBT; + VclPtr<PushButton> m_pNextBT; DECL_LINK(NumberCharHdl, void *); DECL_LINK(NumberEditHdl, void *); diff --git a/sw/source/uibase/inc/instable.hxx b/sw/source/uibase/inc/instable.hxx index 99659247baa6..1e1178306d4c 100644 --- a/sw/source/uibase/inc/instable.hxx +++ b/sw/source/uibase/inc/instable.hxx @@ -34,22 +34,22 @@ struct SwInsertTableOptions; class SwInsTableDlg : public SfxModalDialog { - Edit* m_pNameEdit; + VclPtr<Edit> m_pNameEdit; TextFilter m_aTextFilter; - NumericField* m_pColNF; - NumericField* m_pRowNF; + VclPtr<NumericField> m_pColNF; + VclPtr<NumericField> m_pRowNF; - CheckBox* m_pHeaderCB; - CheckBox* m_pRepeatHeaderCB; - NumericField* m_pRepeatHeaderNF; - VclContainer* m_pRepeatGroup; + VclPtr<CheckBox> m_pHeaderCB; + VclPtr<CheckBox> m_pRepeatHeaderCB; + VclPtr<NumericField> m_pRepeatHeaderNF; + VclPtr<VclContainer> m_pRepeatGroup; - CheckBox* m_pDontSplitCB; - CheckBox* m_pBorderCB; + VclPtr<CheckBox> m_pDontSplitCB; + VclPtr<CheckBox> m_pBorderCB; - PushButton* m_pInsertBtn; - PushButton* m_pAutoFmtBtn; + VclPtr<PushButton> m_pInsertBtn; + VclPtr<PushButton> m_pAutoFmtBtn; SwWrtShell* pShell; SwTableAutoFmt* pTAutoFmt; diff --git a/sw/source/uibase/inc/javaedit.hxx b/sw/source/uibase/inc/javaedit.hxx index 9768f41af15a..13b5295dc973 100644 --- a/sw/source/uibase/inc/javaedit.hxx +++ b/sw/source/uibase/inc/javaedit.hxx @@ -33,16 +33,16 @@ namespace sfx2 { class FileDialogHelper; } class SwJavaEditDialog : public SvxStandardDialog { private: - Edit* m_pTypeED; - RadioButton* m_pUrlRB; - RadioButton* m_pEditRB; - PushButton* m_pUrlPB; - Edit* m_pUrlED; - VclMultiLineEdit* m_pEditED; + VclPtr<Edit> m_pTypeED; + VclPtr<RadioButton> m_pUrlRB; + VclPtr<RadioButton> m_pEditRB; + VclPtr<PushButton> m_pUrlPB; + VclPtr<Edit> m_pUrlED; + VclPtr<VclMultiLineEdit> m_pEditED; - OKButton* m_pOKBtn; - PushButton* m_pPrevBtn; - PushButton* m_pNextBtn; + VclPtr<OKButton> m_pOKBtn; + VclPtr<PushButton> m_pPrevBtn; + VclPtr<PushButton> m_pNextBtn; OUString aText; OUString aType; @@ -54,7 +54,7 @@ private: SwFldMgr* pMgr; SwWrtShell* pSh; sfx2::FileDialogHelper* pFileDlg; - vcl::Window* pOldDefDlgParent; + VclPtr<vcl::Window> pOldDefDlgParent; DECL_LINK(OKHdl, void *); DECL_LINK(PrevHdl, void *); diff --git a/sw/source/uibase/inc/label.hxx b/sw/source/uibase/inc/label.hxx index 8369daa4e6c8..bb23e44c80e7 100644 --- a/sw/source/uibase/inc/label.hxx +++ b/sw/source/uibase/inc/label.hxx @@ -33,7 +33,7 @@ class SwLabDlg : public SfxTabDialog { SwLabelConfig aLabelsCfg; SwDBManager* pDBManager; - SwLabPrtPage* pPrtPage; + VclPtr<SwLabPrtPage> pPrtPage; std::vector<sal_uInt16> aTypeIds; std::vector<OUString> aMakes; diff --git a/sw/source/uibase/inc/linenum.hxx b/sw/source/uibase/inc/linenum.hxx index 7b3f0734dee6..ef0cb2b8dbdd 100644 --- a/sw/source/uibase/inc/linenum.hxx +++ b/sw/source/uibase/inc/linenum.hxx @@ -33,21 +33,21 @@ class SwLineNumberingDlg : public SfxModalDialog { private: SwWrtShell* pSh; - VclContainer* m_pBodyContent; - vcl::Window* m_pDivIntervalFT; - NumericField* m_pDivIntervalNF; - vcl::Window* m_pDivRowsFT; - NumericField* m_pNumIntervalNF; - ListBox* m_pCharStyleLB; - SwNumberingTypeListBox* m_pFormatLB; - ListBox* m_pPosLB; - MetricField* m_pOffsetMF; - Edit* m_pDivisorED; - CheckBox* m_pCountEmptyLinesCB; - CheckBox* m_pCountFrameLinesCB; - CheckBox* m_pRestartEachPageCB; - CheckBox* m_pNumberingOnCB; - CheckBox* m_pNumberingOnFooterHeader; + VclPtr<VclContainer> m_pBodyContent; + VclPtr<vcl::Window> m_pDivIntervalFT; + VclPtr<NumericField> m_pDivIntervalNF; + VclPtr<vcl::Window> m_pDivRowsFT; + VclPtr<NumericField> m_pNumIntervalNF; + VclPtr<ListBox> m_pCharStyleLB; + VclPtr<SwNumberingTypeListBox> m_pFormatLB; + VclPtr<ListBox> m_pPosLB; + VclPtr<MetricField> m_pOffsetMF; + VclPtr<Edit> m_pDivisorED; + VclPtr<CheckBox> m_pCountEmptyLinesCB; + VclPtr<CheckBox> m_pCountFrameLinesCB; + VclPtr<CheckBox> m_pRestartEachPageCB; + VclPtr<CheckBox> m_pNumberingOnCB; + VclPtr<CheckBox> m_pNumberingOnFooterHeader; DECL_LINK(OKHdl, void *); DECL_LINK(LineOnOffHdl, void * = 0); DECL_LINK(ModifyHdl, void * = 0); @@ -56,6 +56,7 @@ public: SwWrtShell* GetWrtShell() const { return pSh; } SwLineNumberingDlg(SwView *pVw); virtual ~SwLineNumberingDlg(); + virtual void dispose() SAL_OVERRIDE; }; #endif diff --git a/sw/source/uibase/inc/mailconfigpage.hxx b/sw/source/uibase/inc/mailconfigpage.hxx index 3e98da59dad1..96ecd2436217 100644 --- a/sw/source/uibase/inc/mailconfigpage.hxx +++ b/sw/source/uibase/inc/mailconfigpage.hxx @@ -33,20 +33,20 @@ class SwMailConfigPage : public SfxTabPage { friend class SwTestAccountSettingsDialog; - Edit* m_pDisplayNameED; - Edit* m_pAddressED; + VclPtr<Edit> m_pDisplayNameED; + VclPtr<Edit> m_pAddressED; - CheckBox* m_pReplyToCB; - FixedText* m_pReplyToFT; - Edit* m_pReplyToED; + VclPtr<CheckBox> m_pReplyToCB; + VclPtr<FixedText> m_pReplyToFT; + VclPtr<Edit> m_pReplyToED; - Edit* m_pServerED; - NumericField* m_pPortNF; + VclPtr<Edit> m_pServerED; + VclPtr<NumericField> m_pPortNF; - CheckBox* m_pSecureCB; + VclPtr<CheckBox> m_pSecureCB; - PushButton* m_pServerAuthenticationPB; - PushButton* m_pTestPB; + VclPtr<PushButton> m_pServerAuthenticationPB; + VclPtr<PushButton> m_pTestPB; SwMailMergeConfigItem* m_pConfigItem; diff --git a/sw/source/uibase/inc/mailmergechildwindow.hxx b/sw/source/uibase/inc/mailmergechildwindow.hxx index 35a76131c26f..742cb322437d 100644 --- a/sw/source/uibase/inc/mailmergechildwindow.hxx +++ b/sw/source/uibase/inc/mailmergechildwindow.hxx @@ -25,11 +25,13 @@ class SwMailMergeChildWin : public SfxFloatingWindow { - ToolBox* m_pBackTB; + VclPtr<ToolBox> m_pBackTB; DECL_LINK( BackHdl, void* ); public: SwMailMergeChildWin(SfxBindings*, SfxChildWindow*, vcl::Window *pParent); + virtual ~SwMailMergeChildWin(); + virtual void dispose() SAL_OVERRIDE; virtual void FillInfo(SfxChildWinInfo&) const SAL_OVERRIDE; }; diff --git a/sw/source/uibase/inc/mailmergehelper.hxx b/sw/source/uibase/inc/mailmergehelper.hxx index 5b4321bb2840..deb715c98e79 100644 --- a/sw/source/uibase/inc/mailmergehelper.hxx +++ b/sw/source/uibase/inc/mailmergehelper.hxx @@ -142,7 +142,7 @@ class SW_DLLPUBLIC SwAuthenticator : { OUString m_aUserName; OUString m_aPassword; - vcl::Window* m_pParentWindow; + VclPtr<vcl::Window> m_pParentWindow; public: SwAuthenticator() : m_pParentWindow(0) {} SwAuthenticator(const OUString& username, const OUString& password, vcl::Window* pParent) : diff --git a/sw/source/uibase/inc/mailmrge.hxx b/sw/source/uibase/inc/mailmrge.hxx index 615fb035553f..1ae4b78829de 100644 --- a/sw/source/uibase/inc/mailmrge.hxx +++ b/sw/source/uibase/inc/mailmrge.hxx @@ -51,46 +51,46 @@ class SwMailMergeDlg : public SvxStandardDialog { friend class SwXSelChgLstnr_Impl; - vcl::Window* m_pBeamerWin; - - RadioButton* m_pAllRB; - RadioButton* m_pMarkedRB; - RadioButton* m_pFromRB; - NumericField* m_pFromNF; - NumericField* m_pToNF; - - RadioButton* m_pPrinterRB; - RadioButton* m_pMailingRB; - RadioButton* m_pFileRB; - - CheckBox* m_pSingleJobsCB; - - FixedText* m_pSaveMergedDocumentFT; - RadioButton* m_pSaveSingleDocRB; - RadioButton* m_pSaveIndividualRB; - - CheckBox* m_pGenerateFromDataBaseCB; - - FixedText* m_pColumnFT; - ListBox* m_pColumnLB; - FixedText* m_pPathFT; - Edit* m_pPathED; - PushButton* m_pPathPB; - FixedText* m_pFilterFT; - ListBox* m_pFilterLB; - - ListBox* m_pAddressFldLB; - FixedText* m_pSubjectFT; - Edit* m_pSubjectED; - FixedText* m_pFormatFT; - FixedText* m_pAttachFT; - Edit* m_pAttachED; - PushButton* m_pAttachPB; - CheckBox* m_pFormatHtmlCB; - CheckBox* m_pFormatRtfCB; - CheckBox* m_pFormatSwCB; - - OKButton* m_pOkBTN; + VclPtr<vcl::Window> m_pBeamerWin; + + VclPtr<RadioButton> m_pAllRB; + VclPtr<RadioButton> m_pMarkedRB; + VclPtr<RadioButton> m_pFromRB; + VclPtr<NumericField> m_pFromNF; + VclPtr<NumericField> m_pToNF; + + VclPtr<RadioButton> m_pPrinterRB; + VclPtr<RadioButton> m_pMailingRB; + VclPtr<RadioButton> m_pFileRB; + + VclPtr<CheckBox> m_pSingleJobsCB; + + VclPtr<FixedText> m_pSaveMergedDocumentFT; + VclPtr<RadioButton> m_pSaveSingleDocRB; + VclPtr<RadioButton> m_pSaveIndividualRB; + + VclPtr<CheckBox> m_pGenerateFromDataBaseCB; + + VclPtr<FixedText> m_pColumnFT; + VclPtr<ListBox> m_pColumnLB; + VclPtr<FixedText> m_pPathFT; + VclPtr<Edit> m_pPathED; + VclPtr<PushButton> m_pPathPB; + VclPtr<FixedText> m_pFilterFT; + VclPtr<ListBox> m_pFilterLB; + + VclPtr<ListBox> m_pAddressFldLB; + VclPtr<FixedText> m_pSubjectFT; + VclPtr<Edit> m_pSubjectED; + VclPtr<FixedText> m_pFormatFT; + VclPtr<FixedText> m_pAttachFT; + VclPtr<Edit> m_pAttachED; + VclPtr<PushButton> m_pAttachPB; + VclPtr<CheckBox> m_pFormatHtmlCB; + VclPtr<CheckBox> m_pFormatRtfCB; + VclPtr<CheckBox> m_pFormatSwCB; + + VclPtr<OKButton> m_pOkBTN; SwMailMergeDlg_Impl* pImpl; @@ -139,9 +139,11 @@ public: class SwMailMergeCreateFromDlg : public ModalDialog { - RadioButton* m_pThisDocRB; + VclPtr<RadioButton> m_pThisDocRB; public: SwMailMergeCreateFromDlg(vcl::Window* pParent); + virtual ~SwMailMergeCreateFromDlg(); + virtual void dispose() SAL_OVERRIDE; bool IsThisDocument() const { return m_pThisDocRB->IsChecked(); @@ -150,9 +152,12 @@ public: class SwMailMergeFieldConnectionsDlg : public ModalDialog { - RadioButton* m_pUseExistingRB; + VclPtr<RadioButton> m_pUseExistingRB; public: SwMailMergeFieldConnectionsDlg(vcl::Window* pParent); + virtual ~SwMailMergeFieldConnectionsDlg(); + virtual void dispose() SAL_OVERRIDE; + bool IsUseExistingConnections() const { return m_pUseExistingRB->IsChecked(); diff --git a/sw/source/uibase/inc/mergetbl.hxx b/sw/source/uibase/inc/mergetbl.hxx index fe9882a1429b..5bd7548ca358 100644 --- a/sw/source/uibase/inc/mergetbl.hxx +++ b/sw/source/uibase/inc/mergetbl.hxx @@ -26,7 +26,7 @@ class SwMergeTblDlg : public SvxStandardDialog { - RadioButton* m_pMergePrevRB; + VclPtr<RadioButton> m_pMergePrevRB; bool& m_rMergePrev; protected: @@ -34,6 +34,8 @@ protected: public: SwMergeTblDlg( vcl::Window *pParent, bool& rWithPrev ); + virtual ~SwMergeTblDlg(); + virtual void dispose() SAL_OVERRIDE; }; #endif diff --git a/sw/source/uibase/inc/multmrk.hxx b/sw/source/uibase/inc/multmrk.hxx index 62ab97399cd8..2e9c26abaf82 100644 --- a/sw/source/uibase/inc/multmrk.hxx +++ b/sw/source/uibase/inc/multmrk.hxx @@ -32,8 +32,8 @@ class SwTOXMgr; class SwMultiTOXMarkDlg : public SvxStandardDialog { DECL_LINK( SelectHdl, ListBox * ); - FixedText* m_pTextFT; - ListBox* m_pTOXLB; + VclPtr<FixedText> m_pTextFT; + VclPtr<ListBox> m_pTOXLB; SwTOXMgr& rMgr; sal_uInt16 nPos; @@ -42,6 +42,7 @@ class SwMultiTOXMarkDlg : public SvxStandardDialog public: SwMultiTOXMarkDlg( vcl::Window* pParent, SwTOXMgr &rTOXMgr ); virtual ~SwMultiTOXMarkDlg(); + virtual void dispose() SAL_OVERRIDE; }; #endif // INCLUDED_SW_SOURCE_UIBASE_INC_MULTMRK_HXX diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx index 8b5b59565caa..1cb6b9fe021d 100644 --- a/sw/source/uibase/inc/navipi.hxx +++ b/sw/source/uibase/inc/navipi.hxx @@ -72,8 +72,8 @@ class SwNavigationPI : public vcl::Window, SwWrtShell *pContentWrtShell; SwView *pActContView; SwView *pCreateView; - SfxPopupWindow *pPopupWindow; - SfxPopupWindow *pFloatingWindow; + VclPtr<SfxPopupWindow> pPopupWindow; + VclPtr<SfxPopupWindow> pFloatingWindow; SfxChildWindowContext* pContextWin; diff --git a/sw/source/uibase/inc/num.hxx b/sw/source/uibase/inc/num.hxx index c4719c46ca4a..6e565c1b4431 100644 --- a/sw/source/uibase/inc/num.hxx +++ b/sw/source/uibase/inc/num.hxx @@ -49,43 +49,43 @@ struct SwBmpItemInfo class SwNumPositionTabPage : public SfxTabPage { - ListBox* m_pLevelLB; - VclFrame* m_pPositionFrame; + VclPtr<ListBox> m_pLevelLB; + VclPtr<VclFrame> m_pPositionFrame; // former set of controls shown for numbering rules containing list level // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION - FixedText* m_pDistBorderFT; - MetricField* m_pDistBorderMF; - CheckBox* m_pRelativeCB; - FixedText* m_pIndentFT; - MetricField* m_pIndentMF; - FixedText* m_pDistNumFT; - MetricField* m_pDistNumMF; - FixedText* m_pAlignFT; - ListBox* m_pAlignLB; + VclPtr<FixedText> m_pDistBorderFT; + VclPtr<MetricField> m_pDistBorderMF; + VclPtr<CheckBox> m_pRelativeCB; + VclPtr<FixedText> m_pIndentFT; + VclPtr<MetricField> m_pIndentMF; + VclPtr<FixedText> m_pDistNumFT; + VclPtr<MetricField> m_pDistNumMF; + VclPtr<FixedText> m_pAlignFT; + VclPtr<ListBox> m_pAlignLB; // new set of controls shown for numbering rules containing list level // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT - FixedText* m_pLabelFollowedByFT; - ListBox* m_pLabelFollowedByLB; - FixedText* m_pListtabFT; - MetricField* m_pListtabMF; - FixedText* m_pAlign2FT; - ListBox* m_pAlign2LB; - FixedText* m_pAlignedAtFT; - MetricField* m_pAlignedAtMF; - FixedText* m_pIndentAtFT; - MetricField* m_pIndentAtMF; + VclPtr<FixedText> m_pLabelFollowedByFT; + VclPtr<ListBox> m_pLabelFollowedByLB; + VclPtr<FixedText> m_pListtabFT; + VclPtr<MetricField> m_pListtabMF; + VclPtr<FixedText> m_pAlign2FT; + VclPtr<ListBox> m_pAlign2LB; + VclPtr<FixedText> m_pAlignedAtFT; + VclPtr<MetricField> m_pAlignedAtMF; + VclPtr<FixedText> m_pIndentAtFT; + VclPtr<MetricField> m_pIndentAtMF; - PushButton* m_pStandardPB; + VclPtr<PushButton> m_pStandardPB; - NumberingPreview* m_pPreviewWIN; + VclPtr<NumberingPreview> m_pPreviewWIN; SwNumRule* pActNum; SwNumRule* pSaveNum; SwWrtShell* pWrtSh; - SwOutlineTabDialog* pOutlineDlg; + VclPtr<SwOutlineTabDialog> pOutlineDlg; sal_uInt16 nActNumLvl; bool bModified : 1; diff --git a/sw/source/uibase/inc/numpara.hxx b/sw/source/uibase/inc/numpara.hxx index ab84db3e5cda..f17660d08f9f 100644 --- a/sw/source/uibase/inc/numpara.hxx +++ b/sw/source/uibase/inc/numpara.hxx @@ -29,23 +29,23 @@ // are performed. class SwParagraphNumTabPage : public SfxTabPage { - VclHBox* m_pOutlineStartBX; - ListBox* m_pOutlineLvLB; - VclHBox* m_pNumberStyleBX; - ListBox* m_pNumberStyleLB; - PushButton* m_pEditNumStyleBtn; + VclPtr<VclHBox> m_pOutlineStartBX; + VclPtr<ListBox> m_pOutlineLvLB; + VclPtr<VclHBox> m_pNumberStyleBX; + VclPtr<ListBox> m_pNumberStyleLB; + VclPtr<PushButton> m_pEditNumStyleBtn; - TriStateBox* m_pNewStartCB; - VclHBox* m_pNewStartBX; - TriStateBox* m_pNewStartNumberCB; - NumericField* m_pNewStartNF; + VclPtr<TriStateBox> m_pNewStartCB; + VclPtr<VclHBox> m_pNewStartBX; + VclPtr<TriStateBox> m_pNewStartNumberCB; + VclPtr<NumericField> m_pNewStartNF; - VclFrame* m_pCountParaFram; - TriStateBox* m_pCountParaCB; - TriStateBox* m_pRestartParaCountCB; + VclPtr<VclFrame> m_pCountParaFram; + VclPtr<TriStateBox> m_pCountParaCB; + VclPtr<TriStateBox> m_pRestartParaCountCB; - VclHBox* m_pRestartBX; - NumericField* m_pRestartNF; + VclPtr<VclHBox> m_pRestartBX; + VclPtr<NumericField> m_pRestartNF; // --> OD 2008-04-14 #outlinelevel# const OUString msOutlineNumbering; @@ -70,6 +70,7 @@ protected: public: virtual ~SwParagraphNumTabPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet ); diff --git a/sw/source/uibase/inc/optcomp.hxx b/sw/source/uibase/inc/optcomp.hxx index d33d22222fd4..7e486c22d3a4 100644 --- a/sw/source/uibase/inc/optcomp.hxx +++ b/sw/source/uibase/inc/optcomp.hxx @@ -34,10 +34,10 @@ class SwCompatibilityOptPage : public SfxTabPage { private: // controls - VclFrame* m_pMain; - ListBox* m_pFormattingLB; - SvxCheckListBox* m_pOptionsLB; - PushButton* m_pDefaultPB; + VclPtr<VclFrame> m_pMain; + VclPtr<ListBox> m_pFormattingLB; + VclPtr<SvxCheckListBox> m_pOptionsLB; + VclPtr<PushButton> m_pDefaultPB; // config item SvtCompatibilityOptions m_aConfigItem; // text of the user entry diff --git a/sw/source/uibase/inc/optload.hxx b/sw/source/uibase/inc/optload.hxx index 71c1759a1bea..6b1e53880ce1 100644 --- a/sw/source/uibase/inc/optload.hxx +++ b/sw/source/uibase/inc/optload.hxx @@ -39,21 +39,21 @@ class SwWrtShell; class SwLoadOptPage : public SfxTabPage { private: - RadioButton* m_pAlwaysRB; - RadioButton* m_pRequestRB; - RadioButton* m_pNeverRB; - - CheckBox* m_pAutoUpdateFields; - CheckBox* m_pAutoUpdateCharts; - - ListBox* m_pMetricLB; - FixedText* m_pTabFT; - MetricField* m_pTabMF; - CheckBox* m_pUseSquaredPageMode; - CheckBox* m_pUseCharUnit; - Edit* m_pWordCountED; - CheckBox* m_pShowStandardizedPageCount; - NumericField* m_pStandardizedPageSizeNF; + VclPtr<RadioButton> m_pAlwaysRB; + VclPtr<RadioButton> m_pRequestRB; + VclPtr<RadioButton> m_pNeverRB; + + VclPtr<CheckBox> m_pAutoUpdateFields; + VclPtr<CheckBox> m_pAutoUpdateCharts; + + VclPtr<ListBox> m_pMetricLB; + VclPtr<FixedText> m_pTabFT; + VclPtr<MetricField> m_pTabMF; + VclPtr<CheckBox> m_pUseSquaredPageMode; + VclPtr<CheckBox> m_pUseCharUnit; + VclPtr<Edit> m_pWordCountED; + VclPtr<CheckBox> m_pShowStandardizedPageCount; + VclPtr<NumericField> m_pStandardizedPageSizeNF; SwWrtShell* m_pWrtShell; sal_uInt16 m_nLastTab; @@ -64,6 +64,8 @@ private: public: SwLoadOptPage(vcl::Window* pParent, const SfxItemSet& rSet); + virtual ~SwLoadOptPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet); @@ -105,28 +107,28 @@ public: class SwCaptionOptPage : public SfxTabPage { private: - SvxCheckListBox* m_pCheckLB; - ListBox* m_pLbCaptionOrder; - SwCaptionPreview* m_pPreview; - - VclContainer* m_pSettingsGroup; - CaptionComboBox* m_pCategoryBox; - FixedText* m_pFormatText; - ListBox* m_pFormatBox; + VclPtr<SvxCheckListBox> m_pCheckLB; + VclPtr<ListBox> m_pLbCaptionOrder; + VclPtr<SwCaptionPreview> m_pPreview; + + VclPtr<VclContainer> m_pSettingsGroup; + VclPtr<CaptionComboBox> m_pCategoryBox; + VclPtr<FixedText> m_pFormatText; + VclPtr<ListBox> m_pFormatBox; //#i61007# order of captions - FixedText* m_pNumberingSeparatorFT; - Edit* m_pNumberingSeparatorED; - FixedText* m_pTextText; - Edit* m_pTextEdit; - ListBox* m_pPosBox; - - VclContainer* m_pNumCapt; - ListBox* m_pLbLevel; - Edit* m_pEdDelim; - - VclContainer* m_pCategory; - ListBox* m_pCharStyleLB; - CheckBox* m_pApplyBorderCB; + VclPtr<FixedText> m_pNumberingSeparatorFT; + VclPtr<Edit> m_pNumberingSeparatorED; + VclPtr<FixedText> m_pTextText; + VclPtr<Edit> m_pTextEdit; + VclPtr<ListBox> m_pPosBox; + + VclPtr<VclContainer> m_pNumCapt; + VclPtr<ListBox> m_pLbLevel; + VclPtr<Edit> m_pEdDelim; + + VclPtr<VclContainer> m_pCategory; + VclPtr<ListBox> m_pCharStyleLB; + VclPtr<CheckBox> m_pApplyBorderCB; OUString m_sSWTable; OUString m_sSWFrame; diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx index 63ebf50dd8e3..a586243ca71f 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -41,28 +41,28 @@ class FontList; // Tools->Options->Writer/Web->View class SwContentOptPage : public SfxTabPage { - CheckBox* m_pCrossCB; - - CheckBox* m_pHScrollBox; - CheckBox* m_pVScrollBox; - CheckBox* m_pAnyRulerCB; - CheckBox* m_pHRulerCBox; - ListBox* m_pHMetric; - CheckBox* m_pVRulerCBox; - CheckBox* m_pVRulerRightCBox; - ListBox* m_pVMetric; - CheckBox* m_pSmoothCBox; - - CheckBox* m_pGrfCB; - CheckBox* m_pTblCB; - CheckBox* m_pDrwCB; - CheckBox* m_pFldNameCB; - CheckBox* m_pPostItCB; - - VclFrame* m_pSettingsFrame; - FixedText* m_pSettingsLabel; - FixedText* m_pMetricLabel; - ListBox* m_pMetricLB; + VclPtr<CheckBox> m_pCrossCB; + + VclPtr<CheckBox> m_pHScrollBox; + VclPtr<CheckBox> m_pVScrollBox; + VclPtr<CheckBox> m_pAnyRulerCB; + VclPtr<CheckBox> m_pHRulerCBox; + VclPtr<ListBox> m_pHMetric; + VclPtr<CheckBox> m_pVRulerCBox; + VclPtr<CheckBox> m_pVRulerRightCBox; + VclPtr<ListBox> m_pVMetric; + VclPtr<CheckBox> m_pSmoothCBox; + + VclPtr<CheckBox> m_pGrfCB; + VclPtr<CheckBox> m_pTblCB; + VclPtr<CheckBox> m_pDrwCB; + VclPtr<CheckBox> m_pFldNameCB; + VclPtr<CheckBox> m_pPostItCB; + + VclPtr<VclFrame> m_pSettingsFrame; + VclPtr<FixedText> m_pSettingsLabel; + VclPtr<FixedText> m_pMetricLabel; + VclPtr<ListBox> m_pMetricLB; DECL_LINK(VertRulerHdl, CheckBox*); DECL_LINK(AnyRulerHdl, CheckBox*); @@ -70,6 +70,7 @@ public: SwContentOptPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~SwContentOptPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet); @@ -82,29 +83,29 @@ public: // TabPage printer settings additions class SwAddPrinterTabPage : public SfxTabPage { - CheckBox* m_pGrfCB; - CheckBox* m_pCtrlFldCB; - CheckBox* m_pBackgroundCB; - CheckBox* m_pBlackFontCB; - CheckBox* m_pPrintHiddenTextCB; - CheckBox* m_pPrintTextPlaceholderCB; - - VclFrame* m_pPagesFrame; - CheckBox* m_pLeftPageCB; - CheckBox* m_pRightPageCB; - CheckBox* m_pProspectCB; - CheckBox* m_pProspectCB_RTL; - - VclFrame* m_pCommentsFrame; - RadioButton* m_pNoRB; - RadioButton* m_pOnlyRB; - RadioButton* m_pEndRB; - RadioButton* m_pEndPageRB; - RadioButton* m_pInMarginsRB; - - CheckBox* m_pPrintEmptyPagesCB; - CheckBox* m_pPaperFromSetupCB; - ListBox* m_pFaxLB; + VclPtr<CheckBox> m_pGrfCB; + VclPtr<CheckBox> m_pCtrlFldCB; + VclPtr<CheckBox> m_pBackgroundCB; + VclPtr<CheckBox> m_pBlackFontCB; + VclPtr<CheckBox> m_pPrintHiddenTextCB; + VclPtr<CheckBox> m_pPrintTextPlaceholderCB; + + VclPtr<VclFrame> m_pPagesFrame; + VclPtr<CheckBox> m_pLeftPageCB; + VclPtr<CheckBox> m_pRightPageCB; + VclPtr<CheckBox> m_pProspectCB; + VclPtr<CheckBox> m_pProspectCB_RTL; + + VclPtr<VclFrame> m_pCommentsFrame; + VclPtr<RadioButton> m_pNoRB; + VclPtr<RadioButton> m_pOnlyRB; + VclPtr<RadioButton> m_pEndRB; + VclPtr<RadioButton> m_pEndPageRB; + VclPtr<RadioButton> m_pInMarginsRB; + + VclPtr<CheckBox> m_pPrintEmptyPagesCB; + VclPtr<CheckBox> m_pPaperFromSetupCB; + VclPtr<ListBox> m_pFaxLB; OUString sNone; @@ -117,6 +118,8 @@ class SwAddPrinterTabPage : public SfxTabPage SwAddPrinterTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); public: + virtual ~SwAddPrinterTabPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); @@ -132,20 +135,20 @@ public: class SwStdFontTabPage : public SfxTabPage { - FixedText* pLabelFT; - - ComboBox* pStandardBox; - FontSizeBox* pStandardHeightLB; - ComboBox* pTitleBox ; - FontSizeBox* pTitleHeightLB; - ComboBox* pListBox ; - FontSizeBox* pListHeightLB; - ComboBox* pLabelBox ; - FontSizeBox* pLabelHeightLB; - ComboBox* pIdxBox ; - FontSizeBox* pIndexHeightLB; - CheckBox* pDocOnlyCB ; - PushButton* pStandardPB; + VclPtr<FixedText> pLabelFT; + + VclPtr<ComboBox> pStandardBox; + VclPtr<FontSizeBox> pStandardHeightLB; + VclPtr<ComboBox> pTitleBox ; + VclPtr<FontSizeBox> pTitleHeightLB; + VclPtr<ComboBox> pListBox ; + VclPtr<FontSizeBox> pListHeightLB; + VclPtr<ComboBox> pLabelBox ; + VclPtr<FontSizeBox> pLabelHeightLB; + VclPtr<ComboBox> pIdxBox ; + VclPtr<FontSizeBox> pIndexHeightLB; + VclPtr<CheckBox> pDocOnlyCB ; + VclPtr<PushButton> pStandardPB; OUString sShellStd; OUString sShellTitle; @@ -203,24 +206,24 @@ public: class SwTableOptionsTabPage : public SfxTabPage { - CheckBox* pHeaderCB; - CheckBox* pRepeatHeaderCB; - CheckBox* pDontSplitCB; - CheckBox* pBorderCB; + VclPtr<CheckBox> pHeaderCB; + VclPtr<CheckBox> pRepeatHeaderCB; + VclPtr<CheckBox> pDontSplitCB; + VclPtr<CheckBox> pBorderCB; - CheckBox* pNumFormattingCB; - CheckBox* pNumFmtFormattingCB; - CheckBox* pNumAlignmentCB; + VclPtr<CheckBox> pNumFormattingCB; + VclPtr<CheckBox> pNumFmtFormattingCB; + VclPtr<CheckBox> pNumAlignmentCB; - MetricField* pRowMoveMF; - MetricField* pColMoveMF; + VclPtr<MetricField> pRowMoveMF; + VclPtr<MetricField> pColMoveMF; - MetricField* pRowInsertMF; - MetricField* pColInsertMF; + VclPtr<MetricField> pRowInsertMF; + VclPtr<MetricField> pColInsertMF; - RadioButton* pFixRB; - RadioButton* pFixPropRB; - RadioButton* pVarRB; + VclPtr<RadioButton> pFixRB; + VclPtr<RadioButton> pFixPropRB; + VclPtr<RadioButton> pVarRB; SwWrtShell* pWrtShell; bool bHTMLMode; @@ -229,9 +232,9 @@ class SwTableOptionsTabPage : public SfxTabPage SwTableOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); - virtual ~SwTableOptionsTabPage(); - public: + virtual ~SwTableOptionsTabPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); @@ -248,36 +251,37 @@ public: class SwShdwCrsrOptionsTabPage : public SfxTabPage { //nonprinting characters - CheckBox* m_pParaCB; - CheckBox* m_pSHyphCB; - CheckBox* m_pSpacesCB; - CheckBox* m_pHSpacesCB; - CheckBox* m_pTabCB; - CheckBox* m_pBreakCB; - CheckBox* m_pCharHiddenCB; - CheckBox* m_pFldHiddenCB; - CheckBox* m_pFldHiddenParaCB; - - VclFrame* m_pDirectCursorFrame; - CheckBox* m_pOnOffCB; - - RadioButton* m_pFillMarginRB; - RadioButton* m_pFillIndentRB; - RadioButton* m_pFillTabRB; - RadioButton* m_pFillSpaceRB; - - VclFrame* m_pCursorProtFrame; - CheckBox* m_pCrsrInProtCB; - CheckBox* m_pIgnoreProtCB; - - CheckBox* m_pMathBaselineAlignmentCB; + VclPtr<CheckBox> m_pParaCB; + VclPtr<CheckBox> m_pSHyphCB; + VclPtr<CheckBox> m_pSpacesCB; + VclPtr<CheckBox> m_pHSpacesCB; + VclPtr<CheckBox> m_pTabCB; + VclPtr<CheckBox> m_pBreakCB; + VclPtr<CheckBox> m_pCharHiddenCB; + VclPtr<CheckBox> m_pFldHiddenCB; + VclPtr<CheckBox> m_pFldHiddenParaCB; + + VclPtr<VclFrame> m_pDirectCursorFrame; + VclPtr<CheckBox> m_pOnOffCB; + + VclPtr<RadioButton> m_pFillMarginRB; + VclPtr<RadioButton> m_pFillIndentRB; + VclPtr<RadioButton> m_pFillTabRB; + VclPtr<RadioButton> m_pFillSpaceRB; + + VclPtr<VclFrame> m_pCursorProtFrame; + VclPtr<CheckBox> m_pCrsrInProtCB; + VclPtr<CheckBox> m_pIgnoreProtCB; + + VclPtr<CheckBox> m_pMathBaselineAlignmentCB; SwWrtShell * m_pWrtShell; SwShdwCrsrOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); - virtual ~SwShdwCrsrOptionsTabPage(); public: + virtual ~SwShdwCrsrOptionsTabPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); @@ -329,27 +333,26 @@ public: // redlining options class SwRedlineOptionsTabPage : public SfxTabPage { - ListBox* pInsertLB; - ColorListBox* pInsertColorLB; - SvxFontPrevWindow* pInsertedPreviewWN; + VclPtr<ListBox> pInsertLB; + VclPtr<ColorListBox> pInsertColorLB; + VclPtr<SvxFontPrevWindow> pInsertedPreviewWN; - ListBox* pDeletedLB; - ColorListBox* pDeletedColorLB; - SvxFontPrevWindow* pDeletedPreviewWN; + VclPtr<ListBox> pDeletedLB; + VclPtr<ColorListBox> pDeletedColorLB; + VclPtr<SvxFontPrevWindow> pDeletedPreviewWN; - ListBox* pChangedLB; - ColorListBox* pChangedColorLB; - SvxFontPrevWindow* pChangedPreviewWN; + VclPtr<ListBox> pChangedLB; + VclPtr<ColorListBox> pChangedColorLB; + VclPtr<SvxFontPrevWindow> pChangedPreviewWN; - ListBox* pMarkPosLB; - ColorListBox* pMarkColorLB; - SwMarkPreview* pMarkPreviewWN; + VclPtr<ListBox> pMarkPosLB; + VclPtr<ColorListBox> pMarkColorLB; + VclPtr<SwMarkPreview> pMarkPreviewWN; OUString sAuthor; OUString sNone; SwRedlineOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); - virtual ~SwRedlineOptionsTabPage(); DECL_LINK( AttribHdl, ListBox *pLB ); DECL_LINK(ChangedMaskPrevHdl, void * = 0); @@ -358,6 +361,8 @@ class SwRedlineOptionsTabPage : public SfxTabPage void InitFontStyle(SvxFontPrevWindow& rExampleWin); public: + virtual ~SwRedlineOptionsTabPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); @@ -374,6 +379,8 @@ class SwTestTabPage : public SfxTabPage public: SwTestTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); + virtual ~SwTestTabPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); @@ -382,16 +389,16 @@ public: virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE; private: - CheckBox* m_pTest1CBox; - CheckBox* m_pTest2CBox; - CheckBox* m_pTest3CBox; - CheckBox* m_pTest4CBox; - CheckBox* m_pTest5CBox; - CheckBox* m_pTest6CBox; - CheckBox* m_pTest7CBox; - CheckBox* m_pTest8CBox; - CheckBox* m_pTest9CBox; - CheckBox* m_pTest10CBox; + VclPtr<CheckBox> m_pTest1CBox; + VclPtr<CheckBox> m_pTest2CBox; + VclPtr<CheckBox> m_pTest3CBox; + VclPtr<CheckBox> m_pTest4CBox; + VclPtr<CheckBox> m_pTest5CBox; + VclPtr<CheckBox> m_pTest6CBox; + VclPtr<CheckBox> m_pTest7CBox; + VclPtr<CheckBox> m_pTest8CBox; + VclPtr<CheckBox> m_pTest9CBox; + VclPtr<CheckBox> m_pTest10CBox; bool bAttrModified; @@ -403,22 +410,23 @@ private: class SwCompareOptionsTabPage : public SfxTabPage { - RadioButton* m_pAutoRB; - RadioButton* m_pWordRB; - RadioButton* m_pCharRB; + VclPtr<RadioButton> m_pAutoRB; + VclPtr<RadioButton> m_pWordRB; + VclPtr<RadioButton> m_pCharRB; - CheckBox* m_pRsidCB; - CheckBox* m_pIgnoreCB; - NumericField* m_pLenNF; - CheckBox* m_pStoreRsidCB; + VclPtr<CheckBox> m_pRsidCB; + VclPtr<CheckBox> m_pIgnoreCB; + VclPtr<NumericField> m_pLenNF; + VclPtr<CheckBox> m_pStoreRsidCB; SwCompareOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); - virtual ~SwCompareOptionsTabPage(); DECL_LINK(ComparisonHdl, void *); DECL_LINK(IgnoreHdl, void *); public: + virtual ~SwCompareOptionsTabPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); diff --git a/sw/source/uibase/inc/outline.hxx b/sw/source/uibase/inc/outline.hxx index 45317fba3fc2..36e564e11241 100644 --- a/sw/source/uibase/inc/outline.hxx +++ b/sw/source/uibase/inc/outline.hxx @@ -83,17 +83,17 @@ public: class SwOutlineSettingsTabPage : public SfxTabPage { - ListBox* m_pLevelLB; - - ListBox* m_pCollBox; - SwNumberingTypeListBox* m_pNumberBox; - ListBox* m_pCharFmtLB; - FixedText* m_pAllLevelFT; - NumericField* m_pAllLevelNF; - Edit* m_pPrefixED; - Edit* m_pSuffixED; - NumericField* m_pStartEdit; - NumberingPreview* m_pPreviewWIN; + VclPtr<ListBox> m_pLevelLB; + + VclPtr<ListBox> m_pCollBox; + VclPtr<SwNumberingTypeListBox> m_pNumberBox; + VclPtr<ListBox> m_pCharFmtLB; + VclPtr<FixedText> m_pAllLevelFT; + VclPtr<NumericField> m_pAllLevelNF; + VclPtr<Edit> m_pPrefixED; + VclPtr<Edit> m_pSuffixED; + VclPtr<NumericField> m_pStartEdit; + VclPtr<NumberingPreview> m_pPreviewWIN; OUString aNoFmtName; OUString aSaveCollNames[MAXLEVEL]; @@ -122,6 +122,7 @@ class SwOutlineSettingsTabPage : public SfxTabPage public: SwOutlineSettingsTabPage(vcl::Window* pParent, const SfxItemSet& rSet); virtual ~SwOutlineSettingsTabPage(); + virtual void dispose() SAL_OVERRIDE; void SetWrtShell(SwWrtShell* pShell); diff --git a/sw/source/uibase/inc/pgfnote.hxx b/sw/source/uibase/inc/pgfnote.hxx index 6d37616473a2..90e850fbce10 100644 --- a/sw/source/uibase/inc/pgfnote.hxx +++ b/sw/source/uibase/inc/pgfnote.hxx @@ -39,21 +39,22 @@ public: virtual bool FillItemSet(SfxItemSet *rSet) SAL_OVERRIDE; virtual void Reset(const SfxItemSet *rSet) SAL_OVERRIDE; + virtual ~SwFootNotePage(); + virtual void dispose() SAL_OVERRIDE; private: SwFootNotePage(vcl::Window *pParent, const SfxItemSet &rSet); - virtual ~SwFootNotePage(); - RadioButton* m_pMaxHeightPageBtn; - RadioButton* m_pMaxHeightBtn; - MetricField* m_pMaxHeightEdit; - MetricField* m_pDistEdit; - - ListBox* m_pLinePosBox; - LineListBox* m_pLineTypeBox; - MetricField* m_pLineWidthEdit; - ColorListBox* m_pLineColorBox; - MetricField* m_pLineLengthEdit; - MetricField* m_pLineDistEdit; + VclPtr<RadioButton> m_pMaxHeightPageBtn; + VclPtr<RadioButton> m_pMaxHeightBtn; + VclPtr<MetricField> m_pMaxHeightEdit; + VclPtr<MetricField> m_pDistEdit; + + VclPtr<ListBox> m_pLinePosBox; + VclPtr<LineListBox> m_pLineTypeBox; + VclPtr<MetricField> m_pLineWidthEdit; + VclPtr<ColorListBox> m_pLineColorBox; + VclPtr<MetricField> m_pLineLengthEdit; + VclPtr<MetricField> m_pLineDistEdit; DECL_LINK(HeightPage, void *); DECL_LINK(HeightMetric, void *); diff --git a/sw/source/uibase/inc/pggrid.hxx b/sw/source/uibase/inc/pggrid.hxx index 92a5d333c55a..a70dccfc3315 100644 --- a/sw/source/uibase/inc/pggrid.hxx +++ b/sw/source/uibase/inc/pggrid.hxx @@ -28,36 +28,36 @@ // TabPage Format/(Styles/)Page/Text grid class SwTextGridPage: public SfxTabPage { - RadioButton* m_pNoGridRB; - RadioButton* m_pLinesGridRB; - RadioButton* m_pCharsGridRB; - CheckBox* m_pSnapToCharsCB; + VclPtr<RadioButton> m_pNoGridRB; + VclPtr<RadioButton> m_pLinesGridRB; + VclPtr<RadioButton> m_pCharsGridRB; + VclPtr<CheckBox> m_pSnapToCharsCB; - SwPageGridExample* m_pExampleWN; + VclPtr<SwPageGridExample> m_pExampleWN; - VclFrame* m_pLayoutFL; - NumericField* m_pLinesPerPageNF; - FixedText* m_pLinesRangeFT; + VclPtr<VclFrame> m_pLayoutFL; + VclPtr<NumericField> m_pLinesPerPageNF; + VclPtr<FixedText> m_pLinesRangeFT; - MetricField* m_pTextSizeMF; + VclPtr<MetricField> m_pTextSizeMF; - FixedText* m_pCharsPerLineFT; - NumericField* m_pCharsPerLineNF; - FixedText* m_pCharsRangeFT; + VclPtr<FixedText> m_pCharsPerLineFT; + VclPtr<NumericField> m_pCharsPerLineNF; + VclPtr<FixedText> m_pCharsRangeFT; - FixedText* m_pCharWidthFT; - MetricField* m_pCharWidthMF; + VclPtr<FixedText> m_pCharWidthFT; + VclPtr<MetricField> m_pCharWidthMF; - FixedText* m_pRubySizeFT; - MetricField* m_pRubySizeMF; + VclPtr<FixedText> m_pRubySizeFT; + VclPtr<MetricField> m_pRubySizeMF; - CheckBox* m_pRubyBelowCB; + VclPtr<CheckBox> m_pRubyBelowCB; - VclFrame* m_pDisplayFL; + VclPtr<VclFrame> m_pDisplayFL; - CheckBox* m_pDisplayCB; - CheckBox* m_pPrintCB; - ColorListBox* m_pColorLB; + VclPtr<CheckBox> m_pDisplayCB; + VclPtr<CheckBox> m_pPrintCB; + VclPtr<ColorListBox> m_pColorLB; sal_Int32 m_nRubyUserValue; bool m_bRubyUserValue; @@ -68,7 +68,6 @@ class SwTextGridPage: public SfxTabPage bool m_bVRulerChanged; SwTextGridPage(vcl::Window *pParent, const SfxItemSet &rSet); - virtual ~SwTextGridPage(); void UpdatePageSize(const SfxItemSet& rSet); void PutGridItem(SfxItemSet& rSet); @@ -84,6 +83,9 @@ class SwTextGridPage: public SfxTabPage using SfxTabPage::DeactivatePage; public: + virtual ~SwTextGridPage(); + virtual void dispose() SAL_OVERRIDE; + static SfxTabPage *Create(vcl::Window *pParent, const SfxItemSet *rSet); static const sal_uInt16* GetRanges(); diff --git a/sw/source/uibase/inc/prcntfld.hxx b/sw/source/uibase/inc/prcntfld.hxx index 6675290b20b0..314b0b624060 100644 --- a/sw/source/uibase/inc/prcntfld.hxx +++ b/sw/source/uibase/inc/prcntfld.hxx @@ -26,7 +26,7 @@ //Wraps a MetricField with extra features, preferred to PercentField class SW_DLLPUBLIC PercentField { - MetricField* m_pField; + VclPtr<MetricField> m_pField; sal_Int64 nRefValue; // 100% value for conversion (in Twips) sal_Int64 nOldMax; diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx index b33a4518b625..60668bfbeabc 100644 --- a/sw/source/uibase/inc/pview.hxx +++ b/sw/source/uibase/inc/pview.hxx @@ -150,7 +150,7 @@ class SW_DLLPUBLIC SwPagePreview: public SfxViewShell { // ViewWindow and handle to core // current dispatcher shell - SwPagePreviewWin* pViewWin; + VclPtr<SwPagePreviewWin> pViewWin; //viewdata of the previous SwView and the new crsrposition OUString sSwViewData; //and the new cursor position if the user double click in the PagePreview @@ -163,14 +163,14 @@ class SW_DLLPUBLIC SwPagePreview: public SfxViewShell Rectangle aVisArea; // MDI control elements - SwScrollbar *pHScrollbar; - SwScrollbar *pVScrollbar; + VclPtr<SwScrollbar> pHScrollbar; + VclPtr<SwScrollbar> pVScrollbar; bool mbHScrollbarEnabled; bool mbVScrollbarEnabled; - ImageButton *pPageUpBtn, - *pPageDownBtn; + VclPtr<ImageButton> pPageUpBtn, + pPageDownBtn; // dummy window for filling the lower right edge when both scrollbars are active - ::vcl::Window *pScrollFill; + VclPtr<::vcl::Window> pScrollFill; sal_uInt16 mnPageCount; bool bNormalPrint; diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx index 39cfa7f47567..69121137d3e5 100644 --- a/sw/source/uibase/inc/redlndlg.hxx +++ b/sw/source/uibase/inc/redlndlg.hxx @@ -67,7 +67,7 @@ typedef std::vector<SvLBoxEntryPtr> SvLBoxEntryArr; class SW_DLLPUBLIC SwRedlineAcceptDlg { - vcl::Window* pParentDlg; + VclPtr<vcl::Window> pParentDlg; SwRedlineDataParentArr aRedlineParents; SwRedlineDataChildArr aRedlineChildren; SwRedlineDataParentSortArr aUsedSeqNo; @@ -82,8 +82,8 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg OUString sFmtCollSet; OUString sFilterAction; OUString sAutoFormat; - SvxTPView* pTPView; - SvxRedlinTable* pTable; // PB 2006/02/02 #i48648 now SvHeaderTabListBox + VclPtr<SvxTPView> pTPView; + VclPtr<SvxRedlinTable> pTable; // PB 2006/02/02 #i48648 now SvHeaderTabListBox Link aOldSelectHdl; Link aOldDeselectHdl; bool bOnlyFormatedRedlines; diff --git a/sw/source/uibase/inc/regionsw.hxx b/sw/source/uibase/inc/regionsw.hxx index 21e444057659..5344404b3f22 100644 --- a/sw/source/uibase/inc/regionsw.hxx +++ b/sw/source/uibase/inc/regionsw.hxx @@ -61,41 +61,41 @@ typedef boost::ptr_set<SectRepr> SectReprArr; class SwEditRegionDlg : public SfxModalDialog { - Edit* m_pCurName; - SvTreeListBox* m_pTree; - - TriStateBox* m_pFileCB; - CheckBox* m_pDDECB; - VclContainer* m_pDDEFrame; - FixedText* m_pFileNameFT; - FixedText* m_pDDECommandFT; - Edit* m_pFileNameED; - PushButton* m_pFilePB; - FixedText* m_pSubRegionFT; - ComboBox* m_pSubRegionED; + VclPtr<Edit> m_pCurName; + VclPtr<SvTreeListBox> m_pTree; + + VclPtr<TriStateBox> m_pFileCB; + VclPtr<CheckBox> m_pDDECB; + VclPtr<VclContainer> m_pDDEFrame; + VclPtr<FixedText> m_pFileNameFT; + VclPtr<FixedText> m_pDDECommandFT; + VclPtr<Edit> m_pFileNameED; + VclPtr<PushButton> m_pFilePB; + VclPtr<FixedText> m_pSubRegionFT; + VclPtr<ComboBox> m_pSubRegionED; bool m_bSubRegionsFilled; - TriStateBox* m_pProtectCB; - CheckBox* m_pPasswdCB; - PushButton* m_pPasswdPB; + VclPtr<TriStateBox> m_pProtectCB; + VclPtr<CheckBox> m_pPasswdCB; + VclPtr<PushButton> m_pPasswdPB; - TriStateBox* m_pHideCB; - FixedText* m_pConditionFT; - ConditionEdit* m_pConditionED; + VclPtr<TriStateBox> m_pHideCB; + VclPtr<FixedText> m_pConditionFT; + VclPtr<ConditionEdit> m_pConditionED; // #114856# edit in readonly sections - TriStateBox* m_pEditInReadonlyCB; + VclPtr<TriStateBox> m_pEditInReadonlyCB; - OKButton* m_pOK; - PushButton* m_pOptionsPB; - PushButton* m_pDismiss; + VclPtr<OKButton> m_pOK; + VclPtr<PushButton> m_pOptionsPB; + VclPtr<PushButton> m_pDismiss; ImageList aImageIL; SwWrtShell& rSh; SectReprArr aSectReprArr; const SwSection* pCurrSect; sfx2::DocumentInserter* m_pDocInserter; - vcl::Window* m_pOldDefDlgParent; + VclPtr<vcl::Window> m_pOldDefDlgParent; bool bDontCheckPasswd :1; bool bWeb :1; @@ -140,27 +140,27 @@ public: // dialog "insert region" class SwInsertSectionTabPage : public SfxTabPage { - ComboBox* m_pCurName; + VclPtr<ComboBox> m_pCurName; - CheckBox* m_pFileCB; - CheckBox* m_pDDECB; - FixedText* m_pDDECommandFT; - FixedText* m_pFileNameFT; - Edit* m_pFileNameED; - PushButton* m_pFilePB; - FixedText* m_pSubRegionFT; - ComboBox* m_pSubRegionED; + VclPtr<CheckBox> m_pFileCB; + VclPtr<CheckBox> m_pDDECB; + VclPtr<FixedText> m_pDDECommandFT; + VclPtr<FixedText> m_pFileNameFT; + VclPtr<Edit> m_pFileNameED; + VclPtr<PushButton> m_pFilePB; + VclPtr<FixedText> m_pSubRegionFT; + VclPtr<ComboBox> m_pSubRegionED; - CheckBox* m_pProtectCB; - CheckBox* m_pPasswdCB; - PushButton* m_pPasswdPB; + VclPtr<CheckBox> m_pProtectCB; + VclPtr<CheckBox> m_pPasswdCB; + VclPtr<PushButton> m_pPasswdPB; - CheckBox* m_pHideCB; - FixedText* m_pConditionFT; - ConditionEdit* m_pConditionED; + VclPtr<CheckBox> m_pHideCB; + VclPtr<FixedText> m_pConditionFT; + VclPtr<ConditionEdit> m_pConditionED; // #114856# edit in readonly sections - CheckBox* m_pEditInReadonlyCB; + VclPtr<CheckBox> m_pEditInReadonlyCB; OUString m_sFileName; OUString m_sFilterName; @@ -169,7 +169,7 @@ class SwInsertSectionTabPage : public SfxTabPage ::com::sun::star::uno::Sequence <sal_Int8 > m_aNewPasswd; SwWrtShell* m_pWrtSh; sfx2::DocumentInserter* m_pDocInserter; - vcl::Window* m_pOldDefDlgParent; + VclPtr<vcl::Window> m_pOldDefDlgParent; DECL_LINK( ChangeHideHdl, CheckBox * ); // #114856# edit in readonly sections @@ -198,31 +198,31 @@ public: class SwSectionFtnEndTabPage : public SfxTabPage { - CheckBox* pFtnNtAtTextEndCB; + VclPtr<CheckBox> pFtnNtAtTextEndCB; - CheckBox* pFtnNtNumCB; - FixedText* pFtnOffsetLbl; - NumericField* pFtnOffsetFld; + VclPtr<CheckBox> pFtnNtNumCB; + VclPtr<FixedText> pFtnOffsetLbl; + VclPtr<NumericField> pFtnOffsetFld; - CheckBox* pFtnNtNumFmtCB; - FixedText* pFtnPrefixFT; - Edit* pFtnPrefixED; - SwNumberingTypeListBox* pFtnNumViewBox; - FixedText* pFtnSuffixFT; - Edit* pFtnSuffixED; + VclPtr<CheckBox> pFtnNtNumFmtCB; + VclPtr<FixedText> pFtnPrefixFT; + VclPtr<Edit> pFtnPrefixED; + VclPtr<SwNumberingTypeListBox> pFtnNumViewBox; + VclPtr<FixedText> pFtnSuffixFT; + VclPtr<Edit> pFtnSuffixED; - CheckBox* pEndNtAtTextEndCB; + VclPtr<CheckBox> pEndNtAtTextEndCB; - CheckBox* pEndNtNumCB; - FixedText* pEndOffsetLbl; - NumericField* pEndOffsetFld; + VclPtr<CheckBox> pEndNtNumCB; + VclPtr<FixedText> pEndOffsetLbl; + VclPtr<NumericField> pEndOffsetFld; - CheckBox* pEndNtNumFmtCB; - FixedText* pEndPrefixFT; - Edit* pEndPrefixED; - SwNumberingTypeListBox* pEndNumViewBox; - FixedText* pEndSuffixFT; - Edit* pEndSuffixED; + VclPtr<CheckBox> pEndNtNumFmtCB; + VclPtr<FixedText> pEndPrefixFT; + VclPtr<Edit> pEndPrefixED; + VclPtr<SwNumberingTypeListBox> pEndNumViewBox; + VclPtr<FixedText> pEndSuffixFT; + VclPtr<Edit> pEndSuffixED; DECL_LINK( FootEndHdl, CheckBox * ); void ResetState( bool bFtn, const SwFmtFtnEndAtTxtEnd& ); @@ -230,6 +230,7 @@ class SwSectionFtnEndTabPage : public SfxTabPage public: SwSectionFtnEndTabPage( vcl::Window *pParent, const SfxItemSet &rAttrSet ); virtual ~SwSectionFtnEndTabPage(); + virtual void dispose() SAL_OVERRIDE; virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE; virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE; @@ -240,14 +241,15 @@ public: class SwSectionIndentTabPage : public SfxTabPage { - MetricField* m_pBeforeMF; - MetricField* m_pAfterMF; - SvxParaPrevWindow* m_pPreviewWin; + VclPtr<MetricField> m_pBeforeMF; + VclPtr<MetricField> m_pAfterMF; + VclPtr<SvxParaPrevWindow> m_pPreviewWin; DECL_LINK(IndentModifyHdl, void *); public: SwSectionIndentTabPage( vcl::Window *pParent, const SfxItemSet &rAttrSet ); virtual ~SwSectionIndentTabPage(); + virtual void dispose() SAL_OVERRIDE; virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE; virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE; diff --git a/sw/source/uibase/inc/rowht.hxx b/sw/source/uibase/inc/rowht.hxx index 25d9e7c918f3..9727c8d9d555 100644 --- a/sw/source/uibase/inc/rowht.hxx +++ b/sw/source/uibase/inc/rowht.hxx @@ -28,8 +28,8 @@ class SwWrtShell; class SwTableHeightDlg : public SvxStandardDialog { - MetricField* m_pHeightEdit; - CheckBox* m_pAutoHeightCB; + VclPtr<MetricField> m_pHeightEdit; + VclPtr<CheckBox> m_pAutoHeightCB; SwWrtShell &rSh; protected: @@ -37,6 +37,8 @@ protected: public: SwTableHeightDlg( vcl::Window *pParent, SwWrtShell &rS ); + virtual ~SwTableHeightDlg(); + virtual void dispose() SAL_OVERRIDE; }; #endif diff --git a/sw/source/uibase/inc/selglos.hxx b/sw/source/uibase/inc/selglos.hxx index 501af9a28200..e67f3788a2f2 100644 --- a/sw/source/uibase/inc/selglos.hxx +++ b/sw/source/uibase/inc/selglos.hxx @@ -29,11 +29,14 @@ class SwSelGlossaryDlg : public ModalDialog { protected: - ListBox* m_pGlosBox; + VclPtr<ListBox> m_pGlosBox; DECL_LINK(DoubleClickHdl, ListBox*); public: SwSelGlossaryDlg(vcl::Window * pParent, const OUString &rShortName); + virtual ~SwSelGlossaryDlg(); + virtual void dispose() SAL_OVERRIDE; + void InsertGlos(const OUString &rRegion, const OUString &rGlosName) { const OUString aTmp = rRegion + ":" + rGlosName; diff --git a/sw/source/uibase/inc/shdwcrsr.hxx b/sw/source/uibase/inc/shdwcrsr.hxx index 631fde3d7f5b..dcb38480dd16 100644 --- a/sw/source/uibase/inc/shdwcrsr.hxx +++ b/sw/source/uibase/inc/shdwcrsr.hxx @@ -27,7 +27,7 @@ namespace vcl { class Window; } class SwShadowCursor { - vcl::Window* pWin; + VclPtr<vcl::Window> pWin; Color aCol; Point aOldPt; long nOldHeight; diff --git a/sw/source/uibase/inc/splittbl.hxx b/sw/source/uibase/inc/splittbl.hxx index 3bcce8bb03bc..cc6a96d2c5f7 100644 --- a/sw/source/uibase/inc/splittbl.hxx +++ b/sw/source/uibase/inc/splittbl.hxx @@ -27,10 +27,10 @@ class SwWrtShell; class SwSplitTblDlg : public SvxStandardDialog { - RadioButton* mpCntntCopyRB; - RadioButton* mpBoxAttrCopyWithParaRB ; - RadioButton* mpBoxAttrCopyNoParaRB ; - RadioButton* mpBorderCopyRB; + VclPtr<RadioButton> mpCntntCopyRB; + VclPtr<RadioButton> mpBoxAttrCopyWithParaRB ; + VclPtr<RadioButton> mpBoxAttrCopyNoParaRB ; + VclPtr<RadioButton> mpBorderCopyRB; SwWrtShell &rShell; sal_uInt16 m_nSplit; @@ -40,6 +40,8 @@ protected: public: SwSplitTblDlg( vcl::Window *pParent, SwWrtShell &rSh ); + virtual ~SwSplitTblDlg(); + virtual void dispose() SAL_OVERRIDE; sal_uInt16 GetSplitMode() const { return m_nSplit; } }; diff --git a/sw/source/uibase/inc/srcedtw.hxx b/sw/source/uibase/inc/srcedtw.hxx index 0ead065a48d2..8e1a411c645a 100644 --- a/sw/source/uibase/inc/srcedtw.hxx +++ b/sw/source/uibase/inc/srcedtw.hxx @@ -69,9 +69,9 @@ private: ExtTextView* pTextView; ExtTextEngine* pTextEngine; - TextViewOutWin* pOutWin; - ScrollBar *pHScrollbar, - *pVScrollbar; + VclPtr<TextViewOutWin> pOutWin; + VclPtr<ScrollBar> pHScrollbar, + pVScrollbar; SwSrcView* pSrcView; diff --git a/sw/source/uibase/inc/srtdlg.hxx b/sw/source/uibase/inc/srtdlg.hxx index 592e1007b2b1..7facf548a45d 100644 --- a/sw/source/uibase/inc/srtdlg.hxx +++ b/sw/source/uibase/inc/srtdlg.hxx @@ -31,38 +31,38 @@ class CollatorResource; class SwSortDlg : public SvxStandardDialog { - FixedText* m_pColLbl; - FixedText* m_pTypLbl; - - CheckBox* m_pKeyCB1; - NumericField* m_pColEdt1; - ListBox* m_pTypDLB1; - RadioButton* m_pSortUp1RB; - RadioButton* m_pSortDn1RB; - - CheckBox* m_pKeyCB2; - NumericField* m_pColEdt2; - ListBox* m_pTypDLB2; - RadioButton* m_pSortUp2RB; - RadioButton* m_pSortDn2RB; - - CheckBox* m_pKeyCB3; - NumericField* m_pColEdt3; - ListBox* m_pTypDLB3; - RadioButton* m_pSortUp3RB; - RadioButton* m_pSortDn3RB; - - RadioButton* m_pColumnRB; - RadioButton* m_pRowRB; - - RadioButton* m_pDelimTabRB; - RadioButton* m_pDelimFreeRB; - Edit* m_pDelimEdt; - PushButton* m_pDelimPB; - - SvxLanguageBox* m_pLangLB; - - CheckBox* m_pCaseCB; + VclPtr<FixedText> m_pColLbl; + VclPtr<FixedText> m_pTypLbl; + + VclPtr<CheckBox> m_pKeyCB1; + VclPtr<NumericField> m_pColEdt1; + VclPtr<ListBox> m_pTypDLB1; + VclPtr<RadioButton> m_pSortUp1RB; + VclPtr<RadioButton> m_pSortDn1RB; + + VclPtr<CheckBox> m_pKeyCB2; + VclPtr<NumericField> m_pColEdt2; + VclPtr<ListBox> m_pTypDLB2; + VclPtr<RadioButton> m_pSortUp2RB; + VclPtr<RadioButton> m_pSortDn2RB; + + VclPtr<CheckBox> m_pKeyCB3; + VclPtr<NumericField> m_pColEdt3; + VclPtr<ListBox> m_pTypDLB3; + VclPtr<RadioButton> m_pSortUp3RB; + VclPtr<RadioButton> m_pSortDn3RB; + + VclPtr<RadioButton> m_pColumnRB; + VclPtr<RadioButton> m_pRowRB; + + VclPtr<RadioButton> m_pDelimTabRB; + VclPtr<RadioButton> m_pDelimFreeRB; + VclPtr<Edit> m_pDelimEdt; + VclPtr<PushButton> m_pDelimPB; + + VclPtr<SvxLanguageBox> m_pLangLB; + + VclPtr<CheckBox> m_pCaseCB; OUString aColTxt; OUString aRowTxt; diff --git a/sw/source/uibase/inc/swmessdialog.hxx b/sw/source/uibase/inc/swmessdialog.hxx index da9c8afe32fd..c8028265e616 100644 --- a/sw/source/uibase/inc/swmessdialog.hxx +++ b/sw/source/uibase/inc/swmessdialog.hxx @@ -20,14 +20,16 @@ class VclMultiLineEdit; class SwMessageAndEditDialog : public ModalDialog { protected: - OKButton* m_pOKPB; - FixedImage* m_pImageIM; - VclMultiLineEdit* m_pPrimaryMessage; - VclMultiLineEdit* m_pSecondaryMessage; - Edit* m_pEdit; + VclPtr<OKButton> m_pOKPB; + VclPtr<FixedImage> m_pImageIM; + VclPtr<VclMultiLineEdit> m_pPrimaryMessage; + VclPtr<VclMultiLineEdit> m_pSecondaryMessage; + VclPtr<Edit> m_pEdit; public: SwMessageAndEditDialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription); + virtual ~SwMessageAndEditDialog(); + virtual void dispose() SAL_OVERRIDE; }; #endif // INCLUDED_SW_SOURCE_UIBASE_INC_SWMESSDIALOG_HXX diff --git a/sw/source/uibase/inc/swrenamexnameddlg.hxx b/sw/source/uibase/inc/swrenamexnameddlg.hxx index aefb1efe0e91..84967e6fd9df 100644 --- a/sw/source/uibase/inc/swrenamexnameddlg.hxx +++ b/sw/source/uibase/inc/swrenamexnameddlg.hxx @@ -32,9 +32,9 @@ class SwRenameXNamedDlg : public ModalDialog { - Edit* m_pNewNameED; + VclPtr<Edit> m_pNewNameED; TextFilter m_aTextFilter; - OKButton* m_pOk; + VclPtr<OKButton> m_pOk; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess; @@ -48,6 +48,8 @@ public: SwRenameXNamedDlg( vcl::Window* pParent, ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed, ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess ); + virtual ~SwRenameXNamedDlg(); + virtual void dispose() SAL_OVERRIDE; void SetForbiddenChars(const OUString& rSet) { diff --git a/sw/source/uibase/inc/swruler.hxx b/sw/source/uibase/inc/swruler.hxx index 19b877f8253f..6d2469015bdd 100644 --- a/sw/source/uibase/inc/swruler.hxx +++ b/sw/source/uibase/inc/swruler.hxx @@ -34,6 +34,7 @@ public: SfxBindings& rBindings, WinBits nWinStyle); virtual ~SwCommentRuler (); + virtual void dispose() SAL_OVERRIDE; /** * Paint the ruler. @@ -43,7 +44,7 @@ public: protected: SwViewShell * mpViewShell; //< Shell to check if there is any comments on doc and their visibility - SwEditWin * mpSwWin; //< Used to get SwView to change the SideBar visibility + VclPtr<SwEditWin> mpSwWin; //< Used to get SwView to change the SideBar visibility bool mbIsHighlighted; //< If comment control is highlighted (mouse is over it) Timer maFadeTimer; //< Timer for high/'low'light fading int mnFadeRate; //< From 0 to 100. 0 means not highlighted. diff --git a/sw/source/uibase/inc/swuiccoll.hxx b/sw/source/uibase/inc/swuiccoll.hxx index a36b10853ba0..f9b4a2e50d57 100644 --- a/sw/source/uibase/inc/swuiccoll.hxx +++ b/sw/source/uibase/inc/swuiccoll.hxx @@ -26,18 +26,18 @@ class SwFmt; class SwCondCollPage : public SfxTabPage { - CheckBox* m_pConditionCB; + VclPtr<CheckBox> m_pConditionCB; - FixedText* m_pContextFT; - FixedText* m_pUsedFT; - SvTabListBox* m_pTbLinks; + VclPtr<FixedText> m_pContextFT; + VclPtr<FixedText> m_pUsedFT; + VclPtr<SvTabListBox> m_pTbLinks; - FixedText* m_pStyleFT; - ListBox* m_pStyleLB; - ListBox* m_pFilterLB; + VclPtr<FixedText> m_pStyleFT; + VclPtr<ListBox> m_pStyleLB; + VclPtr<ListBox> m_pFilterLB; - PushButton* m_pRemovePB; - PushButton* m_pAssignPB; + VclPtr<PushButton> m_pRemovePB; + VclPtr<PushButton> m_pAssignPB; std::vector<OUString> m_aStrArr; diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx index 47cfee668785..27e0430578f3 100644 --- a/sw/source/uibase/inc/swuicnttab.hxx +++ b/sw/source/uibase/inc/swuicnttab.hxx @@ -61,8 +61,8 @@ struct SwIndexSections_Impl; class SwMultiTOXTabDialog : public SfxTabDialog { - vcl::Window* m_pExampleContainerWIN; - CheckBox* m_pShowExampleCB; + VclPtr<vcl::Window> m_pExampleContainerWIN; + VclPtr<CheckBox> m_pShowExampleCB; SwTOXMgr* pMgr; SwWrtShell& rSh; @@ -131,65 +131,65 @@ class IndexEntrySupplierWrapper; class SwTOXSelectTabPage : public SfxTabPage { - Edit* m_pTitleED; - FixedText* m_pTypeFT; - ListBox* m_pTypeLB; - CheckBox* m_pReadOnlyCB; + VclPtr<Edit> m_pTitleED; + VclPtr<FixedText> m_pTypeFT; + VclPtr<ListBox> m_pTypeLB; + VclPtr<CheckBox> m_pReadOnlyCB; - VclContainer* m_pAreaFrame; - ListBox* m_pAreaLB; - FixedText* m_pLevelFT; //content, user - NumericField* m_pLevelNF; //content, user + VclPtr<VclContainer> m_pAreaFrame; + VclPtr<ListBox> m_pAreaLB; + VclPtr<FixedText> m_pLevelFT; //content, user + VclPtr<NumericField> m_pLevelNF; //content, user //content - VclContainer* m_pCreateFrame; // content, user, illustration - CheckBox* m_pFromHeadingsCB; - CheckBox* m_pAddStylesCB; - PushButton* m_pAddStylesPB; + VclPtr<VclContainer> m_pCreateFrame; // content, user, illustration + VclPtr<CheckBox> m_pFromHeadingsCB; + VclPtr<CheckBox> m_pAddStylesCB; + VclPtr<PushButton> m_pAddStylesPB; //user - CheckBox* m_pFromTablesCB; - CheckBox* m_pFromFramesCB; - CheckBox* m_pFromGraphicsCB; - CheckBox* m_pFromOLECB; - CheckBox* m_pLevelFromChapterCB; + VclPtr<CheckBox> m_pFromTablesCB; + VclPtr<CheckBox> m_pFromFramesCB; + VclPtr<CheckBox> m_pFromGraphicsCB; + VclPtr<CheckBox> m_pFromOLECB; + VclPtr<CheckBox> m_pLevelFromChapterCB; //illustration + table - RadioButton* m_pFromCaptionsRB; - RadioButton* m_pFromObjectNamesRB; + VclPtr<RadioButton> m_pFromCaptionsRB; + VclPtr<RadioButton> m_pFromObjectNamesRB; //illustration and tables - FixedText* m_pCaptionSequenceFT; - ListBox* m_pCaptionSequenceLB; - FixedText* m_pDisplayTypeFT; - ListBox* m_pDisplayTypeLB; + VclPtr<FixedText> m_pCaptionSequenceFT; + VclPtr<ListBox> m_pCaptionSequenceLB; + VclPtr<FixedText> m_pDisplayTypeFT; + VclPtr<ListBox> m_pDisplayTypeLB; //all but illustration and table - CheckBox* m_pTOXMarksCB; + VclPtr<CheckBox> m_pTOXMarksCB; //index only - VclContainer* m_pIdxOptionsFrame; - CheckBox* m_pCollectSameCB; - CheckBox* m_pUseFFCB; - CheckBox* m_pUseDashCB; - CheckBox* m_pCaseSensitiveCB; - CheckBox* m_pInitialCapsCB; - CheckBox* m_pKeyAsEntryCB; - CheckBox* m_pFromFileCB; - MenuButton* m_pAutoMarkPB; + VclPtr<VclContainer> m_pIdxOptionsFrame; + VclPtr<CheckBox> m_pCollectSameCB; + VclPtr<CheckBox> m_pUseFFCB; + VclPtr<CheckBox> m_pUseDashCB; + VclPtr<CheckBox> m_pCaseSensitiveCB; + VclPtr<CheckBox> m_pInitialCapsCB; + VclPtr<CheckBox> m_pKeyAsEntryCB; + VclPtr<CheckBox> m_pFromFileCB; + VclPtr<MenuButton> m_pAutoMarkPB; // object only SwOLENames aFromNames; - SvxCheckListBox* m_pFromObjCLB; - VclContainer* m_pFromObjFrame; + VclPtr<SvxCheckListBox> m_pFromObjCLB; + VclPtr<VclContainer> m_pFromObjFrame; - CheckBox* m_pSequenceCB; - ListBox* m_pBracketLB; - VclContainer* m_pAuthorityFrame; + VclPtr<CheckBox> m_pSequenceCB; + VclPtr<ListBox> m_pBracketLB; + VclPtr<VclContainer> m_pAuthorityFrame; //all - VclContainer* m_pSortFrame; - SvxLanguageBox* m_pLanguageLB; - ListBox* m_pSortAlgorithmLB; + VclPtr<VclContainer> m_pSortFrame; + VclPtr<SvxLanguageBox> m_pLanguageLB; + VclPtr<ListBox> m_pSortAlgorithmLB; IndexEntryResource* pIndexRes; @@ -243,15 +243,15 @@ class SwTOXEntryTabPage; class SwTokenWindow : public VclHBox, public VclBuilderContainer { - typedef std::vector<Control*>::iterator ctrl_iterator; - typedef std::vector<Control*>::const_iterator ctrl_const_iterator; - typedef std::vector<Control*>::reverse_iterator ctrl_reverse_iterator; - typedef std::vector<Control*>::const_reverse_iterator ctrl_const_reverse_iterator; - - Button* m_pLeftScrollWin; - vcl::Window* m_pCtrlParentWin; - Button* m_pRightScrollWin; - std::vector<Control*> aControlList; + typedef std::vector<VclPtr<Control> >::iterator ctrl_iterator; + typedef std::vector<VclPtr<Control> >::const_iterator ctrl_const_iterator; + typedef std::vector<VclPtr<Control> >::reverse_iterator ctrl_reverse_iterator; + typedef std::vector<VclPtr<Control> >::const_reverse_iterator ctrl_const_reverse_iterator; + + VclPtr<Button> m_pLeftScrollWin; + VclPtr<vcl::Window> m_pCtrlParentWin; + VclPtr<Button> m_pRightScrollWin; + std::vector<VclPtr<Control> > aControlList; SwForm* pForm; sal_uInt16 nLevel; bool bValid; @@ -259,14 +259,14 @@ class SwTokenWindow : public VclHBox, public VclBuilderContainer OUString aButtonHelpTexts[TOKEN_END]; // QuickHelpText of the buttons OUString sCharStyle; Link aButtonSelectedHdl; - Control* pActiveCtrl; + VclPtr<Control> pActiveCtrl; Link aModifyHdl; OUString accessibleName; OUString sAdditionalAccnameString1; OUString sAdditionalAccnameString2; OUString sAdditionalAccnameString3; - SwTOXEntryTabPage* m_pParent; + VclPtr<SwTOXEntryTabPage> m_pParent; DECL_LINK(EditResize, Edit*); DECL_LINK(NextItemHdl, SwTOXEdit* ); @@ -328,76 +328,79 @@ class SwTOXEntryTabPage; class SwIdxTreeListBox : public SvTreeListBox { - SwTOXEntryTabPage* pParent; + VclPtr<SwTOXEntryTabPage> pParent; virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE; public: SwIdxTreeListBox(vcl::Window* pPar, WinBits nStyle); + virtual ~SwIdxTreeListBox(); + virtual void dispose() SAL_OVERRIDE; + void SetTabPage(SwTOXEntryTabPage* pPar) { pParent = pPar; } }; class SwTOXEntryTabPage : public SfxTabPage { - FixedText* m_pLevelFT; - SwIdxTreeListBox* m_pLevelLB; + VclPtr<FixedText> m_pLevelFT; + VclPtr<SwIdxTreeListBox> m_pLevelLB; - SwTokenWindow* m_pTokenWIN; + VclPtr<SwTokenWindow> m_pTokenWIN; - PushButton* m_pAllLevelsPB; + VclPtr<PushButton> m_pAllLevelsPB; - PushButton* m_pEntryNoPB; - PushButton* m_pEntryPB; - PushButton* m_pTabPB; - PushButton* m_pChapterInfoPB; - PushButton* m_pPageNoPB; - PushButton* m_pHyperLinkPB; + VclPtr<PushButton> m_pEntryNoPB; + VclPtr<PushButton> m_pEntryPB; + VclPtr<PushButton> m_pTabPB; + VclPtr<PushButton> m_pChapterInfoPB; + VclPtr<PushButton> m_pPageNoPB; + VclPtr<PushButton> m_pHyperLinkPB; - ListBox* m_pAuthFieldsLB; - PushButton* m_pAuthInsertPB; - PushButton* m_pAuthRemovePB; + VclPtr<ListBox> m_pAuthFieldsLB; + VclPtr<PushButton> m_pAuthInsertPB; + VclPtr<PushButton> m_pAuthRemovePB; - ListBox* m_pCharStyleLB; // character style of the current token - PushButton* m_pEditStylePB; + VclPtr<ListBox> m_pCharStyleLB; // character style of the current token + VclPtr<PushButton> m_pEditStylePB; - FixedText* m_pChapterEntryFT; - ListBox* m_pChapterEntryLB; // type of chapter info + VclPtr<FixedText> m_pChapterEntryFT; + VclPtr<ListBox> m_pChapterEntryLB; // type of chapter info - FixedText* m_pNumberFormatFT; - ListBox* m_pNumberFormatLB; //!< format for numbering (E#) + VclPtr<FixedText> m_pNumberFormatFT; + VclPtr<ListBox> m_pNumberFormatLB; //!< format for numbering (E#) - FixedText* m_pEntryOutlineLevelFT; //!< Fixed text, for i53420 - NumericField* m_pEntryOutlineLevelNF; //!< level to evaluate outline level to, for i53420 + VclPtr<FixedText> m_pEntryOutlineLevelFT; //!< Fixed text, for i53420 + VclPtr<NumericField> m_pEntryOutlineLevelNF; //!< level to evaluate outline level to, for i53420 - FixedText* m_pFillCharFT; - ComboBox* m_pFillCharCB; // fill char for tab stop + VclPtr<FixedText> m_pFillCharFT; + VclPtr<ComboBox> m_pFillCharCB; // fill char for tab stop - FixedText* m_pTabPosFT; - MetricField* m_pTabPosMF; // tab stop position - CheckBox* m_pAutoRightCB; + VclPtr<FixedText> m_pTabPosFT; + VclPtr<MetricField> m_pTabPosMF; // tab stop position + VclPtr<CheckBox> m_pAutoRightCB; - VclContainer* m_pFormatFrame; - FixedText* m_pMainEntryStyleFT; - ListBox* m_pMainEntryStyleLB; // character style of main entries in indexes - CheckBox* m_pAlphaDelimCB; - CheckBox* m_pCommaSeparatedCB; - CheckBox* m_pRelToStyleCB; // position relative to the right margin of the para style + VclPtr<VclContainer> m_pFormatFrame; + VclPtr<FixedText> m_pMainEntryStyleFT; + VclPtr<ListBox> m_pMainEntryStyleLB; // character style of main entries in indexes + VclPtr<CheckBox> m_pAlphaDelimCB; + VclPtr<CheckBox> m_pCommaSeparatedCB; + VclPtr<CheckBox> m_pRelToStyleCB; // position relative to the right margin of the para style - VclContainer* m_pSortingFrame; - RadioButton* m_pSortDocPosRB; - RadioButton* m_pSortContentRB; + VclPtr<VclContainer> m_pSortingFrame; + VclPtr<RadioButton> m_pSortDocPosRB; + VclPtr<RadioButton> m_pSortContentRB; - VclContainer* m_pSortKeyFrame; - ListBox* m_pFirstKeyLB; - RadioButton* m_pFirstSortUpRB; - RadioButton* m_pFirstSortDownRB; + VclPtr<VclContainer> m_pSortKeyFrame; + VclPtr<ListBox> m_pFirstKeyLB; + VclPtr<RadioButton> m_pFirstSortUpRB; + VclPtr<RadioButton> m_pFirstSortDownRB; - ListBox* m_pSecondKeyLB; - RadioButton* m_pSecondSortUpRB; - RadioButton* m_pSecondSortDownRB; + VclPtr<ListBox> m_pSecondKeyLB; + VclPtr<RadioButton> m_pSecondSortUpRB; + VclPtr<RadioButton> m_pSecondSortDownRB; - ListBox* m_pThirdKeyLB; - RadioButton* m_pThirdSortUpRB; - RadioButton* m_pThirdSortDownRB; + VclPtr<ListBox> m_pThirdKeyLB; + VclPtr<RadioButton> m_pThirdSortUpRB; + VclPtr<RadioButton> m_pThirdSortDownRB; OUString sDelimStr; OUString sLevelStr; @@ -437,6 +440,7 @@ class SwTOXEntryTabPage : public SfxTabPage public: SwTOXEntryTabPage(vcl::Window* pParent, const SfxItemSet& rAttrSet); virtual ~SwTOXEntryTabPage(); + virtual void dispose() SAL_OVERRIDE; virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE; virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE; @@ -456,11 +460,11 @@ public: class SwTOXStylesTabPage : public SfxTabPage { - ListBox* m_pLevelLB; - PushButton* m_pAssignBT; - ListBox* m_pParaLayLB; - PushButton* m_pStdBT; - PushButton* m_pEditStyleBT; + VclPtr<ListBox> m_pLevelLB; + VclPtr<PushButton> m_pAssignBT; + VclPtr<ListBox> m_pParaLayLB; + VclPtr<PushButton> m_pStdBT; + VclPtr<PushButton> m_pEditStyleBT; SwForm* m_pCurrentForm; diff --git a/sw/source/uibase/inc/swuiidxmrk.hxx b/sw/source/uibase/inc/swuiidxmrk.hxx index 0f559a63eb85..040c97d7628a 100644 --- a/sw/source/uibase/inc/swuiidxmrk.hxx +++ b/sw/source/uibase/inc/swuiidxmrk.hxx @@ -51,40 +51,40 @@ class SwIndexMarkPane friend class SwIndexMarkFloatDlg; friend class SwIndexMarkModalDlg; - VclFrame* m_pFrame; - FixedText* m_pTypeFT; - ListBox* m_pTypeDCB; - PushButton* m_pNewBT; - - Edit* m_pEntryED; - FixedText* m_pPhoneticFT0; - Edit* m_pPhoneticED0; - - FixedText* m_pKey1FT; - ComboBox* m_pKey1DCB; - FixedText* m_pPhoneticFT1; - Edit* m_pPhoneticED1; - - FixedText* m_pKey2FT; - ComboBox* m_pKey2DCB; - FixedText* m_pPhoneticFT2; - Edit* m_pPhoneticED2; - - FixedText* m_pLevelFT; - NumericField* m_pLevelNF; - CheckBox* m_pMainEntryCB; - CheckBox* m_pApplyToAllCB; - CheckBox* m_pSearchCaseSensitiveCB; - CheckBox* m_pSearchCaseWordOnlyCB; - - PushButton* m_pOKBT; - CloseButton* m_pCloseBT; - PushButton* m_pDelBT; - - PushButton* m_pPrevSameBT; - PushButton* m_pNextSameBT; - PushButton* m_pPrevBT; - PushButton* m_pNextBT; + VclPtr<VclFrame> m_pFrame; + VclPtr<FixedText> m_pTypeFT; + VclPtr<ListBox> m_pTypeDCB; + VclPtr<PushButton> m_pNewBT; + + VclPtr<Edit> m_pEntryED; + VclPtr<FixedText> m_pPhoneticFT0; + VclPtr<Edit> m_pPhoneticED0; + + VclPtr<FixedText> m_pKey1FT; + VclPtr<ComboBox> m_pKey1DCB; + VclPtr<FixedText> m_pPhoneticFT1; + VclPtr<Edit> m_pPhoneticED1; + + VclPtr<FixedText> m_pKey2FT; + VclPtr<ComboBox> m_pKey2DCB; + VclPtr<FixedText> m_pPhoneticFT2; + VclPtr<Edit> m_pPhoneticED2; + + VclPtr<FixedText> m_pLevelFT; + VclPtr<NumericField> m_pLevelNF; + VclPtr<CheckBox> m_pMainEntryCB; + VclPtr<CheckBox> m_pApplyToAllCB; + VclPtr<CheckBox> m_pSearchCaseSensitiveCB; + VclPtr<CheckBox> m_pSearchCaseWordOnlyCB; + + VclPtr<PushButton> m_pOKBT; + VclPtr<CloseButton> m_pCloseBT; + VclPtr<PushButton> m_pDelBT; + + VclPtr<PushButton> m_pPrevSameBT; + VclPtr<PushButton> m_pNextSameBT; + VclPtr<PushButton> m_pPrevBT; + VclPtr<PushButton> m_pNextBT; OUString aOrgStr; bool bDel; @@ -182,17 +182,17 @@ class SwAuthorMarkPane friend class SwAuthMarkModalDlg; friend class SwAuthMarkFloatDlg; - RadioButton* m_pFromComponentRB; - RadioButton* m_pFromDocContentRB; - FixedText* m_pAuthorFI; - FixedText* m_pTitleFI; - Edit* m_pEntryED; - ListBox* m_pEntryLB; - - PushButton* m_pActionBT; - CloseButton* m_pCloseBT; - PushButton* m_pCreateEntryPB; - PushButton* m_pEditEntryPB; + VclPtr<RadioButton> m_pFromComponentRB; + VclPtr<RadioButton> m_pFromDocContentRB; + VclPtr<FixedText> m_pAuthorFI; + VclPtr<FixedText> m_pTitleFI; + VclPtr<Edit> m_pEntryED; + VclPtr<ListBox> m_pEntryLB; + + VclPtr<PushButton> m_pActionBT; + VclPtr<CloseButton> m_pCloseBT; + VclPtr<PushButton> m_pCreateEntryPB; + VclPtr<PushButton> m_pEditEntryPB; bool bNewEntry; bool bBibAccessInitialized; diff --git a/sw/source/uibase/inc/syncbtn.hxx b/sw/source/uibase/inc/syncbtn.hxx index 76f8be74749a..83a16070a5d7 100644 --- a/sw/source/uibase/inc/syncbtn.hxx +++ b/sw/source/uibase/inc/syncbtn.hxx @@ -25,12 +25,14 @@ class SwSyncBtnDlg : public SfxFloatingWindow { - PushButton* m_pSyncBtn; + VclPtr<PushButton> m_pSyncBtn; DECL_LINK( BtnHdl, void* ); public: SwSyncBtnDlg(SfxBindings*, SfxChildWindow*, vcl::Window *pParent); + virtual ~SwSyncBtnDlg(); + virtual void dispose() SAL_OVERRIDE; }; class SwSyncChildWin : public SfxChildWindow diff --git a/sw/source/uibase/inc/tautofmt.hxx b/sw/source/uibase/inc/tautofmt.hxx index 019de4103b9c..fac2b1224840 100644 --- a/sw/source/uibase/inc/tautofmt.hxx +++ b/sw/source/uibase/inc/tautofmt.hxx @@ -39,18 +39,18 @@ enum AutoFmtLine { TOP_LINE, BOTTOM_LINE, LEFT_LINE, RIGHT_LINE }; class SwAutoFormatDlg : public SfxModalDialog { - ListBox* m_pLbFormat; - VclContainer* m_pFormatting; - CheckBox* m_pBtnNumFormat; - CheckBox* m_pBtnBorder; - CheckBox* m_pBtnFont; - CheckBox* m_pBtnPattern; - CheckBox* m_pBtnAlignment; - OKButton* m_pBtnOk; - CancelButton* m_pBtnCancel; - PushButton* m_pBtnAdd; - PushButton* m_pBtnRemove; - PushButton* m_pBtnRename; + VclPtr<ListBox> m_pLbFormat; + VclPtr<VclContainer> m_pFormatting; + VclPtr<CheckBox> m_pBtnNumFormat; + VclPtr<CheckBox> m_pBtnBorder; + VclPtr<CheckBox> m_pBtnFont; + VclPtr<CheckBox> m_pBtnPattern; + VclPtr<CheckBox> m_pBtnAlignment; + VclPtr<OKButton> m_pBtnOk; + VclPtr<CancelButton> m_pBtnCancel; + VclPtr<PushButton> m_pBtnAdd; + VclPtr<PushButton> m_pBtnRemove; + VclPtr<PushButton> m_pBtnRename; OUString aStrTitle; OUString aStrLabel; OUString aStrClose; @@ -58,7 +58,7 @@ class SwAutoFormatDlg : public SfxModalDialog OUString aStrDelMsg; OUString aStrRenameTitle; OUString aStrInvalidFmt; - AutoFmtPreview* m_pWndPreview; + VclPtr<AutoFmtPreview> m_pWndPreview; SwWrtShell* pShell; SwTableAutoFmtTbl* pTableTbl; diff --git a/sw/source/uibase/inc/titlepage.hxx b/sw/source/uibase/inc/titlepage.hxx index 59ee2e180fab..a881cc41ff6c 100644 --- a/sw/source/uibase/inc/titlepage.hxx +++ b/sw/source/uibase/inc/titlepage.hxx @@ -24,22 +24,22 @@ class SwPageDesc; class SwTitlePageDlg : public SfxModalDialog { private: - RadioButton* m_pUseExistingPagesRB; - NumericField* m_pPageCountNF; + VclPtr<RadioButton> m_pUseExistingPagesRB; + VclPtr<NumericField> m_pPageCountNF; - RadioButton* m_pDocumentStartRB; - RadioButton* m_pPageStartRB; - NumericField* m_pPageStartNF; + VclPtr<RadioButton> m_pDocumentStartRB; + VclPtr<RadioButton> m_pPageStartRB; + VclPtr<NumericField> m_pPageStartNF; - CheckBox* m_pRestartNumberingCB; - NumericField* m_pRestartNumberingNF; - CheckBox* m_pSetPageNumberCB; - NumericField* m_pSetPageNumberNF; + VclPtr<CheckBox> m_pRestartNumberingCB; + VclPtr<NumericField> m_pRestartNumberingNF; + VclPtr<CheckBox> m_pSetPageNumberCB; + VclPtr<NumericField> m_pSetPageNumberNF; - ListBox* m_pPagePropertiesLB; - PushButton* m_pPagePropertiesPB; + VclPtr<ListBox> m_pPagePropertiesLB; + VclPtr<PushButton> m_pPagePropertiesPB; - OKButton* m_pOkPB; + VclPtr<OKButton> m_pOkPB; SwWrtShell *mpSh; diff --git a/sw/source/uibase/inc/view.hxx b/sw/source/uibase/inc/view.hxx index 8cd1d5cf01ca..c1a341eadce4 100644 --- a/sw/source/uibase/inc/view.hxx +++ b/sw/source/uibase/inc/view.hxx @@ -187,7 +187,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell Size m_aDocSz; // current document size Rectangle m_aVisArea; // visible region - SwEditWin *m_pEditWin; + VclPtr<SwEditWin> m_pEditWin; SwWrtShell *m_pWrtShell; SfxShell *m_pShell; // current SubShell at the dispatcher @@ -195,21 +195,21 @@ class SW_DLLPUBLIC SwView: public SfxViewShell SwView_Impl *m_pViewImpl; // Impl-data for UNO + Basic - SwScrollbar *m_pHScrollbar, // MDI control elements - *m_pVScrollbar; + VclPtr<SwScrollbar> m_pHScrollbar, // MDI control elements + m_pVScrollbar; bool m_bHScrollbarEnabled; bool m_bVScrollbarEnabled; - ::vcl::Window *m_pScrollFill; // dummy window for filling the lower right edge + VclPtr<::vcl::Window> m_pScrollFill; // dummy window for filling the lower right edge // when both scrollbars are active - SvxRuler *m_pHRuler, - *m_pVRuler; - ImageButton *m_pTogglePageBtn; + VclPtr<SvxRuler> m_pHRuler, + m_pVRuler; + VclPtr<ImageButton> m_pTogglePageBtn; - SwHlpImageButton *m_pPageUpBtn, - *m_pPageDownBtn; + VclPtr<SwHlpImageButton> m_pPageUpBtn, + m_pPageDownBtn; SwGlossaryHdl *m_pGlosHdl; // handle text block SwDrawBase *m_pDrawActual; @@ -221,7 +221,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell SwPostItMgr *m_pPostItMgr; int m_nSelectionType; - FloatingWindow *m_pFieldPopup; + VclPtr<FloatingWindow> m_pFieldPopup; static const int m_nMASTERENUMCOMMANDS = 6; diff --git a/sw/source/uibase/inc/wordcountdialog.hxx b/sw/source/uibase/inc/wordcountdialog.hxx index faf67d4240b9..63aa450f3aeb 100644 --- a/sw/source/uibase/inc/wordcountdialog.hxx +++ b/sw/source/uibase/inc/wordcountdialog.hxx @@ -33,22 +33,22 @@ class SwWordCountFloatDlg : public SfxModelessDialog void showCJK(bool bShowCJK); void showStandardizedPages(bool bShowStandardizedPages); - FixedText* m_pCurrentWordFT; - FixedText* m_pCurrentCharacterFT; - FixedText* m_pCurrentCharacterExcludingSpacesFT; - FixedText* m_pCurrentCjkcharsFT; - FixedText* m_pCurrentStandardizedPagesFT; + VclPtr<FixedText> m_pCurrentWordFT; + VclPtr<FixedText> m_pCurrentCharacterFT; + VclPtr<FixedText> m_pCurrentCharacterExcludingSpacesFT; + VclPtr<FixedText> m_pCurrentCjkcharsFT; + VclPtr<FixedText> m_pCurrentStandardizedPagesFT; - FixedText* m_pDocWordFT; - FixedText* m_pDocCharacterFT; - FixedText* m_pDocCharacterExcludingSpacesFT; - FixedText* m_pDocCjkcharsFT; - FixedText* m_pDocStandardizedPagesFT; + VclPtr<FixedText> m_pDocWordFT; + VclPtr<FixedText> m_pDocCharacterFT; + VclPtr<FixedText> m_pDocCharacterExcludingSpacesFT; + VclPtr<FixedText> m_pDocCjkcharsFT; + VclPtr<FixedText> m_pDocStandardizedPagesFT; - FixedText* m_pCjkcharsLabelFT; - FixedText* m_pStandardizedPagesLabelFT; + VclPtr<FixedText> m_pCjkcharsLabelFT; + VclPtr<FixedText> m_pStandardizedPagesLabelFT; - CloseButton* m_pClosePB; + VclPtr<CloseButton> m_pClosePB; DECL_LINK( CloseHdl, void* ); public: diff --git a/sw/source/uibase/inc/workctrl.hxx b/sw/source/uibase/inc/workctrl.hxx index bac81d6750e7..31638e22679a 100644 --- a/sw/source/uibase/inc/workctrl.hxx +++ b/sw/source/uibase/inc/workctrl.hxx @@ -129,8 +129,8 @@ public: class SwScrollNaviPopup : public SfxPopupWindow { - SwScrollNaviToolBox* m_pToolBox; - FixedText* m_pInfoField; + VclPtr<SwScrollNaviToolBox> m_pToolBox; + VclPtr<FixedText> m_pInfoField; ImageList aIList; OUString sQuickHelp[2 * NID_COUNT]; diff --git a/sw/source/uibase/inc/wrap.hxx b/sw/source/uibase/inc/wrap.hxx index 20b162e8cfd4..34002c9ea35b 100644 --- a/sw/source/uibase/inc/wrap.hxx +++ b/sw/source/uibase/inc/wrap.hxx @@ -43,24 +43,24 @@ public: class SwWrapTabPage: public SfxTabPage { // WRAPPING - RadioButton* m_pNoWrapRB; - RadioButton* m_pWrapLeftRB; - RadioButton* m_pWrapRightRB; - RadioButton* m_pWrapParallelRB; - RadioButton* m_pWrapThroughRB; - RadioButton* m_pIdealWrapRB; + VclPtr<RadioButton> m_pNoWrapRB; + VclPtr<RadioButton> m_pWrapLeftRB; + VclPtr<RadioButton> m_pWrapRightRB; + VclPtr<RadioButton> m_pWrapParallelRB; + VclPtr<RadioButton> m_pWrapThroughRB; + VclPtr<RadioButton> m_pIdealWrapRB; // MARGIN - MetricField* m_pLeftMarginED; - MetricField* m_pRightMarginED; - MetricField* m_pTopMarginED; - MetricField* m_pBottomMarginED; + VclPtr<MetricField> m_pLeftMarginED; + VclPtr<MetricField> m_pRightMarginED; + VclPtr<MetricField> m_pTopMarginED; + VclPtr<MetricField> m_pBottomMarginED; // OPTIONS - CheckBox* m_pWrapAnchorOnlyCB; - CheckBox* m_pWrapTransparentCB; - CheckBox* m_pWrapOutlineCB; - CheckBox* m_pWrapOutsideCB; + VclPtr<CheckBox> m_pWrapAnchorOnlyCB; + VclPtr<CheckBox> m_pWrapTransparentCB; + VclPtr<CheckBox> m_pWrapOutlineCB; + VclPtr<CheckBox> m_pWrapOutsideCB; sal_uInt16 nOldLeftMargin; sal_uInt16 nOldRightMargin; @@ -81,6 +81,7 @@ class SwWrapTabPage: public SfxTabPage SwWrapTabPage(vcl::Window *pParent, const SfxItemSet &rSet); virtual ~SwWrapTabPage(); + virtual void dispose() SAL_OVERRIDE; void ApplyImageList(); void EnableModes(const SfxItemSet& rSet); diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index a0cd1e257498..0f0b34c27948 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -69,7 +69,7 @@ SwRedlineAcceptChild::SwRedlineAcceptChild( vcl::Window* _pParent, { pWindow = new SwModelessRedlineAcceptDlg( pBindings, this, _pParent); - static_cast<SwModelessRedlineAcceptDlg *>(pWindow)->Initialize(pInfo); + static_cast<SwModelessRedlineAcceptDlg *>(pWindow.get())->Initialize(pInfo); } // newly initialise dialog after document switch diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx index b9d43d094ec1..675a17b58294 100644 --- a/sw/source/uibase/misc/swruler.cxx +++ b/sw/source/uibase/misc/swruler.cxx @@ -51,6 +51,13 @@ SwCommentRuler::SwCommentRuler( SwViewShell* pViewSh, vcl::Window* pParent, SwEd // Destructor SwCommentRuler::~SwCommentRuler() { + dispose(); +} + +void SwCommentRuler::dispose() +{ + mpSwWin.clear(); + SvxRuler::dispose(); } void SwCommentRuler::Paint( const Rectangle& rRect ) diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx index 2303c3dad6b9..6f01222b27e4 100644 --- a/sw/source/uibase/ribbar/inputwin.cxx +++ b/sw/source/uibase/ribbar/inputwin.cxx @@ -626,7 +626,7 @@ SwInputChild::SwInputChild(vcl::Window* _pParent, { pDispatch = pBindings->GetDispatcher(); pWindow = new SwInputWindow( _pParent, pBindings ); - static_cast<SwInputWindow*>(pWindow)->ShowWin(); + static_cast<SwInputWindow*>(pWindow.get())->ShowWin(); eChildAlignment = SfxChildAlignment::LOWESTTOP; } diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index 58d0e32a051f..ca9059586706 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -453,7 +453,8 @@ SwScrollNaviPopup::~SwScrollNaviPopup() void SwScrollNaviPopup::dispose() { - delete m_pToolBox; + m_pToolBox.clear(); + m_pInfoField.clear(); SfxPopupWindow::dispose(); } diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index 49fc1741a7ce..2ec2772c72f5 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -54,6 +54,7 @@ #include <shells.hrc> #include <SwStyleNameMapper.hxx> #include "swabstdlg.hxx" +#include "outline.hxx" #include "chrdlg.hrc" #include <boost/scoped_ptr.hpp> diff --git a/sw/source/uibase/shells/txtcrsr.cxx b/sw/source/uibase/shells/txtcrsr.cxx index fa98cf0f1ec4..8c1f4ed082dc 100644 --- a/sw/source/uibase/shells/txtcrsr.cxx +++ b/sw/source/uibase/shells/txtcrsr.cxx @@ -43,6 +43,7 @@ #include <svx/svdouno.hxx> #include <svx/fmshell.hxx> #include <svx/sdrobjectfilter.hxx> +#include "outline.hxx" using namespace ::com::sun::star; diff --git a/sw/source/uibase/sidebar/PageColumnControl.cxx b/sw/source/uibase/sidebar/PageColumnControl.cxx index 703b4cee03f4..6e9c39f62f51 100644 --- a/sw/source/uibase/sidebar/PageColumnControl.cxx +++ b/sw/source/uibase/sidebar/PageColumnControl.cxx @@ -82,7 +82,7 @@ PageColumnControl::~PageColumnControl(void) void PageColumnControl::dispose() { - delete mpColumnValueSet; + mpColumnValueSet.clear(); maMoreButton.disposeAndClear(); ::svx::sidebar::PopupControl::dispose(); } diff --git a/sw/source/uibase/sidebar/PageColumnControl.hxx b/sw/source/uibase/sidebar/PageColumnControl.hxx index ef81b4d1dbb8..79e22ccfd40f 100644 --- a/sw/source/uibase/sidebar/PageColumnControl.hxx +++ b/sw/source/uibase/sidebar/PageColumnControl.hxx @@ -48,7 +48,7 @@ public: virtual void dispose() SAL_OVERRIDE; private: - ::svx::sidebar::ValueSetWithTextControl* mpColumnValueSet; + VclPtr<::svx::sidebar::ValueSetWithTextControl> mpColumnValueSet; VclPtr<PushButton> maMoreButton; sal_uInt16 mnColumnType; diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx index d0f71e6c4055..46eb3960b2f4 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.cxx +++ b/sw/source/uibase/sidebar/PageMarginControl.cxx @@ -138,7 +138,7 @@ PageMarginControl::~PageMarginControl() void PageMarginControl::dispose() { - delete mpMarginValueSet; + mpMarginValueSet.clear(); StoreUserCustomValues(); diff --git a/sw/source/uibase/sidebar/PageMarginControl.hxx b/sw/source/uibase/sidebar/PageMarginControl.hxx index 8ab4c1b34917..f6d8d28cef61 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.hxx +++ b/sw/source/uibase/sidebar/PageMarginControl.hxx @@ -64,7 +64,7 @@ public: virtual void dispose() SAL_OVERRIDE; private: - ::svx::sidebar::ValueSetWithTextControl* mpMarginValueSet; + VclPtr<::svx::sidebar::ValueSetWithTextControl> mpMarginValueSet; VclPtr<FixedText> maCustom; VclPtr<FixedText> maLeft; diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx b/sw/source/uibase/sidebar/PageOrientationControl.cxx index 96494e601220..c4d9357d0d4f 100644 --- a/sw/source/uibase/sidebar/PageOrientationControl.cxx +++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx @@ -68,7 +68,7 @@ PageOrientationControl::~PageOrientationControl(void) void PageOrientationControl::dispose() { - delete mpOrientationValueSet; + mpOrientationValueSet.clear(); ::svx::sidebar::PopupControl::dispose(); } diff --git a/sw/source/uibase/sidebar/PageOrientationControl.hxx b/sw/source/uibase/sidebar/PageOrientationControl.hxx index 2f86a48df859..2bf1f6773e72 100644 --- a/sw/source/uibase/sidebar/PageOrientationControl.hxx +++ b/sw/source/uibase/sidebar/PageOrientationControl.hxx @@ -41,7 +41,7 @@ public: virtual void dispose() SAL_OVERRIDE; private: - ::svx::sidebar::ValueSetWithTextControl* mpOrientationValueSet; + VclPtr<::svx::sidebar::ValueSetWithTextControl> mpOrientationValueSet; bool mbLandscape; diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.cxx b/sw/source/uibase/sidebar/PagePropertyPanel.cxx index 13db3215afb9..1ce8f61fe3af 100644 --- a/sw/source/uibase/sidebar/PagePropertyPanel.cxx +++ b/sw/source/uibase/sidebar/PagePropertyPanel.cxx @@ -215,6 +215,10 @@ void PagePropertyPanel::dispose() mpPageULMarginItem.reset(); mpPageSizeItem.reset(); + mpToolBoxOrientation.clear(); + mpToolBoxMargin.clear(); + mpToolBoxSize.clear(); + mpToolBoxColumn.clear(); PanelLayout::dispose(); } diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.hxx b/sw/source/uibase/sidebar/PagePropertyPanel.hxx index b2c0d6c16eed..f9dd2c09190b 100644 --- a/sw/source/uibase/sidebar/PagePropertyPanel.hxx +++ b/sw/source/uibase/sidebar/PagePropertyPanel.hxx @@ -108,10 +108,10 @@ namespace sw { namespace sidebar { SfxBindings* mpBindings; // toolboxes - on click open corresponding popup - ToolBox* mpToolBoxOrientation; - ToolBox* mpToolBoxMargin; - ToolBox* mpToolBoxSize; - ToolBox* mpToolBoxColumn; + VclPtr<ToolBox> mpToolBoxOrientation; + VclPtr<ToolBox> mpToolBoxMargin; + VclPtr<ToolBox> mpToolBoxSize; + VclPtr<ToolBox> mpToolBoxColumn; Image* maImgSize; Image* maImgSize_L; diff --git a/sw/source/uibase/sidebar/PageSizeControl.cxx b/sw/source/uibase/sidebar/PageSizeControl.cxx index 576350850aab..0906c8f02a2c 100644 --- a/sw/source/uibase/sidebar/PageSizeControl.cxx +++ b/sw/source/uibase/sidebar/PageSizeControl.cxx @@ -148,7 +148,7 @@ PageSizeControl::~PageSizeControl() void PageSizeControl::dispose() { - delete mpSizeValueSet; + mpSizeValueSet.clear(); maMoreButton.disposeAndClear(); maWidthHeightField.disposeAndClear(); ::svx::sidebar::PopupControl::dispose(); diff --git a/sw/source/uibase/sidebar/PageSizeControl.hxx b/sw/source/uibase/sidebar/PageSizeControl.hxx index 5377655b556b..91f63cea737f 100644 --- a/sw/source/uibase/sidebar/PageSizeControl.hxx +++ b/sw/source/uibase/sidebar/PageSizeControl.hxx @@ -51,7 +51,7 @@ public: virtual void dispose() SAL_OVERRIDE; private: - ::svx::sidebar::ValueSetWithTextControl* mpSizeValueSet; + VclPtr<::svx::sidebar::ValueSetWithTextControl> mpSizeValueSet; VclPtr<PushButton> maMoreButton; // hidden metric field VclPtr<MetricField> maWidthHeightField; diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx index 9c7204921934..d1fffd6b7029 100644 --- a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx +++ b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx @@ -89,6 +89,18 @@ WrapPropertyPanel::WrapPropertyPanel( WrapPropertyPanel::~WrapPropertyPanel() { + dispose(); +} + +void WrapPropertyPanel::dispose() +{ + mpRBNoWrap.clear(); + mpRBWrapLeft.clear(); + mpRBWrapRight.clear(); + mpRBWrapParallel.clear(); + mpRBWrapThrough.clear(); + mpRBIdealWrap.clear(); + PanelLayout::dispose(); } void WrapPropertyPanel::Initialize() diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.hxx b/sw/source/uibase/sidebar/WrapPropertyPanel.hxx index d1c53394021f..c64b1331587b 100644 --- a/sw/source/uibase/sidebar/WrapPropertyPanel.hxx +++ b/sw/source/uibase/sidebar/WrapPropertyPanel.hxx @@ -47,23 +47,24 @@ namespace sw { namespace sidebar { const SfxPoolItem* pState, const bool bIsEnabled) SAL_OVERRIDE; + virtual ~WrapPropertyPanel(); + virtual void dispose() SAL_OVERRIDE; private: WrapPropertyPanel( vcl::Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame, SfxBindings* pBindings ); - virtual ~WrapPropertyPanel(); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame; SfxBindings* mpBindings; - RadioButton* mpRBNoWrap; - RadioButton* mpRBWrapLeft; - RadioButton* mpRBWrapRight; - RadioButton* mpRBWrapParallel; - RadioButton* mpRBWrapThrough; - RadioButton* mpRBIdealWrap; + VclPtr<RadioButton> mpRBNoWrap; + VclPtr<RadioButton> mpRBWrapLeft; + VclPtr<RadioButton> mpRBWrapRight; + VclPtr<RadioButton> mpRBWrapParallel; + VclPtr<RadioButton> mpRBWrapThrough; + VclPtr<RadioButton> mpRBIdealWrap; //Image resource. ImageList aWrapIL; diff --git a/sw/source/uibase/table/tablepg.hxx b/sw/source/uibase/table/tablepg.hxx index f89d66e7bb14..b0ca2e5b815d 100644 --- a/sw/source/uibase/table/tablepg.hxx +++ b/sw/source/uibase/table/tablepg.hxx @@ -37,29 +37,29 @@ struct TColumn class SwFormatTablePage : public SfxTabPage { - Edit* m_pNameED; + VclPtr<Edit> m_pNameED; TextFilter m_aTextFilter; - FixedText* m_pWidthFT; + VclPtr<FixedText> m_pWidthFT; PercentField m_aWidthMF; - CheckBox* m_pRelWidthCB; + VclPtr<CheckBox> m_pRelWidthCB; - RadioButton* m_pFullBtn; - RadioButton* m_pLeftBtn; - RadioButton* m_pFromLeftBtn; - RadioButton* m_pRightBtn; - RadioButton* m_pCenterBtn; - RadioButton* m_pFreeBtn; + VclPtr<RadioButton> m_pFullBtn; + VclPtr<RadioButton> m_pLeftBtn; + VclPtr<RadioButton> m_pFromLeftBtn; + VclPtr<RadioButton> m_pRightBtn; + VclPtr<RadioButton> m_pCenterBtn; + VclPtr<RadioButton> m_pFreeBtn; - FixedText* m_pLeftFT; + VclPtr<FixedText> m_pLeftFT; PercentField m_aLeftMF; - FixedText* m_pRightFT; + VclPtr<FixedText> m_pRightFT; PercentField m_aRightMF; - FixedText* m_pTopFT; - MetricField* m_pTopMF; - FixedText* m_pBottomFT; - MetricField* m_pBottomMF; + VclPtr<FixedText> m_pTopFT; + VclPtr<MetricField> m_pTopMF; + VclPtr<FixedText> m_pBottomFT; + VclPtr<MetricField> m_pBottomMF; - ListBox* m_pTextDirectionLB; + VclPtr<ListBox> m_pTextDirectionLB; SwTableRep* pTblData; SwTwips nSaveWidth; @@ -81,6 +81,8 @@ class SwFormatTablePage : public SfxTabPage public: SwFormatTablePage( vcl::Window* pParent, const SfxItemSet& rSet ); + virtual ~SwFormatTablePage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet); virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE; @@ -94,16 +96,16 @@ public: class SwTableColumnPage : public SfxTabPage { - CheckBox* m_pModifyTableCB; - CheckBox* m_pProportionalCB; - FixedText* m_pSpaceFT; - MetricField* m_pSpaceED; - PushButton* m_pUpBtn; - PushButton* m_pDownBtn; + VclPtr<CheckBox> m_pModifyTableCB; + VclPtr<CheckBox> m_pProportionalCB; + VclPtr<FixedText> m_pSpaceFT; + VclPtr<MetricField> m_pSpaceED; + VclPtr<PushButton> m_pUpBtn; + VclPtr<PushButton> m_pDownBtn; SwTableRep* pTblData; PercentField m_aFieldArr[MET_FIELDS]; - FixedText* m_pTextArr[MET_FIELDS]; + VclPtr<FixedText> m_pTextArr[MET_FIELDS]; SwTwips nTableWidth; SwTwips nMinWidth; sal_uInt16 nNoOfCols; @@ -131,6 +133,7 @@ class SwTableColumnPage : public SfxTabPage public: SwTableColumnPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~SwTableColumnPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet); virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE; @@ -142,27 +145,27 @@ public: class SwTextFlowPage : public SfxTabPage { - CheckBox* m_pPgBrkCB; + VclPtr<CheckBox> m_pPgBrkCB; - RadioButton* m_pPgBrkRB; - RadioButton* m_pColBrkRB; + VclPtr<RadioButton> m_pPgBrkRB; + VclPtr<RadioButton> m_pColBrkRB; - RadioButton* m_pPgBrkBeforeRB; - RadioButton* m_pPgBrkAfterRB; + VclPtr<RadioButton> m_pPgBrkBeforeRB; + VclPtr<RadioButton> m_pPgBrkAfterRB; - CheckBox* m_pPageCollCB; - ListBox* m_pPageCollLB; - FixedText* m_pPageNoFT; - NumericField* m_pPageNoNF; - CheckBox* m_pSplitCB; - TriStateBox* m_pSplitRowCB; - CheckBox* m_pKeepCB; - CheckBox* m_pHeadLineCB; - NumericField* m_pRepeatHeaderNF; - VclContainer* m_pRepeatHeaderCombo; - ListBox* m_pTextDirectionLB; + VclPtr<CheckBox> m_pPageCollCB; + VclPtr<ListBox> m_pPageCollLB; + VclPtr<FixedText> m_pPageNoFT; + VclPtr<NumericField> m_pPageNoNF; + VclPtr<CheckBox> m_pSplitCB; + VclPtr<TriStateBox> m_pSplitRowCB; + VclPtr<CheckBox> m_pKeepCB; + VclPtr<CheckBox> m_pHeadLineCB; + VclPtr<NumericField> m_pRepeatHeaderNF; + VclPtr<VclContainer> m_pRepeatHeaderCombo; + VclPtr<ListBox> m_pTextDirectionLB; - ListBox* m_pVertOrientLB; + VclPtr<ListBox> m_pVertOrientLB; SwWrtShell* pShell; @@ -178,9 +181,9 @@ class SwTextFlowPage : public SfxTabPage DECL_LINK( HeadLineCBClickHdl, void* p = 0 ); SwTextFlowPage( vcl::Window* pParent, const SfxItemSet& rSet ); - virtual ~SwTextFlowPage(); - public: + virtual ~SwTextFlowPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet); virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE; virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE; diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index fa80f75052a0..ccd5cb168bd0 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -145,13 +145,15 @@ static void lcl_InvalidateZoomSlots(SfxBindings& rBindings) // At first the zoom dialog class SwPreviewZoomDlg : public SvxStandardDialog { - NumericField* m_pRowEdit; - NumericField* m_pColEdit; + VclPtr<NumericField> m_pRowEdit; + VclPtr<NumericField> m_pColEdit; virtual void Apply() SAL_OVERRIDE; public: SwPreviewZoomDlg( SwPagePreviewWin& rParent ); + virtual ~SwPreviewZoomDlg(); + virtual void dispose() SAL_OVERRIDE; }; SwPreviewZoomDlg::SwPreviewZoomDlg( SwPagePreviewWin& rParent ) @@ -164,6 +166,18 @@ SwPreviewZoomDlg::SwPreviewZoomDlg( SwPagePreviewWin& rParent ) m_pColEdit->SetValue( rParent.GetCol() ); } +SwPreviewZoomDlg::~SwPreviewZoomDlg() +{ + dispose(); +} + +void SwPreviewZoomDlg::dispose() +{ + m_pRowEdit.clear(); + m_pColEdit.clear(); + SvxStandardDialog::dispose(); +} + void SwPreviewZoomDlg::Apply() { static_cast<SwPagePreviewWin*>(GetParent())->CalcWish( @@ -1224,11 +1238,6 @@ SwPagePreview::~SwPagePreview() SwViewShell* pVShell = pViewWin->GetViewShell(); pVShell->SetWin(0); delete pVShell; - delete pViewWin; - - delete pScrollFill; - delete pHScrollbar; - delete pVScrollbar; } SwDocShell* SwPagePreview::GetDocShell() @@ -1239,20 +1248,20 @@ SwDocShell* SwPagePreview::GetDocShell() int SwPagePreview::_CreateScrollbar( bool bHori ) { vcl::Window *pMDI = &GetViewFrame()->GetWindow(); - SwScrollbar** ppScrollbar = bHori ? &pHScrollbar : &pVScrollbar; + VclPtr<SwScrollbar>& ppScrollbar = bHori ? pHScrollbar : pVScrollbar; - assert(!*ppScrollbar); //check beforehand! + assert(!ppScrollbar.get()); //check beforehand! - *ppScrollbar = new SwScrollbar( pMDI, bHori ); + ppScrollbar = new SwScrollbar( pMDI, bHori ); ScrollDocSzChg(); - (*ppScrollbar)->EnableDrag( true ); - (*ppScrollbar)->SetEndScrollHdl( LINK( this, SwPagePreview, EndScrollHdl )); + ppScrollbar->EnableDrag( true ); + ppScrollbar->SetEndScrollHdl( LINK( this, SwPagePreview, EndScrollHdl )); - (*ppScrollbar)->SetScrollHdl( LINK( this, SwPagePreview, ScrollHdl )); + ppScrollbar->SetScrollHdl( LINK( this, SwPagePreview, ScrollHdl )); InvalidateBorder(); - (*ppScrollbar)->ExtendedShow(); + ppScrollbar->ExtendedShow(); return 1; } diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 8c16a79f3f5e..350cf294f21d 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -1051,18 +1051,18 @@ SwView::~SwView() m_pViewImpl->Invalidate(); EndListening(*GetViewFrame()); EndListening(*GetDocShell()); - delete m_pScrollFill; + m_pScrollFill.clear(); delete m_pWrtShell; m_pWrtShell = 0; // Set to 0, so that it is not accessible by the following dtors cannot. m_pShell = 0; - delete m_pHScrollbar; - delete m_pVScrollbar; - delete m_pHRuler; - delete m_pVRuler; - delete m_pTogglePageBtn; + m_pHScrollbar.clear(); + m_pVScrollbar.clear(); + m_pHRuler.clear(); + m_pVRuler.clear(); + m_pTogglePageBtn.clear(); delete m_pGlosHdl; delete m_pViewImpl; - delete m_pEditWin; + m_pEditWin.clear(); delete m_pFormatClipboard; } diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index 001f48dad3ce..98a9da9d14c5 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -888,11 +888,7 @@ IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox ) IMPL_LINK_NOARG(SwView, FieldPopupModeEndHdl) { - if ( m_pFieldPopup ) - { - delete m_pFieldPopup; - m_pFieldPopup = NULL; - } + m_pFieldPopup.clear(); return 0; } diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index 8d63bcb4580a..11c4a574b96e 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -290,25 +290,25 @@ IMPL_LINK( SwView, WindowChildEventListener, VclSimpleEvent*, pEvent ) int SwView::_CreateScrollbar( bool bHori ) { vcl::Window *pMDI = &GetViewFrame()->GetWindow(); - SwScrollbar** ppScrollbar = bHori ? &m_pHScrollbar : &m_pVScrollbar; + VclPtr<SwScrollbar>& ppScrollbar = bHori ? m_pHScrollbar : m_pVScrollbar; - assert(!*ppScrollbar); //check beforehand! + assert(!ppScrollbar.get()); //check beforehand! - *ppScrollbar = new SwScrollbar( pMDI, bHori ); + ppScrollbar = new SwScrollbar( pMDI, bHori ); UpdateScrollbars(); if(bHori) - (*ppScrollbar)->SetScrollHdl( LINK( this, SwView, EndScrollHdl )); + ppScrollbar->SetScrollHdl( LINK( this, SwView, EndScrollHdl )); else - (*ppScrollbar)->SetScrollHdl( LINK( this, SwView, ScrollHdl )); - (*ppScrollbar)->SetEndScrollHdl( LINK( this, SwView, EndScrollHdl )); + ppScrollbar->SetScrollHdl( LINK( this, SwView, ScrollHdl )); + ppScrollbar->SetEndScrollHdl( LINK( this, SwView, EndScrollHdl )); - (*ppScrollbar)->EnableDrag( true ); + ppScrollbar->EnableDrag( true ); if(GetWindow()) InvalidateBorder(); if (!m_bShowAtResize) - (*ppScrollbar)->ExtendedShow(); + ppScrollbar->ExtendedShow(); return 1; } diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 7a589c022710..32203071852e 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -91,6 +91,7 @@ #include <unomid.h> #include "navmgr.hxx" +#include "SidebarWin.hxx" #include <boost/scoped_ptr.hpp> #define CTYPE_CNT 0 diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 718fa2cd4cc8..7a9fafe65932 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -187,6 +187,7 @@ void SwGlobalTree::dispose() { delete pSwGlblDocContents; delete pDocInserter; + pDefParentWin.clear(); SvTreeListBox::dispose(); } diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx index 4951847ff958..1e4e79490080 100644 --- a/sw/source/uibase/utlui/gloslst.cxx +++ b/sw/source/uibase/utlui/gloslst.cxx @@ -51,14 +51,17 @@ struct TripleString class SwGlossDecideDlg : public ModalDialog { - OKButton* m_pOk; - ListBox* m_pListLB; + VclPtr<OKButton> m_pOk; + VclPtr<ListBox> m_pListLB; DECL_LINK(DoubleClickHdl, void*); DECL_LINK(SelectHdl, void*); - public: - SwGlossDecideDlg(vcl::Window* pParent); +public: + SwGlossDecideDlg(vcl::Window* pParent); + virtual ~SwGlossDecideDlg(); + virtual void dispose() SAL_OVERRIDE; + ListBox& GetListBox() {return *m_pListLB;} }; @@ -73,6 +76,18 @@ SwGlossDecideDlg::SwGlossDecideDlg(vcl::Window* pParent) m_pListLB->SetSelectHdl(LINK(this, SwGlossDecideDlg, SelectHdl)); } +SwGlossDecideDlg::~SwGlossDecideDlg() +{ + dispose(); +} + +void SwGlossDecideDlg::dispose() +{ + m_pOk.clear(); + m_pListLB.clear(); + ModalDialog::dispose(); +} + IMPL_LINK_NOARG(SwGlossDecideDlg, DoubleClickHdl) { EndDialog(RET_OK); diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 504e3928d688..c1fbaec60ba0 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -867,12 +867,12 @@ void SwNavigationPI::dispose() (*pxObjectShell)->DoClose(); delete pxObjectShell; } - delete pPopupWindow; - delete pFloatingWindow; if ( IsBound() ) rBindings.Release(*this); + pPopupWindow.clear(); + pFloatingWindow.clear(); aContentToolBox.disposeAndClear(); aGlobalToolBox.disposeAndClear(); aContentTree.disposeAndClear(); @@ -894,7 +894,6 @@ IMPL_LINK_NOARG(SwNavigationPI, PopupModeEndHdl) { // Replace floating window with popup window and destroy // floating window instance. - delete pFloatingWindow; pFloatingWindow = pPopupWindow; pPopupWindow = 0; } |