diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-04-28 11:41:31 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-28 15:08:48 +0100 |
commit | e8b97a52c96df9c8e8055407b1e40ed7cb9cfc67 (patch) | |
tree | b322529f4a54a6427862cb20cb4cf87fb6a5d065 /sw/source/ui/dialog | |
parent | 2b0be6c0e9d23f1b8535ba7033732ae2e3bfb5c9 (diff) | |
parent | 0cde74f788a054fa2b65107a030dd463b8d11c7a (diff) |
Merge remote-tracking branch 'origin/feature/vclptr'
Resolve several thousand lines of conflicts.
Conflicts:
accessibility/source/extended/accessiblelistbox.cxx
accessibility/source/standard/vclxaccessiblecombobox.cxx
accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
accessibility/source/standard/vclxaccessiblelistbox.cxx
accessibility/source/standard/vclxaccessibletextfield.cxx
basctl/source/basicide/basidesh.cxx
cui/source/inc/chardlg.hxx
cui/source/tabpages/tpbitmap.cxx
dbaccess/source/ui/dlg/UserAdmin.cxx
dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
extensions/source/propctrlr/propertyeditor.hxx
extensions/source/scanner/sanedlg.cxx
filter/source/pdf/impdialog.cxx
include/sfx2/mgetempl.hxx
include/sfx2/sidebar/SidebarToolBox.hxx
include/sfx2/viewsh.hxx
include/svtools/brwbox.hxx
include/svtools/filectrl.hxx
include/svtools/scrwin.hxx
include/svx/dlgctrl.hxx
include/svx/sidebar/Popup.hxx
include/svx/sidebar/PopupContainer.hxx
include/svx/sidebar/PopupControl.hxx
include/svx/sidebar/SidebarDialControl.hxx
include/svx/sidebar/ValueSetWithTextControl.hxx
sc/source/ui/condformat/condformatdlgentry.cxx
sc/source/ui/navipi/navipi.cxx
sc/source/ui/sidebar/CellBorderStyleControl.hxx
sd/source/ui/animations/CustomAnimationDialog.cxx
sd/source/ui/inc/DrawViewShell.hxx
sd/source/ui/inc/Ruler.hxx
sd/source/ui/inc/SlideSorter.hxx
sd/source/ui/inc/ViewTabBar.hxx
sd/source/ui/inc/Window.hxx
sd/source/ui/inc/morphdlg.hxx
sd/source/ui/inc/sdpreslt.hxx
sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
sd/source/ui/sidebar/LayoutMenu.hxx
sd/source/ui/sidebar/MasterPagesSelector.hxx
sd/source/ui/sidebar/NavigatorWrapper.hxx
sd/source/ui/sidebar/PanelBase.hxx
sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
sd/source/ui/slideshow/showwindow.hxx
sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx
sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx
sd/source/ui/view/ViewShellBase.cxx
sd/source/ui/view/drviewsa.cxx
sfx2/source/appl/fileobj.hxx
sfx2/source/appl/opengrf.cxx
sfx2/source/control/thumbnailviewacc.hxx
sfx2/source/dialog/securitypage.cxx
sfx2/source/dialog/templdlg.cxx
sfx2/source/doc/docinsert.cxx
sfx2/source/doc/guisaveas.cxx
sfx2/source/inc/alienwarn.hxx
sfx2/source/sidebar/Deck.cxx
sfx2/source/sidebar/Deck.hxx
sfx2/source/sidebar/DeckTitleBar.cxx
sfx2/source/sidebar/DeckTitleBar.hxx
sfx2/source/sidebar/MenuButton.cxx
sfx2/source/sidebar/MenuButton.hxx
sfx2/source/sidebar/Panel.cxx
sfx2/source/sidebar/Panel.hxx
sfx2/source/sidebar/PanelTitleBar.hxx
sfx2/source/sidebar/SidebarDockingWindow.hxx
sfx2/source/sidebar/SidebarToolBox.cxx
sfx2/source/sidebar/TabBar.hxx
sfx2/source/sidebar/TabItem.cxx
sfx2/source/sidebar/TabItem.hxx
sfx2/source/sidebar/TitleBar.hxx
sfx2/source/toolbox/imgmgr.cxx
starmath/inc/edit.hxx
starmath/inc/smmod.hxx
starmath/qa/cppunit/test_starmath.cxx
starmath/source/edit.cxx
starmath/source/smmod.cxx
svtools/source/brwbox/brwbox1.cxx
svtools/source/brwbox/datwin.hxx
svtools/source/contnr/fileview.cxx
svtools/source/contnr/simptabl.cxx
svtools/source/control/filectrl.cxx
svtools/source/control/valueimp.hxx
svx/inc/GalleryControl.hxx
svx/source/dialog/dlgctrl.cxx
svx/source/dialog/swframeexample.cxx
svx/source/fmcomp/fmgridif.cxx
svx/source/gallery2/GalleryControl.cxx
svx/source/sidebar/EmptyPanel.hxx
svx/source/sidebar/area/AreaPropertyPanel.hxx
svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
svx/source/sidebar/insert/InsertPropertyPanel.cxx
svx/source/sidebar/insert/InsertPropertyPanel.hxx
svx/source/sidebar/line/LinePropertyPanel.hxx
svx/source/sidebar/line/LineWidthControl.cxx
svx/source/sidebar/line/LineWidthControl.hxx
svx/source/sidebar/line/LineWidthValueSet.hxx
svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
svx/source/sidebar/possize/SidebarDialControl.cxx
svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
svx/source/sidebar/text/TextPropertyPanel.hxx
svx/source/sidebar/tools/PopupContainer.cxx
svx/source/sidebar/tools/PopupControl.cxx
svx/source/sidebar/tools/ValueSetWithTextControl.cxx
svx/source/svdraw/svdfmtf.hxx
svx/source/svdraw/svdibrow.cxx
svx/source/tbxctrls/colrctrl.cxx
svx/source/tbxctrls/tbcontrl.cxx
sw/source/ui/dbui/mmaddressblockpage.cxx
sw/source/ui/dialog/uiregionsw.cxx
sw/source/ui/index/cnttab.cxx
sw/source/uibase/inc/drpcps.hxx
sw/source/uibase/sidebar/PageColumnControl.hxx
sw/source/uibase/sidebar/PageMarginControl.hxx
sw/source/uibase/sidebar/PageOrientationControl.hxx
sw/source/uibase/sidebar/PagePropertyPanel.hxx
sw/source/uibase/sidebar/PageSizeControl.hxx
sw/source/uibase/uiview/view2.cxx
sw/source/uibase/utlui/navipi.cxx
vcl/inc/svdata.hxx
vcl/source/control/combobox.cxx
vcl/source/control/lstbox.cxx
vcl/source/window/dockwin.cxx
vcl/source/window/winproc.cxx
Change-Id: I056cf3026ff17d65cca0b6e6588bda4a88fa8d95
Diffstat (limited to 'sw/source/ui/dialog')
-rw-r--r-- | sw/source/ui/dialog/abstract.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/dialog/ascfldlg.cxx | 21 | ||||
-rw-r--r-- | sw/source/ui/dialog/docstdlg.cxx | 23 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 145 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 5 | ||||
-rw-r--r-- | sw/source/ui/dialog/swmessdialog.cxx | 15 | ||||
-rw-r--r-- | sw/source/ui/dialog/swuiexp.cxx | 25 | ||||
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 134 | ||||
-rw-r--r-- | sw/source/ui/dialog/wordcountdialog.cxx | 19 |
9 files changed, 293 insertions, 106 deletions
diff --git a/sw/source/ui/dialog/abstract.cxx b/sw/source/ui/dialog/abstract.cxx index f33577268b82..a5de42b69a6c 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() +{ + disposeOnce(); +} + +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 93c3c7793e6e..68409fd8e9ec 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -174,14 +174,14 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh, { bool bDelPrinter = false; - SfxPrinter* pPrt = pDoc ? pDoc->getIDocumentDeviceAccess().getPrinter(false) : 0; + VclPtr<SfxPrinter> pPrt = pDoc ? pDoc->getIDocumentDeviceAccess().getPrinter(false) : 0; if( !pPrt ) { SfxItemSet* pSet = new SfxItemSet( rDocSh.GetPool(), SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, 0 ); - pPrt = new SfxPrinter( pSet ); + pPrt = VclPtr<SfxPrinter>::Create( pSet ); bDelPrinter = true; } @@ -211,7 +211,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh, m_pFontLB->SelectEntry( aOpt.GetFontName() ); if( bDelPrinter ) - delete pPrt; + pPrt.disposeAndClear(); } } @@ -242,8 +242,23 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh, SwAsciiFilterDlg::~SwAsciiFilterDlg() { + disposeOnce(); } +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..de1d3d6abcd8 100644 --- a/sw/source/ui/dialog/docstdlg.cxx +++ b/sw/source/ui/dialog/docstdlg.cxx @@ -36,9 +36,9 @@ #include <unotools/localedatawrapper.hxx> #include <vcl/settings.hxx> -SfxTabPage * SwDocStatPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) +VclPtr<SfxTabPage> SwDocStatPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { - return new SwDocStatPage(pParent, *rSet); + return VclPtr<SwDocStatPage>::Create(pParent, *rSet); } SwDocStatPage::SwDocStatPage(vcl::Window *pParent, const SfxItemSet &rSet) @@ -73,8 +73,25 @@ SwDocStatPage::SwDocStatPage(vcl::Window *pParent, const SfxItemSet &rSet) } - SwDocStatPage::~SwDocStatPage() +SwDocStatPage::~SwDocStatPage() { + disposeOnce(); +} + +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..ebc76da20d73 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -595,7 +595,7 @@ void AbstractSwWordCountFloatDlg_Impl::SetCounts(const SwDocStat &rCurrCnt, cons AbstractMailMergeWizard_Impl::~AbstractMailMergeWizard_Impl() { - delete pDlg; + pDlg.disposeAndClear(); } void AbstractMailMergeWizard_Impl::StartExecuteModal( const Link& rEndDialogHdl ) @@ -643,7 +643,7 @@ sal_uInt16 AbstractMailMergeWizard_Impl::GetRestartPage() const AbstractSwInsertAbstractDlg * SwAbstractDialogFactory_Impl::CreateSwInsertAbstractDlg(vcl::Window* pParent) { - SwInsertAbstractDlg* pDlg = new SwInsertAbstractDlg( pParent); + VclPtr<SwInsertAbstractDlg> pDlg = VclPtr<SwInsertAbstractDlg>::Create( pParent); return new AbstractSwInsertAbstractDlg_Impl(pDlg); } @@ -657,16 +657,16 @@ SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSfxDialog( vcl::Window* p switch ( nResId ) { case RC_DLG_ADDR : - pDlg = new SwAddrDlg( pParent, rSet ); + pDlg = VclPtr<SwAddrDlg>::Create( pParent, rSet ); break; case DLG_SWDROPCAPS : - pDlg = new SwDropCapsDlg( pParent, rSet ); + pDlg = VclPtr<SwDropCapsDlg>::Create( pParent, rSet ); break; case RC_SWDLG_BACKGROUND : - pDlg = new SwBackgroundDlg( pParent, rSet ); + pDlg = VclPtr<SwBackgroundDlg>::Create( pParent, rSet ); break; case RC_DLG_SWNUMFMTDLG : - pDlg = new SwNumFmtDlg( pParent, rSet ); + pDlg = VclPtr<SwNumFmtDlg>::Create( pParent, rSet ); break; default: break; @@ -681,7 +681,7 @@ AbstractSwAsciiFilterDlg* SwAbstractDialogFactory_Impl::CreateSwAsciiFilterDlg( SwDocShell& rDocSh, SvStream* pStream ) { - SwAsciiFilterDlg* pDlg = new SwAsciiFilterDlg( pParent, rDocSh, pStream ); + VclPtr<SwAsciiFilterDlg> pDlg = VclPtr<SwAsciiFilterDlg>::Create( pParent, rDocSh, pStream ); return new AbstractSwAsciiFilterDlg_Impl( pDlg ); } @@ -694,7 +694,7 @@ VclAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg( vcl: switch ( nResId ) { case DLG_INSERT_BOOKMARK : - pDlg = new SwInsertBookmarkDlg( pParent, rSh, rReq ); + pDlg = VclPtr<SwInsertBookmarkDlg>::Create( pParent, rSh, rReq ); break; default: @@ -709,44 +709,43 @@ VclAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg( vcl: AbstractSwBreakDlg * SwAbstractDialogFactory_Impl::CreateSwBreakDlg(vcl::Window *pParent, SwWrtShell &rSh) { - SwBreakDlg* pDlg = new SwBreakDlg(pParent, rSh); + VclPtr<SwBreakDlg> pDlg = VclPtr<SwBreakDlg>::Create(pParent, rSh); return new AbstractSwBreakDlg_Impl(pDlg); } VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwView& rVw) { - Dialog* pDlg = new SwChangeDBDlg(rVw); + VclPtr<Dialog> pDlg = VclPtr<SwChangeDBDlg>::Create(rVw); return new VclAbstractDialog_Impl(pDlg); } SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwCharDlg(vcl::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, sal_uInt8 nDialogMode, const OUString* pFmtStr) { - - SfxTabDialog* pDlg = new SwCharDlg(pParent, pVw, rCoreSet, nDialogMode, pFmtStr); + VclPtr<SfxTabDialog> pDlg = VclPtr<SwCharDlg>::Create(pParent, pVw, rCoreSet, nDialogMode, pFmtStr); return new AbstractTabDialog_Impl(pDlg); } AbstractSwConvertTableDlg* SwAbstractDialogFactory_Impl::CreateSwConvertTableDlg(SwView& rView, bool bToTable) { - SwConvertTableDlg* pDlg = new SwConvertTableDlg(rView, bToTable); + VclPtr<SwConvertTableDlg> pDlg = VclPtr<SwConvertTableDlg>::Create(rView, bToTable); return new AbstractSwConvertTableDlg_Impl(pDlg); } VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwCaptionDialog ( vcl::Window *pParent, SwView &rV,int nResId) { - Dialog* pDlg=NULL; + VclPtr<Dialog> pDlg; switch ( nResId ) { case DLG_CAPTION : - pDlg = new SwCaptionDialog( pParent, rV ); + pDlg = VclPtr<SwCaptionDialog>::Create( pParent, rV ); break; default: break; } - if ( pDlg ) + if ( pDlg.get() ) return new VclAbstractDialog_Impl( pDlg ); return 0; } @@ -756,20 +755,20 @@ AbstractSwInsertDBColAutoPilot* SwAbstractDialogFactory_Impl::CreateSwInsertDBCo uno::Reference<sdbcx::XColumnsSupplier> xColSupp, const SwDBData& rData) { - SwInsertDBColAutoPilot* pDlg = new SwInsertDBColAutoPilot( rView, rxSource, xColSupp, rData ); + VclPtr<SwInsertDBColAutoPilot> pDlg = VclPtr<SwInsertDBColAutoPilot>::Create( rView, rxSource, xColSupp, rData ); return new AbstractSwInsertDBColAutoPilot_Impl( pDlg ); } SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwFootNoteOptionDlg(vcl::Window *pParent, SwWrtShell &rSh) { - SfxTabDialog* pDlg = new SwFootNoteOptionDlg( pParent, rSh ); + VclPtr<SfxTabDialog> pDlg = VclPtr<SwFootNoteOptionDlg>::Create( pParent, rSh ); return new AbstractTabDialog_Impl( pDlg ); } AbstractDropDownFieldDialog * SwAbstractDialogFactory_Impl::CreateDropDownFieldDialog(vcl::Window *pParent, SwWrtShell &rSh, SwField* pField, bool bNextButton) { - sw::DropDownFieldDialog* pDlg = new sw::DropDownFieldDialog(pParent, rSh, pField, bNextButton); + VclPtr<sw::DropDownFieldDialog> pDlg = VclPtr<sw::DropDownFieldDialog>::Create(pParent, rSh, pField, bNextButton); return new AbstractDropDownFieldDialog_Impl( pDlg ); } @@ -777,14 +776,14 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwEnvDlg ( vcl::Window SwWrtShell* pWrtSh, Printer* pPrt, bool bInsert ) { - SfxTabDialog* pDlg = new SwEnvDlg( pParent, rSet, pWrtSh,pPrt, bInsert ); + VclPtr<SfxTabDialog> pDlg = VclPtr<SwEnvDlg>::Create( pParent, rSet, pWrtSh,pPrt, bInsert ); return new AbstractTabDialog_Impl( pDlg ); } AbstractSwLabDlg* SwAbstractDialogFactory_Impl::CreateSwLabDlg(vcl::Window* pParent, const SfxItemSet& rSet, SwDBManager* pDBManager, bool bLabel) { - SwLabDlg* pDlg = new SwLabDlg(pParent, rSet, pDBManager, bLabel); + VclPtr<SwLabDlg> pDlg = VclPtr<SwLabDlg>::Create(pParent, rSet, pDBManager, bLabel); return new AbstractSwLabDlg_Impl(pDlg); } @@ -800,120 +799,120 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwParaDlg ( vcl::Windo bool bDraw , const OString& sDefPage) { - SfxTabDialog* pDlg = new SwParaDlg( pParent, rVw, rCoreSet,nDialogMode, pCollName, bDraw, sDefPage ); + VclPtr<SfxTabDialog> pDlg = VclPtr<SwParaDlg>::Create( pParent, rVw, rCoreSet,nDialogMode, pCollName, bDraw, sDefPage ); return new AbstractTabDialog_Impl( pDlg ); } VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclAbstractDialog ( vcl::Window *pParent, SwWrtShell &rSh, int nResId ) { - Dialog* pDlg=NULL; + VclPtr<Dialog> pDlg; switch ( nResId ) { case DLG_ROW_HEIGHT : - pDlg = new SwTableHeightDlg( pParent, rSh); + pDlg = VclPtr<SwTableHeightDlg>::Create( pParent, rSh); break; case DLG_SORTING : - pDlg = new SwSortDlg( pParent, rSh); + pDlg = VclPtr<SwSortDlg>::Create( pParent, rSh); break; case DLG_COLUMN : - pDlg = new SwColumnDlg( pParent, rSh ); + pDlg = VclPtr<SwColumnDlg>::Create( pParent, rSh ); break; case DLG_EDIT_AUTHMARK : - pDlg = new SwAuthMarkModalDlg( pParent, rSh ); + pDlg = VclPtr<SwAuthMarkModalDlg>::Create( pParent, rSh ); break; default: break; } - if ( pDlg ) + if ( pDlg.get() ) return new VclAbstractDialog_Impl( pDlg ); return 0; } AbstractSplitTableDialog * SwAbstractDialogFactory_Impl::CreateSplitTblDialog ( vcl::Window *pParent, SwWrtShell &rSh ) { - return new AbstractSplitTableDialog_Impl( new SwSplitTblDlg( pParent, rSh) ); + return new AbstractSplitTableDialog_Impl( VclPtr<SwSplitTblDlg>::Create( pParent, rSh) ); } AbstractSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg(vcl::Window * pParent, const OUString &rShortName) { - SwSelGlossaryDlg* pDlg = new SwSelGlossaryDlg(pParent, rShortName); + VclPtr<SwSelGlossaryDlg> pDlg = VclPtr<SwSelGlossaryDlg>::Create(pParent, rShortName); return new AbstractSwSelGlossaryDlg_Impl(pDlg); } AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg(vcl::Window* pParent, SwWrtShell* pShell, bool bSetAutoFmt, const SwTableAutoFmt* pSelFmt) { - SwAutoFormatDlg* pDlg = new SwAutoFormatDlg(pParent, pShell, bSetAutoFmt, pSelFmt); + VclPtr<SwAutoFormatDlg> pDlg = VclPtr<SwAutoFormatDlg>::Create(pParent, pShell, bSetAutoFmt, pSelFmt); return new AbstractSwAutoFormatDlg_Impl(pDlg); } SfxAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwBorderDlg(vcl::Window* pParent, SfxItemSet& rSet, sal_uInt16 nType, int nResId ) { - SfxModalDialog* pDlg=NULL; + VclPtr<SfxModalDialog> pDlg; switch ( nResId ) { case RC_DLG_SWBORDERDLG : - pDlg = new SwBorderDlg( pParent, rSet, nType ); + pDlg = VclPtr<SwBorderDlg>::Create( pParent, rSet, nType ); break; default: break; } - if ( pDlg ) + if ( pDlg.get() ) return new SwAbstractSfxDialog_Impl( pDlg ); return 0; } SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwWrapDlg ( vcl::Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, bool bDrawMode, int nResId ) { - SfxModalDialog* pDlg=NULL; + VclPtr<SfxModalDialog> pDlg; switch ( nResId ) { case RC_DLG_SWWRAPDLG : - pDlg = new SwWrapDlg( pParent, rSet, pSh, bDrawMode ); + pDlg = VclPtr<SwWrapDlg>::Create( pParent, rSet, pSh, bDrawMode ); break; default: break; } - if ( pDlg ) + if ( pDlg.get() ) return new SwAbstractSfxDialog_Impl( pDlg ); return 0; } VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg(vcl::Window *pParent, SwTableFUNC &rFnc) { - Dialog* pDlg = new SwTableWidthDlg(pParent, rFnc); + VclPtr<Dialog> pDlg = VclPtr<SwTableWidthDlg>::Create(pParent, rFnc); return new VclAbstractDialog_Impl( pDlg ); } SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTableTabDlg(vcl::Window* pParent, SfxItemPool& Pool, const SfxItemSet* pItemSet, SwWrtShell* pSh) { - SfxTabDialog* pDlg = new SwTableTabDlg(pParent, Pool, pItemSet, pSh); + VclPtr<SfxTabDialog> pDlg = VclPtr<SwTableTabDlg>::Create(pParent, Pool, pItemSet, pSh); return new AbstractTabDialog_Impl(pDlg); } AbstractSwFldDlg * SwAbstractDialogFactory_Impl::CreateSwFldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, vcl::Window *pParent) { - SwFldDlg* pDlg = new SwFldDlg(pB, pCW, pParent); + VclPtr<SwFldDlg> pDlg = VclPtr<SwFldDlg>::Create(pB, pCW, pParent); return new AbstractSwFldDlg_Impl(pDlg); } SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwFldEditDlg ( SwView& rVw, int nResId ) { - SfxModalDialog* pDlg=NULL; + VclPtr<SfxModalDialog> pDlg; switch ( nResId ) { case RC_DLG_SWFLDEDITDLG : - pDlg = new SwFldEditDlg( rVw ); + pDlg = VclPtr<SwFldEditDlg>::Create( rVw ); break; default: break; } - if ( pDlg ) + if ( pDlg.get() ) return new SwAbstractSfxDialog_Impl( pDlg ); return 0; } @@ -922,19 +921,19 @@ AbstractSwRenameXNamedDlg * SwAbstractDialogFactory_Impl::CreateSwRenameXNamedDl ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed, ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess) { - SwRenameXNamedDlg* pDlg = new SwRenameXNamedDlg( pParent,xNamed, xNameAccess); + VclPtr<SwRenameXNamedDlg> pDlg = VclPtr<SwRenameXNamedDlg>::Create( pParent,xNamed, xNameAccess); return new AbstractSwRenameXNamedDlg_Impl( pDlg ); } AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRedlineAcceptDlg(vcl::Window *pParent) { - SwModalRedlineAcceptDlg* pDlg = new SwModalRedlineAcceptDlg( pParent ); + VclPtr<SwModalRedlineAcceptDlg> pDlg = VclPtr<SwModalRedlineAcceptDlg>::Create( pParent ); return new AbstractSwModalRedlineAcceptDlg_Impl( pDlg ); } VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateTblMergeDialog(vcl::Window* pParent, bool& rWithPrev) { - Dialog* pDlg = new SwMergeTblDlg( pParent, rWithPrev ); + VclPtr<Dialog> pDlg = VclPtr<SwMergeTblDlg>::Create( pParent, rWithPrev ); return new VclAbstractDialog_Impl( pDlg ); } @@ -946,7 +945,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateFrmTabDialog(const OUS const OString& sDefPage, const OUString* pFmtStr ) { - SfxTabDialog* pDlg = new SwFrmDlg(pFrame, pParent, rCoreSet, bNewFrm, rDialogType, bFmt, sDefPage, pFmtStr); + VclPtr<SfxTabDialog> pDlg = VclPtr<SwFrmDlg>::Create(pFrame, pParent, rCoreSet, bNewFrm, rDialogType, bFmt, sDefPage, pFmtStr); return new AbstractTabDialog_Impl(pDlg); } @@ -958,7 +957,7 @@ SfxAbstractApplyTabDialog* SwAbstractDialogFactory_Impl::CreateTemplateDialog( SwWrtShell* pActShell, bool bNew ) { - SfxTabDialog* pDlg = new SwTemplateDlg( pParent, rBase, nRegion, sPage, pActShell, bNew ); + VclPtr<SfxTabDialog> pDlg = VclPtr<SwTemplateDlg>::Create( pParent, rBase, nRegion, sPage, pActShell, bNew ); return new AbstractApplyTabDialog_Impl( pDlg ); } @@ -966,46 +965,46 @@ AbstractGlossaryDlg* SwAbstractDialogFactory_Impl::CreateGlossaryDlg(SfxViewFram SwGlossaryHdl* pGlosHdl, SwWrtShell *pWrtShell) { - SwGlossaryDlg* pDlg = new SwGlossaryDlg(pViewFrame, pGlosHdl, pWrtShell); + VclPtr<SwGlossaryDlg> pDlg = VclPtr<SwGlossaryDlg>::Create(pViewFrame, pGlosHdl, pWrtShell); return new AbstractGlossaryDlg_Impl( pDlg ); } AbstractFldInputDlg* SwAbstractDialogFactory_Impl::CreateFldInputDlg(vcl::Window *pParent, SwWrtShell &rSh, SwField* pField, bool bNextButton) { - SwFldInputDlg* pDlg = new SwFldInputDlg( pParent, rSh, pField, bNextButton ); + VclPtr<SwFldInputDlg> pDlg = VclPtr<SwFldInputDlg>::Create( pParent, rSh, pField, bNextButton ); return new AbstractFldInputDlg_Impl( pDlg ); } AbstractInsFootNoteDlg* SwAbstractDialogFactory_Impl::CreateInsFootNoteDlg( vcl::Window * pParent, SwWrtShell &rSh, bool bEd ) { - SwInsFootNoteDlg* pDlg = new SwInsFootNoteDlg(pParent, rSh, bEd); + VclPtr<SwInsFootNoteDlg> pDlg = VclPtr<SwInsFootNoteDlg>::Create(pParent, rSh, bEd); return new AbstractInsFootNoteDlg_Impl( pDlg ); } VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateTitlePageDlg ( vcl::Window *pParent ) { - Dialog* pDlg = new SwTitlePageDlg( pParent ); + VclPtr<Dialog> pDlg = VclPtr<SwTitlePageDlg>::Create( pParent ); return new VclAbstractDialog_Impl( pDlg ); } VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclSwViewDialog(SwView& rView) { - Dialog* pDlg = new SwLineNumberingDlg( &rView ); + VclPtr<Dialog> pDlg = VclPtr<SwLineNumberingDlg>::Create( &rView ); return new VclAbstractDialog_Impl( pDlg ); } AbstractInsTableDlg * SwAbstractDialogFactory_Impl::CreateInsTableDlg(SwView& rView) { - SwInsTableDlg* pDlg = new SwInsTableDlg(rView); + VclPtr<SwInsTableDlg> pDlg = VclPtr<SwInsTableDlg>::Create(rView); return new AbstractInsTableDlg_Impl( pDlg ); } AbstractJavaEditDialog * SwAbstractDialogFactory_Impl::CreateJavaEditDialog( vcl::Window* pParent, SwWrtShell* pWrtSh) { - SwJavaEditDialog* pDlg = new SwJavaEditDialog(pParent, pWrtSh); + VclPtr<SwJavaEditDialog> pDlg = VclPtr<SwJavaEditDialog>::Create(pParent, pWrtSh); return new AbstractJavaEditDialog_Impl( pDlg ); } @@ -1017,35 +1016,35 @@ AbstractMailMergeDlg * SwAbstractDialogFactory_Impl::CreateMailMergeDlg( int nRe const uno::Reference< sdbc::XConnection>& xConnection, uno::Sequence< uno::Any >* pSelection ) { - SwMailMergeDlg* pDlg=NULL; + VclPtr<SwMailMergeDlg> pDlg; switch ( nResId ) { case DLG_MAILMERGE : - pDlg = new SwMailMergeDlg( pParent, rSh, rSourceName, rTblName, nCommandType, xConnection, pSelection ); + pDlg = VclPtr<SwMailMergeDlg>::Create( pParent, rSh, rSourceName, rTblName, nCommandType, xConnection, pSelection ); break; default: break; } - if ( pDlg ) + if ( pDlg.get() ) return new AbstractMailMergeDlg_Impl( pDlg ); return 0; } AbstractMailMergeCreateFromDlg * SwAbstractDialogFactory_Impl::CreateMailMergeCreateFromDlg(vcl::Window* pParent) { - SwMailMergeCreateFromDlg* pDlg = new SwMailMergeCreateFromDlg(pParent); + VclPtr<SwMailMergeCreateFromDlg> pDlg = VclPtr<SwMailMergeCreateFromDlg>::Create(pParent); return new AbstractMailMergeCreateFromDlg_Impl(pDlg); } AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent) { - SwMailMergeFieldConnectionsDlg* pDlg = new SwMailMergeFieldConnectionsDlg( pParent ); + VclPtr<SwMailMergeFieldConnectionsDlg> pDlg = VclPtr<SwMailMergeFieldConnectionsDlg>::Create( pParent ); return new AbstractMailMergeFieldConnectionsDlg_Impl( pDlg ); } VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg(vcl::Window* pParent, SwTOXMgr &rTOXMgr) { - Dialog* pDlg = new SwMultiTOXMarkDlg(pParent, rTOXMgr); + VclPtr<Dialog> pDlg = VclPtr<SwMultiTOXMarkDlg>::Create(pParent, rTOXMgr); return new VclAbstractDialog_Impl(pDlg); } @@ -1054,20 +1053,20 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTabDialog( int nResI const SfxItemSet* pSwItemSet, SwWrtShell & rWrtSh ) { - SfxTabDialog* pDlg=NULL; + VclPtr<SfxTabDialog> pDlg; switch ( nResId ) { case DLG_SVXTEST_NUM_BULLET : - pDlg = new SwSvxNumBulletTabDialog( pParent, pSwItemSet, rWrtSh ); + pDlg = VclPtr<SwSvxNumBulletTabDialog>::Create( pParent, pSwItemSet, rWrtSh ); break; case DLG_TAB_OUTLINE : - pDlg = new SwOutlineTabDialog( pParent, pSwItemSet, rWrtSh ); + pDlg = VclPtr<SwOutlineTabDialog>::Create( pParent, pSwItemSet, rWrtSh ); break; default: break; } - if ( pDlg ) + if ( pDlg.get() ) return new AbstractTabDialog_Impl( pDlg ); return 0; } @@ -1078,20 +1077,20 @@ AbstractMultiTOXTabDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXTabDialo SwTOXBase* pCurTOX, sal_uInt16 nToxType, bool bGlobal) { - SwMultiTOXTabDialog* pDlg = new SwMultiTOXTabDialog( pParent, rSet, rShell, pCurTOX, nToxType, bGlobal ); + VclPtr<SwMultiTOXTabDialog> pDlg = VclPtr<SwMultiTOXTabDialog>::Create( pParent, rSet, rShell, pCurTOX, nToxType, bGlobal ); return new AbstractMultiTOXTabDialog_Impl( pDlg ); } AbstractEditRegionDlg * SwAbstractDialogFactory_Impl::CreateEditRegionDlg(vcl::Window* pParent, SwWrtShell& rWrtSh) { - SwEditRegionDlg* pDlg = new SwEditRegionDlg( pParent, rWrtSh ); + VclPtr<SwEditRegionDlg> pDlg = VclPtr<SwEditRegionDlg>::Create( pParent, rWrtSh ); return new AbstractEditRegionDlg_Impl( pDlg ); } AbstractInsertSectionTabDialog * SwAbstractDialogFactory_Impl::CreateInsertSectionTabDialog( vcl::Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) { - SwInsertSectionTabDialog* pDlg = new SwInsertSectionTabDialog(pParent, rSet, rSh); + VclPtr<SwInsertSectionTabDialog> pDlg = VclPtr<SwInsertSectionTabDialog>::Create(pParent, rSet, rSh); return new AbstractInsertSectionTabDialog_Impl(pDlg); } @@ -1102,7 +1101,7 @@ AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateIndexMarkFloatDlg( SfxChildWinInfo* pInfo, bool bNew ) { - SwIndexMarkFloatDlg* pDlg = new SwIndexMarkFloatDlg(pBindings, pChild, pParent, pInfo, bNew); + VclPtr<SwIndexMarkFloatDlg> pDlg = VclPtr<SwIndexMarkFloatDlg>::Create(pBindings, pChild, pParent, pInfo, bNew); return new AbstractIndexMarkFloatDlg_Impl(pDlg); } @@ -1113,7 +1112,7 @@ AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDlg( SfxChildWinInfo* pInfo, bool bNew) { - SwAuthMarkFloatDlg* pDlg = new SwAuthMarkFloatDlg( pBindings, pChild, pParent, pInfo, bNew ); + VclPtr<SwAuthMarkFloatDlg> pDlg = VclPtr<SwAuthMarkFloatDlg>::Create( pBindings, pChild, pParent, pInfo, bNew ); return new AbstractAuthMarkFloatDlg_Impl( pDlg ); } @@ -1123,21 +1122,21 @@ AbstractSwWordCountFloatDlg * SwAbstractDialogFactory_Impl::CreateSwWordCountDia vcl::Window *pParent, SfxChildWinInfo* pInfo) { - SwWordCountFloatDlg* pDlg = new SwWordCountFloatDlg( pBindings, pChild, pParent, pInfo ); + VclPtr<SwWordCountFloatDlg> pDlg = VclPtr<SwWordCountFloatDlg>::Create( pBindings, pChild, pParent, pInfo ); return new AbstractSwWordCountFloatDlg_Impl( pDlg ); } VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg( vcl::Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark ) { - Dialog* pDlg = new SwIndexMarkModalDlg( pParent, rSh, pCurTOXMark ); + VclPtr<Dialog> pDlg = VclPtr<SwIndexMarkModalDlg>::Create( pParent, rSh, pCurTOXMark ); return new VclAbstractDialog_Impl( pDlg ); } AbstractMailMergeWizard* SwAbstractDialogFactory_Impl::CreateMailMergeWizard( SwView& rView, SwMailMergeConfigItem& rConfigItem) { - return new AbstractMailMergeWizard_Impl( new SwMailMergeWizard(rView, rConfigItem)); + return new AbstractMailMergeWizard_Impl( VclPtr<SwMailMergeWizard>::Create(rView, rConfigItem)); } GlossaryGetCurrGroup SwAbstractDialogFactory_Impl::GetGlossaryCurrGroupFunc() diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 9e6ff470c404..4ec9fa68ad33 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; \ + ScopedVclPtr<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..79aba4459af6 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() +{ + disposeOnce(); +} + +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 a0b3ac501966..41fbe2b8d3b9 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -404,11 +404,11 @@ bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox) if (!pRepr->GetTempPasswd().getLength() && pRepr->GetSectionData().GetPassword().getLength()) { - SfxPasswordDialog aPasswdDlg(this); + ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg(this); bRet = false; - if (aPasswdDlg.Execute()) + if (aPasswdDlg->Execute()) { - const OUString sNewPasswd( aPasswdDlg.GetPassword() ); + const OUString sNewPasswd( aPasswdDlg->GetPassword() ); ::com::sun::star::uno::Sequence <sal_Int8 > aNewPasswd; SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd ); if (SvPasswordHelper::CompareHashPassword( @@ -516,6 +516,11 @@ sal_uInt16 SwEditRegionDlg::FindArrPos(const SwSectionFmt* pFmt ) SwEditRegionDlg::~SwEditRegionDlg( ) { + disposeOnce(); +} + +void SwEditRegionDlg::dispose() +{ SvTreeListEntry* pEntry = m_pTree->First(); while( pEntry ) { @@ -524,6 +529,29 @@ SwEditRegionDlg::~SwEditRegionDlg( ) } 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(); } void SwEditRegionDlg::SelectSection(const OUString& rSectionName) @@ -1053,10 +1081,10 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl) aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); - SwSectionPropertyTabDialog aTabDlg(this, aSet, rSh); - if(RET_OK == aTabDlg.Execute()) + ScopedVclPtrInstance< SwSectionPropertyTabDialog > aTabDlg(this, aSet, rSh); + if(RET_OK == aTabDlg->Execute()) { - const SfxItemSet* pOutSet = aTabDlg.GetOutputItemSet(); + const SfxItemSet* pOutSet = aTabDlg->GetOutputItemSet(); if( pOutSet && pOutSet->Count() ) { const SfxPoolItem *pColItem, *pBrushItem, @@ -1232,12 +1260,12 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox ) { if(!pRepr->GetTempPasswd().getLength() || bChange) { - SfxPasswordDialog aPasswdDlg(this); - aPasswdDlg.ShowExtras(SfxShowExtras::CONFIRM); - if(RET_OK == aPasswdDlg.Execute()) + ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg(this); + aPasswdDlg->ShowExtras(SfxShowExtras::CONFIRM); + if(RET_OK == aPasswdDlg->Execute()) { - const OUString sNewPasswd( aPasswdDlg.GetPassword() ); - if( aPasswdDlg.GetConfirm() == sNewPasswd ) + const OUString sNewPasswd( aPasswdDlg->GetPassword() ); + if( aPasswdDlg->GetConfirm() == sNewPasswd ) { SvPasswordHelper::GetHashPassword( pRepr->GetTempPasswd(), sNewPasswd ); } @@ -1533,7 +1561,30 @@ SwInsertSectionTabPage::SwInsertSectionTabPage( SwInsertSectionTabPage::~SwInsertSectionTabPage() { + disposeOnce(); +} + +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(); } void SwInsertSectionTabPage::SetWrtShell(SwWrtShell& rSh) @@ -1635,10 +1686,10 @@ void SwInsertSectionTabPage::Reset( const SfxItemSet* ) { } -SfxTabPage* SwInsertSectionTabPage::Create( vcl::Window* pParent, - const SfxItemSet* rAttrSet) +VclPtr<SfxTabPage> SwInsertSectionTabPage::Create( vcl::Window* pParent, + const SfxItemSet* rAttrSet) { - return new SwInsertSectionTabPage(pParent, *rAttrSet); + return VclPtr<SwInsertSectionTabPage>::Create(pParent, *rAttrSet); } IMPL_LINK( SwInsertSectionTabPage, ChangeHideHdl, CheckBox *, pBox ) @@ -1670,12 +1721,12 @@ IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton ) { if(!m_aNewPasswd.getLength() || bChange) { - SfxPasswordDialog aPasswdDlg(this); - aPasswdDlg.ShowExtras(SfxShowExtras::CONFIRM); - if(RET_OK == aPasswdDlg.Execute()) + ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg(this); + aPasswdDlg->ShowExtras(SfxShowExtras::CONFIRM); + if(RET_OK == aPasswdDlg->Execute()) { - const OUString sNewPasswd( aPasswdDlg.GetPassword() ); - if( aPasswdDlg.GetConfirm() == sNewPasswd ) + const OUString sNewPasswd( aPasswdDlg->GetPassword() ); + if( aPasswdDlg->GetConfirm() == sNewPasswd ) { SvPasswordHelper::GetHashPassword( m_aNewPasswd, sNewPasswd ); } @@ -1835,6 +1886,32 @@ SwSectionFtnEndTabPage::SwSectionFtnEndTabPage( vcl::Window *pParent, SwSectionFtnEndTabPage::~SwSectionFtnEndTabPage() { + disposeOnce(); +} + +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 ) @@ -1975,10 +2052,10 @@ void SwSectionFtnEndTabPage::Reset( const SfxItemSet* rSet ) RES_END_AT_TXTEND, false ))); } -SfxTabPage* SwSectionFtnEndTabPage::Create( vcl::Window* pParent, - const SfxItemSet* rAttrSet) +VclPtr<SfxTabPage> SwSectionFtnEndTabPage::Create( vcl::Window* pParent, + const SfxItemSet* rAttrSet) { - return new SwSectionFtnEndTabPage(pParent, *rAttrSet); + return VclPtr<SwSectionFtnEndTabPage>::Create(pParent, *rAttrSet); } IMPL_LINK( SwSectionFtnEndTabPage, FootEndHdl, CheckBox *, pBox ) @@ -2096,6 +2173,15 @@ SwSectionIndentTabPage::SwSectionIndentTabPage(vcl::Window *pParent, const SfxIt SwSectionIndentTabPage::~SwSectionIndentTabPage() { + disposeOnce(); +} + +void SwSectionIndentTabPage::dispose() +{ + m_pBeforeMF.clear(); + m_pAfterMF.clear(); + m_pPreviewWin.clear(); + SfxTabPage::dispose(); } bool SwSectionIndentTabPage::FillItemSet( SfxItemSet* rSet) @@ -2137,9 +2223,9 @@ void SwSectionIndentTabPage::Reset( const SfxItemSet* rSet) IndentModifyHdl(0); } -SfxTabPage* SwSectionIndentTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet) +VclPtr<SfxTabPage> SwSectionIndentTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet) { - return new SwSectionIndentTabPage(pParent, *rAttrSet); + return VclPtr<SwSectionIndentTabPage>::Create(pParent, *rAttrSet); } void SwSectionIndentTabPage::SetWrtShell(SwWrtShell& rSh) diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx index 2a7392eee793..471309e2e92b 100644 --- a/sw/source/ui/dialog/wordcountdialog.cxx +++ b/sw/source/ui/dialog/wordcountdialog.cxx @@ -46,7 +46,26 @@ IMPL_LINK_NOARG(SwWordCountFloatDlg, CloseHdl) SwWordCountFloatDlg::~SwWordCountFloatDlg() { + disposeOnce(); +} + +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(); } namespace |