summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/acccfg.cxx31
-rw-r--r--cui/source/customize/cfg.cxx250
-rw-r--r--cui/source/customize/cfgutil.cxx13
-rw-r--r--cui/source/customize/eventdlg.cxx7
-rw-r--r--cui/source/customize/eventdlg.hxx3
-rw-r--r--cui/source/customize/macropg.cxx82
-rw-r--r--cui/source/customize/macropg_impl.hxx13
-rw-r--r--cui/source/customize/selector.cxx25
-rw-r--r--cui/source/dialogs/SpellDialog.cxx59
-rw-r--r--cui/source/dialogs/about.cxx23
-rw-r--r--cui/source/dialogs/colorpicker.cxx104
-rw-r--r--cui/source/dialogs/cuicharmap.cxx25
-rw-r--r--cui/source/dialogs/cuifmsearch.cxx45
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx120
-rw-r--r--cui/source/dialogs/cuigrfflt.cxx72
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx10
-rw-r--r--cui/source/dialogs/cuiimapwnd.cxx15
-rw-r--r--cui/source/dialogs/cuitbxform.cxx11
-rw-r--r--cui/source/dialogs/dlgname.cxx48
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx191
-rw-r--r--cui/source/dialogs/hldocntp.cxx31
-rw-r--r--cui/source/dialogs/hldoctp.cxx17
-rw-r--r--cui/source/dialogs/hlinettp.cxx23
-rw-r--r--cui/source/dialogs/hlmailtp.cxx16
-rw-r--r--cui/source/dialogs/hlmarkwn.cxx21
-rw-r--r--cui/source/dialogs/hltpbase.cxx30
-rw-r--r--cui/source/dialogs/hyphen.cxx15
-rw-r--r--cui/source/dialogs/iconcdlg.cxx46
-rw-r--r--cui/source/dialogs/insdlg.cxx54
-rw-r--r--cui/source/dialogs/insrc.cxx22
-rw-r--r--cui/source/dialogs/linkdlg.cxx24
-rw-r--r--cui/source/dialogs/multipat.cxx41
-rw-r--r--cui/source/dialogs/newtabledlg.cxx15
-rw-r--r--cui/source/dialogs/passwdomdlg.cxx30
-rw-r--r--cui/source/dialogs/pastedlg.cxx17
-rw-r--r--cui/source/dialogs/postdlg.cxx13
-rw-r--r--cui/source/dialogs/scriptdlg.cxx69
-rw-r--r--cui/source/dialogs/showcols.cxx11
-rw-r--r--cui/source/dialogs/splitcelldlg.cxx32
-rw-r--r--cui/source/dialogs/srchxtra.cxx32
-rw-r--r--cui/source/dialogs/thesdlg.cxx55
-rw-r--r--cui/source/dialogs/zoom.cxx23
-rw-r--r--cui/source/factory/cuiexp.cxx29
-rw-r--r--cui/source/factory/dlgfact.cxx163
-rw-r--r--cui/source/factory/dlgfact.hxx8
-rw-r--r--cui/source/factory/init.cxx2
-rw-r--r--cui/source/inc/ControlFocusHelper.hxx4
-rw-r--r--cui/source/inc/SpellDialog.hxx42
-rw-r--r--cui/source/inc/about.hxx16
-rw-r--r--cui/source/inc/acccfg.hxx27
-rw-r--r--cui/source/inc/align.hxx55
-rw-r--r--cui/source/inc/autocdlg.hxx141
-rw-r--r--cui/source/inc/backgrnd.hxx61
-rw-r--r--cui/source/inc/border.hxx69
-rw-r--r--cui/source/inc/cfg.hxx82
-rw-r--r--cui/source/inc/cfgutil.hxx4
-rw-r--r--cui/source/inc/chardlg.hxx194
-rw-r--r--cui/source/inc/connect.hxx28
-rw-r--r--cui/source/inc/cuicharmap.hxx24
-rw-r--r--cui/source/inc/cuifmsearch.hxx55
-rw-r--r--cui/source/inc/cuigaldlg.hxx78
-rw-r--r--cui/source/inc/cuigrfflt.hxx34
-rw-r--r--cui/source/inc/cuihyperdlg.hxx3
-rw-r--r--cui/source/inc/cuiimapwnd.hxx12
-rw-r--r--cui/source/inc/cuioptgenrl.hxx7
-rw-r--r--cui/source/inc/cuisrchdlg.hxx6
-rw-r--r--cui/source/inc/cuitabarea.hxx297
-rw-r--r--cui/source/inc/cuitabline.hxx117
-rw-r--r--cui/source/inc/cuitbxform.hxx4
-rw-r--r--cui/source/inc/dbregister.hxx14
-rw-r--r--cui/source/inc/dlgname.hxx30
-rw-r--r--cui/source/inc/dstribut.hxx28
-rw-r--r--cui/source/inc/grfpage.hxx45
-rw-r--r--cui/source/inc/hangulhanjadlg.hxx100
-rw-r--r--cui/source/inc/headertablistbox.hxx10
-rw-r--r--cui/source/inc/hldocntp.hxx13
-rw-r--r--cui/source/inc/hldoctp.hxx15
-rw-r--r--cui/source/inc/hlinettp.hxx23
-rw-r--r--cui/source/inc/hlmailtp.hxx13
-rw-r--r--cui/source/inc/hlmarkwn.hxx13
-rw-r--r--cui/source/inc/hltpbase.hxx15
-rw-r--r--cui/source/inc/hyphen.hxx17
-rw-r--r--cui/source/inc/iconcdlg.hxx32
-rw-r--r--cui/source/inc/insdlg.hxx55
-rw-r--r--cui/source/inc/insrc.hxx12
-rw-r--r--cui/source/inc/labdlg.hxx24
-rw-r--r--cui/source/inc/linkdlg.hxx21
-rw-r--r--cui/source/inc/macroass.hxx3
-rw-r--r--cui/source/inc/macropg.hxx1
-rw-r--r--cui/source/inc/measure.hxx37
-rw-r--r--cui/source/inc/multipat.hxx14
-rw-r--r--cui/source/inc/newtabledlg.hxx8
-rw-r--r--cui/source/inc/numfmt.hxx63
-rw-r--r--cui/source/inc/numpages.hxx168
-rw-r--r--cui/source/inc/optasian.hxx32
-rw-r--r--cui/source/inc/optdict.hxx29
-rw-r--r--cui/source/inc/optlingu.hxx40
-rw-r--r--cui/source/inc/optpath.hxx11
-rw-r--r--cui/source/inc/page.hxx63
-rw-r--r--cui/source/inc/paragrph.hxx140
-rw-r--r--cui/source/inc/passwdomdlg.hxx1
-rw-r--r--cui/source/inc/pastedlg.hxx9
-rw-r--r--cui/source/inc/postdlg.hxx15
-rw-r--r--cui/source/inc/radiobtnbox.hxx1
-rw-r--r--cui/source/inc/scriptdlg.hxx20
-rw-r--r--cui/source/inc/selector.hxx20
-rw-r--r--cui/source/inc/showcols.hxx6
-rw-r--r--cui/source/inc/splitcelldlg.hxx13
-rw-r--r--cui/source/inc/srchxtra.hxx17
-rw-r--r--cui/source/inc/swpossizetabpage.hxx55
-rw-r--r--cui/source/inc/tabstpge.hxx58
-rw-r--r--cui/source/inc/textanim.hxx39
-rw-r--r--cui/source/inc/textattr.hxx36
-rw-r--r--cui/source/inc/thesdlg.hxx24
-rw-r--r--cui/source/inc/transfrm.hxx69
-rw-r--r--cui/source/inc/treeopt.hxx12
-rw-r--r--cui/source/inc/zoom.hxx27
-rw-r--r--cui/source/options/certpath.cxx13
-rw-r--r--cui/source/options/certpath.hxx9
-rw-r--r--cui/source/options/connpooloptions.cxx20
-rw-r--r--cui/source/options/connpooloptions.hxx24
-rw-r--r--cui/source/options/cuisrchdlg.cxx16
-rw-r--r--cui/source/options/dbregister.cxx36
-rw-r--r--cui/source/options/doclinkdialog.cxx26
-rw-r--r--cui/source/options/doclinkdialog.hxx10
-rw-r--r--cui/source/options/fontsubs.cxx27
-rw-r--r--cui/source/options/fontsubs.hxx25
-rw-r--r--cui/source/options/optaboutconfig.cxx30
-rw-r--r--cui/source/options/optaboutconfig.hxx18
-rw-r--r--cui/source/options/optaccessibility.cxx20
-rw-r--r--cui/source/options/optaccessibility.hxx24
-rw-r--r--cui/source/options/optasian.cxx24
-rw-r--r--cui/source/options/optbasic.cxx16
-rw-r--r--cui/source/options/optbasic.hxx15
-rw-r--r--cui/source/options/optchart.cxx34
-rw-r--r--cui/source/options/optchart.hxx13
-rw-r--r--cui/source/options/optcolor.cxx157
-rw-r--r--cui/source/options/optcolor.hxx11
-rw-r--r--cui/source/options/optctl.cxx16
-rw-r--r--cui/source/options/optctl.hxx20
-rw-r--r--cui/source/options/optdict.cxx41
-rw-r--r--cui/source/options/optfltr.cxx42
-rw-r--r--cui/source/options/optfltr.hxx37
-rw-r--r--cui/source/options/optgdlg.cxx82
-rw-r--r--cui/source/options/optgdlg.hxx99
-rw-r--r--cui/source/options/optgenrl.cxx21
-rw-r--r--cui/source/options/opthtml.cxx28
-rw-r--r--cui/source/options/opthtml.hxx41
-rw-r--r--cui/source/options/optinet2.cxx91
-rw-r--r--cui/source/options/optinet2.hxx86
-rw-r--r--cui/source/options/optjava.cxx83
-rw-r--r--cui/source/options/optjava.hxx47
-rw-r--r--cui/source/options/optjsearch.cxx29
-rw-r--r--cui/source/options/optjsearch.hxx50
-rw-r--r--cui/source/options/optlingu.cxx78
-rw-r--r--cui/source/options/optmemory.cxx19
-rw-r--r--cui/source/options/optmemory.hxx17
-rw-r--r--cui/source/options/optopencl.cxx65
-rw-r--r--cui/source/options/optopencl.hxx43
-rw-r--r--cui/source/options/optpath.cxx31
-rw-r--r--cui/source/options/optsave.cxx33
-rw-r--r--cui/source/options/optsave.hxx41
-rw-r--r--cui/source/options/optupdt.cxx27
-rw-r--r--cui/source/options/optupdt.hxx23
-rw-r--r--cui/source/options/personalization.cxx45
-rw-r--r--cui/source/options/personalization.hxx37
-rw-r--r--cui/source/options/radiobtnbox.cxx4
-rw-r--r--cui/source/options/securityoptions.cxx13
-rw-r--r--cui/source/options/securityoptions.hxx17
-rw-r--r--cui/source/options/treeopt.cxx53
-rw-r--r--cui/source/options/tsaurls.cxx11
-rw-r--r--cui/source/options/tsaurls.hxx10
-rw-r--r--cui/source/options/webconninfo.cxx12
-rw-r--r--cui/source/options/webconninfo.hxx9
-rw-r--r--cui/source/tabpages/align.cxx36
-rw-r--r--cui/source/tabpages/autocdlg.cxx198
-rw-r--r--cui/source/tabpages/backgrnd.cxx66
-rw-r--r--cui/source/tabpages/border.cxx42
-rw-r--r--cui/source/tabpages/chardlg.cxx153
-rw-r--r--cui/source/tabpages/connect.cxx42
-rw-r--r--cui/source/tabpages/dstribut.cxx38
-rw-r--r--cui/source/tabpages/grfpage.cxx45
-rw-r--r--cui/source/tabpages/labdlg.cxx26
-rw-r--r--cui/source/tabpages/macroass.cxx32
-rw-r--r--cui/source/tabpages/measure.cxx41
-rw-r--r--cui/source/tabpages/numfmt.cxx52
-rw-r--r--cui/source/tabpages/numpages.cxx154
-rw-r--r--cui/source/tabpages/page.cxx42
-rw-r--r--cui/source/tabpages/paragrph.cxx99
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx45
-rw-r--r--cui/source/tabpages/tabarea.cxx4
-rw-r--r--cui/source/tabpages/tabline.cxx6
-rw-r--r--cui/source/tabpages/tabstpge.cxx41
-rw-r--r--cui/source/tabpages/textanim.cxx34
-rw-r--r--cui/source/tabpages/textattr.cxx37
-rw-r--r--cui/source/tabpages/tparea.cxx82
-rw-r--r--cui/source/tabpages/tpbitmap.cxx55
-rw-r--r--cui/source/tabpages/tpcolor.cxx79
-rw-r--r--cui/source/tabpages/tpgradnt.cxx58
-rw-r--r--cui/source/tabpages/tphatch.cxx51
-rw-r--r--cui/source/tabpages/tpline.cxx67
-rw-r--r--cui/source/tabpages/tplnedef.cxx62
-rw-r--r--cui/source/tabpages/tplneend.cxx63
-rw-r--r--cui/source/tabpages/tpshadow.cxx23
-rw-r--r--cui/source/tabpages/transfrm.cxx76
205 files changed, 5842 insertions, 2833 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 05aa1343d5c8..40360a67a398 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -672,6 +672,17 @@ void SfxAccCfgTabListBox_Impl::InitEntry(SvTreeListEntry* pEntry,
SvTabListBox::InitEntry(pEntry, rText, rImage1, rImage2, eButtonKind);
}
+SfxAccCfgTabListBox_Impl::~SfxAccCfgTabListBox_Impl()
+{
+ disposeOnce();
+}
+
+void SfxAccCfgTabListBox_Impl::dispose()
+{
+ m_pAccelConfigPage.clear();
+ SvTabListBox::dispose();
+}
+
/** select the entry, which match the current key input ... excepting
keys, which are used for the dialog itself.
*/
@@ -800,6 +811,11 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( vcl::Window* pParent, const
SfxAcceleratorConfigPage::~SfxAcceleratorConfigPage()
{
+ disposeOnce();
+}
+
+void SfxAcceleratorConfigPage::dispose()
+{
// free memory - remove all dynamic user data
SvTreeListEntry* pEntry = m_pEntriesBox->First();
while (pEntry)
@@ -823,6 +839,21 @@ SfxAcceleratorConfigPage::~SfxAcceleratorConfigPage()
m_pKeyBox->Clear();
delete m_pFileDlg;
+ m_pFileDlg = NULL;
+
+ m_pEntriesBox.clear();
+ m_pOfficeButton.clear();
+ m_pModuleButton.clear();
+ m_pChangeButton.clear();
+ m_pRemoveButton.clear();
+ m_pGroupLBox.clear();
+ m_pFunctionBox.clear();
+ m_pKeyBox.clear();
+ m_pLoadButton.clear();
+ m_pSaveButton.clear();
+ m_pResetButton.clear();
+
+ SfxTabPage::dispose();
}
void SfxAcceleratorConfigPage::InitAccCfg()
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index aa1cd010af66..96ed1acc96b5 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -735,24 +735,24 @@ ConvertToolbarEntry(
return aPropSeq;
}
-SfxTabPage *CreateSvxMenuConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> CreateSvxMenuConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
{
- return new SvxMenuConfigPage( pParent, *rSet );
+ return VclPtr<SvxMenuConfigPage>::Create( pParent, *rSet );
}
-SfxTabPage *CreateKeyboardConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> CreateKeyboardConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
{
- return new SfxAcceleratorConfigPage( pParent, *rSet );
+ return VclPtr<SfxAcceleratorConfigPage>::Create( pParent, *rSet );
}
-SfxTabPage *CreateSvxToolbarConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> CreateSvxToolbarConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
{
- return new SvxToolbarConfigPage( pParent, *rSet );
+ return VclPtr<SvxToolbarConfigPage>::Create( pParent, *rSet );
}
-SfxTabPage *CreateSvxEventConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> CreateSvxEventConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
{
- return new SvxEventConfigPage( pParent, *rSet, SvxEventConfigPage::EarlyInit() );
+ return VclPtr<SvxEventConfigPage>::Create( pParent, *rSet, SvxEventConfigPage::EarlyInit() );
}
namespace {
@@ -1397,7 +1397,13 @@ SvxMenuEntriesListBox::SvxMenuEntriesListBox(vcl::Window* pParent, SvxConfigPage
SvxMenuEntriesListBox::~SvxMenuEntriesListBox()
{
- // do nothing
+ disposeOnce();
+}
+
+void SvxMenuEntriesListBox::dispose()
+{
+ pPage.clear();
+ SvTreeListBox::dispose();
}
// drag and drop support
@@ -1547,6 +1553,32 @@ SvxConfigPage::SvxConfigPage(vcl::Window *pParent, const SfxItemSet& rSet)
m_pDescriptionField->EnableCursor( false );
}
+SvxConfigPage::~SvxConfigPage()
+{
+ disposeOnce();
+}
+
+void SvxConfigPage::dispose()
+{
+ m_pTopLevel.clear();
+ m_pTopLevelLabel.clear();
+ m_pTopLevelListBox.clear();
+ m_pNewTopLevelButton.clear();
+ m_pModifyTopLevelButton.clear();
+ m_pContents.clear();
+ m_pContentsLabel.clear();
+ m_pEntries.clear();
+ m_pContentsListBox.disposeAndClear();
+ m_pAddCommandsButton.clear();
+ m_pModifyCommandButton.clear();
+ m_pMoveUpButton.clear();
+ m_pMoveDownButton.clear();
+ m_pSaveInListBox.clear();
+ m_pDescriptionField.clear();
+ m_pSelectorDlg.disposeAndClear();
+ SfxTabPage::dispose();
+}
+
void SvxConfigPage::Reset( const SfxItemSet* )
{
// If we haven't initialised our XMultiServiceFactory reference
@@ -2174,7 +2206,7 @@ bool SvxConfigPage::MoveEntryData(
SvxMenuConfigPage::SvxMenuConfigPage(vcl::Window *pParent, const SfxItemSet& rSet)
: SvxConfigPage(pParent, rSet)
{
- m_pContentsListBox = new SvxMenuEntriesListBox(m_pEntries, this);
+ m_pContentsListBox = VclPtr<SvxMenuEntriesListBox>::Create(m_pEntries, this);
m_pContentsListBox->set_grid_left_attach(0);
m_pContentsListBox->set_grid_top_attach(0);
m_pContentsListBox->set_hexpand(true);
@@ -2211,6 +2243,11 @@ SvxMenuConfigPage::SvxMenuConfigPage(vcl::Window *pParent, const SfxItemSet& rSe
LINK( this, SvxMenuConfigPage, EntrySelectHdl ) );
}
+SvxMenuConfigPage::~SvxMenuConfigPage()
+{
+ disposeOnce();
+}
+
// Populates the Menu combo box
void SvxMenuConfigPage::Init()
{
@@ -2224,7 +2261,7 @@ void SvxMenuConfigPage::Init()
m_pTopLevelListBox->GetSelectHdl().Call(this);
}
-SvxMenuConfigPage::~SvxMenuConfigPage()
+void SvxMenuConfigPage::dispose()
{
for ( sal_uInt16 i = 0 ; i < m_pSaveInListBox->GetEntryCount(); ++i )
{
@@ -2233,9 +2270,11 @@ SvxMenuConfigPage::~SvxMenuConfigPage()
delete pData;
}
+ m_pSaveInListBox->Clear();
- delete m_pSelectorDlg;
- delete m_pContentsListBox;
+ m_pSelectorDlg.clear();
+ m_pContentsListBox.clear();
+ SvxConfigPage::dispose();
}
IMPL_LINK( SvxMenuConfigPage, SelectMenuEntry, Control *, pBox )
@@ -2354,9 +2393,9 @@ short SvxMenuConfigPage::QueryReset()
OUString label = replaceSaveInName( msg, saveInName );
- QueryBox qbox( this, WB_YES_NO, label );
+ ScopedVclPtrInstance<QueryBox> qbox( this, WB_YES_NO, label );
- return qbox.Execute();
+ return qbox->Execute();
}
IMPL_LINK( SvxMenuConfigPage, SelectMenu, ListBox *, pBox )
@@ -2404,7 +2443,7 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton )
OUString aNewName( stripHotKey( pMenuData->GetName() ) );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- boost::scoped_ptr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_MENU ) );
@@ -2421,8 +2460,8 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton )
{
SvxConfigEntry* pMenuData = GetTopLevelSelection();
- boost::scoped_ptr<SvxMainMenuOrganizerDialog> pDialog(
- new SvxMainMenuOrganizerDialog( this,
+ VclPtr<SvxMainMenuOrganizerDialog> pDialog(
+ VclPtr<SvxMainMenuOrganizerDialog>::Create( this,
GetSaveInData()->GetEntries(), pMenuData ));
if ( pDialog->Execute() == RET_OK )
@@ -2447,7 +2486,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
OUString aNewName;
OUString aDesc = CUI_RESSTR( RID_SVXSTR_SUBMENU_NAME );
- boost::scoped_ptr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_NAME_SUBMENU );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_ADD_SUBMENU ) );
@@ -2484,7 +2523,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
OUString aNewName( stripHotKey( pEntry->GetName() ) );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- boost::scoped_ptr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU_ITEM );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_MENU ) );
@@ -2524,9 +2563,8 @@ IMPL_LINK( SvxMenuConfigPage, NewMenuHdl, Button *, pButton )
{
(void)pButton;
- boost::scoped_ptr<SvxMainMenuOrganizerDialog> pDialog(
- new SvxMainMenuOrganizerDialog( 0,
- GetSaveInData()->GetEntries(), NULL, true ));
+ VclPtrInstance<SvxMainMenuOrganizerDialog> pDialog(
+ nullptr, GetSaveInData()->GetEntries(), nullptr, true );
if ( pDialog->Execute() == RET_OK )
{
@@ -2542,10 +2580,10 @@ IMPL_LINK( SvxMenuConfigPage, AddCommandsHdl, Button *, pButton )
{
(void)pButton;
- if ( m_pSelectorDlg == NULL )
+ if ( m_pSelectorDlg == nullptr )
{
// Create Script Selector which also shows builtin commands
- m_pSelectorDlg = new SvxScriptSelectorDialog( this, true, m_xFrame );
+ m_pSelectorDlg = VclPtr<SvxScriptSelectorDialog>::Create( this, true, m_xFrame );
m_pSelectorDlg->SetAddHdl(
LINK( this, SvxMenuConfigPage, AddFunctionHdl ) );
@@ -2655,6 +2693,21 @@ SvxMainMenuOrganizerDialog::SvxMainMenuOrganizerDialog(
LINK( this, SvxMainMenuOrganizerDialog, MoveHdl) );
}
+SvxMainMenuOrganizerDialog::~SvxMainMenuOrganizerDialog()
+{
+ disposeOnce();
+}
+
+void SvxMainMenuOrganizerDialog::dispose()
+{
+ m_pMenuBox.clear();
+ m_pMenuNameEdit.clear();
+ m_pMenuListBox.clear();
+ m_pMoveUpButton.clear();
+ m_pMoveDownButton.clear();
+ ModalDialog::dispose();
+}
+
IMPL_LINK(SvxMainMenuOrganizerDialog, ModifyHdl, Edit*, pEdit)
{
(void)pEdit;
@@ -2675,10 +2728,6 @@ IMPL_LINK(SvxMainMenuOrganizerDialog, ModifyHdl, Edit*, pEdit)
return 0;
}
-SvxMainMenuOrganizerDialog::~SvxMainMenuOrganizerDialog()
-{
-}
-
IMPL_LINK( SvxMainMenuOrganizerDialog, SelectHdl, Control*, pCtrl )
{
(void)pCtrl;
@@ -2838,7 +2887,7 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(vcl::Window *pParent, const SfxItemSe
{
SetHelpId( HID_SVX_CONFIG_TOOLBAR );
- m_pContentsListBox = new SvxToolbarEntriesListBox(m_pEntries, this);
+ m_pContentsListBox = VclPtr<SvxToolbarEntriesListBox>::Create(m_pEntries, this);
m_pContentsListBox->set_grid_left_attach(0);
m_pContentsListBox->set_grid_top_attach(0);
m_pContentsListBox->set_hexpand(true);
@@ -2916,6 +2965,11 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(vcl::Window *pParent, const SfxItemSe
SvxToolbarConfigPage::~SvxToolbarConfigPage()
{
+ disposeOnce();
+}
+
+void SvxToolbarConfigPage::dispose()
+{
for ( sal_uInt16 i = 0 ; i < m_pSaveInListBox->GetEntryCount(); ++i )
{
ToolbarSaveInData* pData =
@@ -2923,14 +2977,11 @@ SvxToolbarConfigPage::~SvxToolbarConfigPage()
delete pData;
}
+ m_pSaveInListBox->Clear();
- if ( m_pSelectorDlg != NULL )
- {
- delete m_pSelectorDlg;
- }
-
-
- delete m_pContentsListBox;
+ m_pSelectorDlg.disposeAndClear();
+ m_pContentsListBox.disposeAndClear();
+ SvxConfigPage::dispose();
}
void SvxToolbarConfigPage::DeleteSelectedTopLevel()
@@ -2993,10 +3044,10 @@ bool SvxToolbarConfigPage::DeleteSelectedContent()
if ( m_pContentsListBox->GetEntryCount() == 0 &&
GetTopLevelSelection()->IsDeletable() )
{
- MessageDialog qbox(this,
+ ScopedVclPtrInstance<MessageDialog> qbox(this,
CUI_RES(RID_SXVSTR_CONFIRM_DELETE_TOOLBAR), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( qbox.Execute() == RET_YES )
+ if ( qbox->Execute() == RET_YES )
{
DeleteSelectedTopLevel();
}
@@ -3051,7 +3102,7 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton )
OUString aNewName( stripHotKey( pToolbar->GetName() ) );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- boost::scoped_ptr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
@@ -3073,10 +3124,10 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton )
}
case ID_DEFAULT_STYLE:
{
- MessageDialog qbox(this,
+ ScopedVclPtrInstance<MessageDialog> qbox(this,
CUI_RES(RID_SVXSTR_CONFIRM_RESTORE_DEFAULT), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( qbox.Execute() == RET_YES )
+ if ( qbox->Execute() == RET_YES )
{
ToolbarSaveInData* pSaveInData_ =
static_cast<ToolbarSaveInData*>(GetSaveInData());
@@ -3137,7 +3188,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton )
OUString aNewName( stripHotKey( pEntry->GetName() ) );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- boost::scoped_ptr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR_ITEM );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
@@ -3267,8 +3318,8 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton )
}
}
- boost::scoped_ptr<SvxIconSelectorDialog> pIconDialog(
- new SvxIconSelectorDialog( 0,
+ VclPtr<SvxIconSelectorDialog> pIconDialog(
+ VclPtr<SvxIconSelectorDialog>::Create( nullptr,
GetSaveInData()->GetImageManager(),
GetSaveInData()->GetParentImageManager() ));
@@ -4304,9 +4355,9 @@ short SvxToolbarConfigPage::QueryReset()
OUString label = replaceSaveInName( msg, saveInName );
- QueryBox qbox( this, WB_YES_NO, label );
+ ScopedVclPtrInstance< QueryBox > qbox( this, WB_YES_NO, label );
- return qbox.Execute();
+ return qbox->Execute();
}
IMPL_LINK( SvxToolbarConfigPage, SelectToolbar, ListBox *, pBox )
@@ -4395,7 +4446,7 @@ IMPL_LINK( SvxToolbarConfigPage, NewToolbarHdl, Button *, pButton )
OUString aNewURL =
generateCustomURL( GetSaveInData()->GetEntries() );
- boost::scoped_ptr<SvxNewToolbarDialog> pNameDialog(new SvxNewToolbarDialog( 0, aNewName ));
+ VclPtrInstance< SvxNewToolbarDialog > pNameDialog( nullptr, aNewName );
sal_uInt16 nInsertPos;
for ( sal_uInt16 i = 0 ; i < m_pSaveInListBox->GetEntryCount(); ++i )
@@ -4450,10 +4501,10 @@ IMPL_LINK( SvxToolbarConfigPage, AddCommandsHdl, Button *, pButton )
{
(void)pButton;
- if ( m_pSelectorDlg == NULL )
+ if ( m_pSelectorDlg == nullptr )
{
// Create Script Selector which shows slot commands
- m_pSelectorDlg = new SvxScriptSelectorDialog( this, true, m_xFrame );
+ m_pSelectorDlg = VclPtr<SvxScriptSelectorDialog>::Create( this, true, m_xFrame );
// Position the Script Selector over the Add button so it is
// beside the menu contents list and does not obscure it
@@ -4522,7 +4573,16 @@ SvxToolbarEntriesListBox::SvxToolbarEntriesListBox(vcl::Window* pParent, SvxTool
SvxToolbarEntriesListBox::~SvxToolbarEntriesListBox()
{
+ disposeOnce();
+}
+
+void SvxToolbarEntriesListBox::dispose()
+{
delete m_pButtonData;
+ m_pButtonData = NULL;
+
+ pPage.clear();
+ SvxMenuEntriesListBox::dispose();
}
void SvxToolbarEntriesListBox::BuildCheckBoxButtonImages( SvLBoxButtonData* pData )
@@ -4532,28 +4592,28 @@ void SvxToolbarEntriesListBox::BuildCheckBoxButtonImages( SvLBoxButtonData* pDat
// in all color modes, like high contrast.
const AllSettings& rSettings = Application::GetSettings();
- VirtualDevice aDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
Size aSize( 26, 20 );
- aDev.SetOutputSizePixel( aSize );
+ pVDev->SetOutputSizePixel( aSize );
- Image aImage = GetSizedImage( aDev, aSize,
+ Image aImage = GetSizedImage( *pVDev.get(), aSize,
CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT ));
// Fill button data struct with new images
pData->SetImage(SvBmp::UNCHECKED, aImage);
- pData->SetImage(SvBmp::CHECKED, GetSizedImage( aDev, aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED )) );
- pData->SetImage(SvBmp::HICHECKED, GetSizedImage( aDev, aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED | BUTTON_DRAW_PRESSED )) );
- pData->SetImage(SvBmp::HIUNCHECKED, GetSizedImage( aDev, aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT | BUTTON_DRAW_PRESSED)) );
- pData->SetImage(SvBmp::TRISTATE, GetSizedImage( aDev, aSize, Image() ) ); // Use tristate bitmaps to have no checkbox for separator entries
- pData->SetImage(SvBmp::HITRISTATE, GetSizedImage( aDev, aSize, Image() ) );
+ pData->SetImage(SvBmp::CHECKED, GetSizedImage( *pVDev.get(), aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED )) );
+ pData->SetImage(SvBmp::HICHECKED, GetSizedImage( *pVDev.get(), aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED | BUTTON_DRAW_PRESSED )) );
+ pData->SetImage(SvBmp::HIUNCHECKED, GetSizedImage( *pVDev.get(), aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT | BUTTON_DRAW_PRESSED)) );
+ pData->SetImage(SvBmp::TRISTATE, GetSizedImage( *pVDev.get(), aSize, Image() ) ); // Use tristate bitmaps to have no checkbox for separator entries
+ pData->SetImage(SvBmp::HITRISTATE, GetSizedImage( *pVDev.get(), aSize, Image() ) );
// Get image size
m_aCheckBoxImageSizePixel = aImage.GetSizePixel();
}
Image SvxToolbarEntriesListBox::GetSizedImage(
- VirtualDevice& aDev, const Size& aNewSize, const Image& aImage )
+ VirtualDevice& rVDev, const Size& aNewSize, const Image& aImage )
{
// Create new checkbox images for treelistbox. They must have a
// decent width to have a clear column for the visibility checkbox.
@@ -4567,18 +4627,18 @@ Image SvxToolbarEntriesListBox::GetSizedImage(
sal_uInt16 nPosX = std::max( (sal_uInt16) (((( aNewSize.Width() - 2 ) - aImage.GetSizePixel().Width() ) / 2 ) - 1), (sal_uInt16) 0 );
sal_uInt16 nPosY = std::max( (sal_uInt16) (((( aNewSize.Height() - 2 ) - aImage.GetSizePixel().Height() ) / 2 ) + 1), (sal_uInt16) 0 );
Point aPos( nPosX > 0 ? nPosX : 0, nPosY > 0 ? nPosY : 0 );
- aDev.SetFillColor( aFillColor );
- aDev.SetLineColor( aFillColor );
- aDev.DrawRect( Rectangle( Point(), aNewSize ));
- aDev.DrawImage( aPos, aImage );
+ rVDev.SetFillColor( aFillColor );
+ rVDev.SetLineColor( aFillColor );
+ rVDev.DrawRect( Rectangle( Point(), aNewSize ));
+ rVDev.DrawImage( aPos, aImage );
// Draw separator line 2 pixels left from the right border
Color aLineColor = GetDisplayBackground().GetColor().IsDark() ? Color( COL_WHITE ) : Color( COL_BLACK );
- aDev.SetLineColor( aLineColor );
- aDev.DrawLine( Point( aNewSize.Width()-3, 0 ), Point( aNewSize.Width()-3, aNewSize.Height()-1 ));
+ rVDev.SetLineColor( aLineColor );
+ rVDev.DrawLine( Point( aNewSize.Width()-3, 0 ), Point( aNewSize.Width()-3, aNewSize.Height()-1 ));
// Create new image that uses the fillcolor as transparent
- return Image( aDev.GetBitmap( Point(), aNewSize ), aFillColor );
+ return Image( rVDev.GetBitmap( Point(), aNewSize ), aFillColor );
}
void SvxToolbarEntriesListBox::DataChanged( const DataChangedEvent& rDCEvt )
@@ -4673,7 +4733,7 @@ TriState SvxToolbarEntriesListBox::NotifyCopying(
if ( !m_bIsInternalDrag )
{
// if the target is NULL then add function to the start of the list
- static_cast<SvxToolbarConfigPage*>(pPage)->AddFunction( pTarget, pTarget == NULL );
+ static_cast<SvxToolbarConfigPage*>(pPage.get())->AddFunction( pTarget, pTarget == NULL );
// Instant Apply changes to UI
SvxConfigEntry* pToolbar = pPage->GetTopLevelSelection();
@@ -4705,6 +4765,20 @@ SvxNewToolbarDialog::SvxNewToolbarDialog(vcl::Window* pWindow, const OUString& r
m_pEdtName->SetModifyHdl(LINK(this, SvxNewToolbarDialog, ModifyHdl));
}
+SvxNewToolbarDialog::~SvxNewToolbarDialog()
+{
+ disposeOnce();
+}
+
+void SvxNewToolbarDialog::dispose()
+{
+ m_pEdtName.clear();
+ m_pBtnOK.clear();
+ m_pSaveInListBox.clear();
+ ModalDialog::dispose();
+}
+
+
IMPL_LINK(SvxNewToolbarDialog, ModifyHdl, Edit*, pEdit)
{
(void)pEdit;
@@ -4906,20 +4980,32 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( vcl::Window *pWindow,
SvxIconSelectorDialog::~SvxIconSelectorDialog()
{
- sal_uInt16 nCount = pTbSymbol->GetItemCount();
+ disposeOnce();
+}
- for (sal_uInt16 n = 0; n < nCount; ++n )
+void SvxIconSelectorDialog::dispose()
+{
+ if (pTbSymbol)
{
- sal_uInt16 nId = pTbSymbol->GetItemId(n);
-
- uno::XInterface* xi = static_cast< uno::XInterface* >(
- pTbSymbol->GetItemData( nId ) );
+ sal_uInt16 nCount = pTbSymbol->GetItemCount();
- if ( xi != NULL )
+ for (sal_uInt16 n = 0; n < nCount; ++n )
{
+ sal_uInt16 nId = pTbSymbol->GetItemId(n);
+
+ uno::XInterface* xi = static_cast< uno::XInterface* >(
+ pTbSymbol->GetItemData( nId ) );
+
+ if ( xi != NULL )
xi->release();
}
}
+
+ pTbSymbol.clear();
+ pFtNote.clear();
+ pBtnImport.clear();
+ pBtnDelete.clear();
+ ModalDialog::dispose();
}
uno::Reference< graphic::XGraphic> SvxIconSelectorDialog::GetSelectedIcon()
@@ -5211,8 +5297,8 @@ void SvxIconSelectorDialog::ImportGraphics(
message += newLine;
}
- SvxIconChangeDialog aDialog(this, message);
- aDialog.Execute();
+ ScopedVclPtrInstance< SvxIconChangeDialog > aDialog(this, message);
+ aDialog->Execute();
}
}
@@ -5364,4 +5450,16 @@ SvxIconChangeDialog::SvxIconChangeDialog(
pLineEditDescription->SetText(aMessage);
}
+SvxIconChangeDialog::~SvxIconChangeDialog()
+{
+ disposeOnce();
+}
+
+void SvxIconChangeDialog::dispose()
+{
+ pFImageInfo.clear();
+ pLineEditDescription.clear();
+ ModalDialog::dispose();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 53c954415098..875b71b57fe3 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -276,7 +276,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSfxConfigFunctionListB
SfxConfigFunctionListBox::~SfxConfigFunctionListBox()
{
+ disposeOnce();
+}
+
+void SfxConfigFunctionListBox::dispose()
+{
ClearAll();
+ SvTreeListBox::dispose();
}
void SfxConfigFunctionListBox::MouseMove( const MouseEvent& )
@@ -423,7 +429,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSfxConfigGroupListBox(
SfxConfigGroupListBox::~SfxConfigGroupListBox()
{
+ disposeOnce();
+}
+
+void SfxConfigGroupListBox::dispose()
+{
ClearAll();
+ pFunctionListBox.clear();
+ SvTreeListBox::dispose();
}
void SfxConfigGroupListBox::ClearAll()
diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx
index e466d526a747..20e00dedd7a1 100644
--- a/cui/source/customize/eventdlg.cxx
+++ b/cui/source/customize/eventdlg.cxx
@@ -103,6 +103,11 @@ void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFra
SvxEventConfigPage::~SvxEventConfigPage()
{
+ disposeOnce();
+}
+
+void SvxEventConfigPage::dispose()
+{
// need to delete the user data
SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
SvTreeListEntry* pE = rListBox.GetEntry( 0 );
@@ -113,6 +118,8 @@ SvxEventConfigPage::~SvxEventConfigPage()
pE->SetUserData((void*)0);
pE = SvTreeListBox::NextSibling( pE );
}
+ m_pSaveInListBox.clear();
+ _SvxMacroTabPage::dispose();
}
void SvxEventConfigPage::ImplInitDocument()
diff --git a/cui/source/customize/eventdlg.hxx b/cui/source/customize/eventdlg.hxx
index 06d5433fa67b..385df86d1bbb 100644
--- a/cui/source/customize/eventdlg.hxx
+++ b/cui/source/customize/eventdlg.hxx
@@ -29,7 +29,7 @@
class SvxEventConfigPage : public _SvxMacroTabPage
{
- ListBox* m_pSaveInListBox;
+ VclPtr<ListBox> m_pSaveInListBox;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xAppEvents;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xDocumentEvents;
@@ -48,6 +48,7 @@ public:
struct EarlyInit { };
SvxEventConfigPage( vcl::Window *pParent, const SfxItemSet& rSet, EarlyInit );
virtual ~SvxEventConfigPage();
+ virtual void dispose() SAL_OVERRIDE;
void LateInit( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame );
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index dec5a9fb3e6b..fc5194af6567 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -83,32 +83,32 @@ static long nTabs[] =
IMPL_LINK( MacroEventListBox, HeaderEndDrag_Impl, HeaderBar*, pBar )
{
- DBG_ASSERT( pBar == &maHeaderBar, "*MacroEventListBox::HeaderEndDrag_Impl: something is wrong here..." );
+ DBG_ASSERT( pBar == maHeaderBar.get(), "*MacroEventListBox::HeaderEndDrag_Impl: something is wrong here..." );
(void)pBar;
- if( !maHeaderBar.GetCurItemId() )
+ if( !maHeaderBar->GetCurItemId() )
return 0;
- if( !maHeaderBar.IsItemMode() )
+ if( !maHeaderBar->IsItemMode() )
{
Size aSz;
- sal_uInt16 _nTabs = maHeaderBar.GetItemCount();
- long nWidth = maHeaderBar.GetItemSize( ITEMID_EVENT );
- long nBarWidth = maHeaderBar.GetSizePixel().Width();
+ sal_uInt16 _nTabs = maHeaderBar->GetItemCount();
+ long nWidth = maHeaderBar->GetItemSize( ITEMID_EVENT );
+ long nBarWidth = maHeaderBar->GetSizePixel().Width();
if( nWidth < TAB_WIDTH_MIN )
- maHeaderBar.SetItemSize( ITEMID_EVENT, TAB_WIDTH_MIN );
+ maHeaderBar->SetItemSize( ITEMID_EVENT, TAB_WIDTH_MIN );
else if( ( nBarWidth - nWidth ) < TAB_WIDTH_MIN )
- maHeaderBar.SetItemSize( ITEMID_EVENT, nBarWidth - TAB_WIDTH_MIN );
+ maHeaderBar->SetItemSize( ITEMID_EVENT, nBarWidth - TAB_WIDTH_MIN );
{
long nTmpSz = 0;
for( sal_uInt16 i = 1 ; i < _nTabs ; ++i )
{
- long _nWidth = maHeaderBar.GetItemSize( i );
+ long _nWidth = maHeaderBar->GetItemSize( i );
aSz.Width() = _nWidth + nTmpSz;
nTmpSz += _nWidth;
- maListBox.SetTab( i, PixelToLogic( aSz, MapMode( MAP_APPFONT ) ).Width(), MAP_APPFONT );
+ maListBox->SetTab( i, PixelToLogic( aSz, MapMode( MAP_APPFONT ) ).Width(), MAP_APPFONT );
}
}
}
@@ -121,8 +121,8 @@ bool MacroEventListBox::Notify( NotifyEvent& rNEvt )
if( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
{
- if ( rNEvt.GetWindow() != &maListBox )
- maListBox.GrabFocus();
+ if ( rNEvt.GetWindow() != maListBox.get() )
+ maListBox->GrabFocus();
}
return nRet;
@@ -130,13 +130,25 @@ bool MacroEventListBox::Notify( NotifyEvent& rNEvt )
MacroEventListBox::MacroEventListBox( vcl::Window* pParent, WinBits nStyle )
: Control( pParent, nStyle )
- , maHeaderBar( this, WB_BUTTONSTYLE | WB_BOTTOMBORDER )
- , maListBox( this, WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP )
+ , maHeaderBar( VclPtr<HeaderBar>::Create( this, WB_BUTTONSTYLE | WB_BOTTOMBORDER ) )
+ , maListBox( VclPtr<SvHeaderTabListBox>::Create( this, WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ) )
{
- maListBox.SetHelpId( HID_MACRO_HEADERTABLISTBOX );
+ maListBox->SetHelpId( HID_MACRO_HEADERTABLISTBOX );
// enable the cell focus to show visible focus
- maListBox.EnableCellFocus();
+ maListBox->EnableCellFocus();
+}
+
+MacroEventListBox::~MacroEventListBox()
+{
+ disposeOnce();
+}
+
+void MacroEventListBox::dispose()
+{
+ maHeaderBar.disposeAndClear();
+ maListBox.disposeAndClear();
+ Control::dispose();
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeMacroEventListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
@@ -161,15 +173,15 @@ void MacroEventListBox::Resize()
// calc pos and size of header bar
Point aPnt( 0, 0 );
- Size aSize( maHeaderBar.CalcWindowSizePixel() );
+ Size aSize( maHeaderBar->CalcWindowSizePixel() );
Size aCtrlSize( GetOutputSizePixel() );
aSize.Width() = aCtrlSize.Width();
- maHeaderBar.SetPosSizePixel( aPnt, aSize );
+ maHeaderBar->SetPosSizePixel( aPnt, aSize );
// calc pos and size of ListBox
aPnt.Y() += aSize.Height();
aSize.Height() = aCtrlSize.Height() - aSize.Height();
- maListBox.SetPosSizePixel( aPnt, aSize );
+ maListBox->SetPosSizePixel( aPnt, aSize );
}
void MacroEventListBox::ConnectElements()
@@ -177,21 +189,21 @@ void MacroEventListBox::ConnectElements()
Resize();
// set handler
- maHeaderBar.SetEndDragHdl( LINK( this, MacroEventListBox, HeaderEndDrag_Impl ) );
+ maHeaderBar->SetEndDragHdl( LINK( this, MacroEventListBox, HeaderEndDrag_Impl ) );
- maListBox.InitHeaderBar( &maHeaderBar );
+ maListBox->InitHeaderBar( maHeaderBar.get() );
}
void MacroEventListBox::Show( bool bVisible, sal_uInt16 nFlags )
{
- maListBox.Show( bVisible, nFlags );
- maHeaderBar.Show( bVisible, nFlags );
+ maListBox->Show( bVisible, nFlags );
+ maHeaderBar->Show( bVisible, nFlags );
}
void MacroEventListBox::Enable( bool bEnable, bool bChild )
{
- maListBox.Enable( bEnable, bChild );
- maHeaderBar.Enable( bEnable, bChild );
+ maListBox->Enable( bEnable, bChild );
+ maHeaderBar->Enable( bEnable, bChild );
}
// assign button ("Add Command") is enabled only if it is not read only
@@ -226,7 +238,13 @@ _SvxMacroTabPage::_SvxMacroTabPage(vcl::Window* pParent, const OString& rID,
_SvxMacroTabPage::~_SvxMacroTabPage()
{
+ disposeOnce();
+}
+
+void _SvxMacroTabPage::dispose()
+{
DELETEZ( mpImpl );
+ SfxTabPage::dispose();
}
void _SvxMacroTabPage::InitResources()
@@ -640,7 +658,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton*
)
)
{
- boost::scoped_ptr<AssignComponentDialog> pAssignDlg(new AssignComponentDialog( pThis, sEventURL ));
+ VclPtrInstance< AssignComponentDialog > pAssignDlg( pThis, sEventURL );
short ret = pAssignDlg->Execute();
if( ret )
@@ -654,7 +672,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton*
else if( bAssEnabled )
{
// assign pressed
- boost::scoped_ptr<SvxScriptSelectorDialog> pDlg(new SvxScriptSelectorDialog( pThis, false, pThis->GetFrame() ));
+ VclPtrInstance< SvxScriptSelectorDialog > pDlg( pThis, false, pThis->GetFrame() );
if( pDlg )
{
short ret = pDlg->Execute();
@@ -836,7 +854,7 @@ SvxMacroAssignDlg::SvxMacroAssignDlg( vcl::Window* pParent, const Reference< fra
const Reference< container::XNameReplace >& xNameReplace, sal_uInt16 nSelectedIndex )
: SvxMacroAssignSingleTabDialog(pParent, rSet)
{
- SetTabPage(new SvxMacroTabPage(get_content_area(), _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex));
+ SetTabPage(VclPtr<SvxMacroTabPage>::Create(get_content_area(), _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex));
}
@@ -872,9 +890,15 @@ AssignComponentDialog::AssignComponentDialog( vcl::Window * pParent, const OUStr
AssignComponentDialog::~AssignComponentDialog()
{
+ disposeOnce();
}
-
+void AssignComponentDialog::dispose()
+{
+ mpMethodEdit.clear();
+ mpOKButton.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK( SvxMacroAssignSingleTabDialog, OKHdl_Impl, Button *, pButton )
{
diff --git a/cui/source/customize/macropg_impl.hxx b/cui/source/customize/macropg_impl.hxx
index dd7909275085..f80697fb5783 100644
--- a/cui/source/customize/macropg_impl.hxx
+++ b/cui/source/customize/macropg_impl.hxx
@@ -25,14 +25,14 @@ class _SvxMacroTabPage_Impl
public:
_SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet );
- PushButton* pAssignPB;
- PushButton* pAssignComponentPB;
- PushButton* pDeletePB;
+ VclPtr<PushButton> pAssignPB;
+ VclPtr<PushButton> pAssignComponentPB;
+ VclPtr<PushButton> pDeletePB;
Image aMacroImg;
Image aComponentImg;
OUString sStrEvent;
OUString sAssignedMacro;
- MacroEventListBox* pEventLB;
+ VclPtr<MacroEventListBox> pEventLB;
bool bReadOnly;
bool bIDEDialogMode;
};
@@ -40,8 +40,8 @@ public:
class AssignComponentDialog : public ModalDialog
{
private:
- Edit* mpMethodEdit;
- OKButton* mpOKButton;
+ VclPtr<Edit> mpMethodEdit;
+ VclPtr<OKButton> mpOKButton;
OUString maURL;
@@ -50,6 +50,7 @@ private:
public:
AssignComponentDialog( vcl::Window * pParent, const OUString& rURL );
virtual ~AssignComponentDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString getURL() const
{ return maURL; }
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index ee962883068e..7477032f1567 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -99,7 +99,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxConfigFunctionListB
SvxConfigFunctionListBox::~SvxConfigFunctionListBox()
{
+ disposeOnce();
+}
+
+void SvxConfigFunctionListBox::dispose()
+{
ClearAll();
+ SvTreeListBox::dispose();
}
SvTreeListEntry* SvxConfigFunctionListBox::GetLastSelectedEntry()
@@ -227,7 +233,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxConfigGroupListBox(
SvxConfigGroupListBox::~SvxConfigGroupListBox()
{
+ disposeOnce();
+}
+
+void SvxConfigGroupListBox::dispose()
+{
ClearAll();
+ pFunctionListBox.clear();
+ SvTreeListBox::dispose();
}
void SvxConfigGroupListBox::ClearAll()
@@ -908,6 +921,18 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog(
SvxScriptSelectorDialog::~SvxScriptSelectorDialog()
{
+ disposeOnce();
+}
+
+void SvxScriptSelectorDialog::dispose()
+{
+ m_pDialogDescription.clear();
+ m_pCategories.clear();
+ m_pCommands.clear();
+ m_pOKButton.clear();
+ m_pCancelButton.clear();
+ m_pDescriptionText.clear();
+ ModelessDialog::dispose();
}
IMPL_LINK( SvxScriptSelectorDialog, SelectHdl, Control*, pCtrl )
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index c9462aaa3e8a..dc58061832d7 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -246,17 +246,43 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow,
SpellDialog::~SpellDialog()
{
- // save possibly modified user-dictionaries
- Reference< XSearchableDictionaryList > xDicList( SvxGetDictionaryList() );
- if (xDicList.is())
- {
- SaveDictionaries( xDicList );
- }
-
- delete pImpl;
+ disposeOnce();
}
+void SpellDialog::dispose()
+{
+ if (pImpl)
+ {
+ // save possibly modified user-dictionaries
+ Reference< XSearchableDictionaryList > xDicList( SvxGetDictionaryList() );
+ if (xDicList.is())
+ SaveDictionaries( xDicList );
+ delete pImpl;
+ pImpl = NULL;
+ }
+ m_pLanguageFT.clear();
+ m_pLanguageLB.clear();
+ m_pExplainFT.clear();
+ m_pExplainLink.clear();
+ m_pNotInDictFT.clear();
+ m_pSentenceED.clear();
+ m_pSuggestionFT.clear();
+ m_pSuggestionLB.clear();
+ m_pIgnorePB.clear();
+ m_pIgnoreAllPB.clear();
+ m_pIgnoreRulePB.clear();
+ m_pAddToDictPB.clear();
+ m_pAddToDictMB.clear();
+ m_pChangePB.clear();
+ m_pChangeAllPB.clear();
+ m_pAutoCorrPB.clear();
+ m_pCheckGrammarCB.clear();
+ m_pOptionsPB.clear();
+ m_pUndoPB.clear();
+ m_pClosePB.clear();
+ SfxModelessDialog::dispose();
+}
void SpellDialog::Init_Impl()
{
@@ -497,10 +523,10 @@ void SpellDialog::StartSpellOptDlg_Impl()
};
SfxItemSet aSet( SfxGetpApp()->GetPool(), aSpellInfos);
aSet.Put(SfxSpellCheckItem( xSpell, SID_ATTR_SPELL ));
- boost::scoped_ptr<SfxSingleTabDialog> pDlg(
- new SfxSingleTabDialog(this, aSet, "SpellOptionsDialog", "cui/ui/spelloptionsdialog.ui"));
- SfxTabPage* pPage = SvxLinguTabPage::Create( pDlg->get_content_area(), &aSet );
- static_cast<SvxLinguTabPage*>(pPage)->HideGroups( GROUP_MODULES );
+ VclPtr<SfxSingleTabDialog> pDlg(
+ VclPtr<SfxSingleTabDialog>::Create(this, aSet, "SpellOptionsDialog", "cui/ui/spelloptionsdialog.ui"));
+ VclPtr<SfxTabPage> pPage = SvxLinguTabPage::Create( pDlg->get_content_area(), &aSet );
+ static_cast<SvxLinguTabPage*>(pPage.get())->HideGroups( GROUP_MODULES );
pDlg->SetTabPage( pPage );
if(RET_OK == pDlg->Execute())
{
@@ -1199,9 +1225,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSentenceEditWindow(vcl
}
-SentenceEditWindow_Impl::~SentenceEditWindow_Impl()
-{
-}
/*-------------------------------------------------------------------------
The selection before inputting a key may have a range or not
and it may be inside or outside of field or error attributes.
@@ -2032,9 +2055,9 @@ IMPL_LINK( SpellDialog, HandleHyperlink, FixedHyperlink*, pHyperlink )
uno::Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- MessageDialog aErrorBox(NULL, msg);
- aErrorBox.SetText(sTitle);
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg);
+ aErrorBox->SetText(sTitle);
+ aErrorBox->Execute();
}
return 1;
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index f5761d3093ff..1250e098e6ad 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -98,6 +98,23 @@ AboutDialog::AboutDialog(vcl::Window* pParent)
get<PushButton>("close")->GrabFocus();
}
+AboutDialog::~AboutDialog()
+{
+ disposeOnce();
+}
+
+void AboutDialog::dispose()
+{
+ m_pVersion.clear();
+ m_pDescriptionText.clear();
+ m_pCopyrightText.clear();
+ m_pLogoImage.clear();
+ m_pLogoReplacement.clear();
+ m_pCreditsButton.clear();
+ m_pWebsiteButton.clear();
+ SfxModalDialog::dispose();
+}
+
IMPL_LINK( AboutDialog, HandleClick, PushButton*, pButton )
{
OUString sURL = "";
@@ -126,9 +143,9 @@ IMPL_LINK( AboutDialog, HandleClick, PushButton*, pButton )
Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- MessageDialog aErrorBox(NULL, msg);
- aErrorBox.SetText( GetText() );
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg);
+ aErrorBox->SetText( GetText() );
+ aErrorBox->Execute();
}
return 1;
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index d1015e844e97..539c1e5f777b 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -309,6 +309,7 @@ class ColorFieldControl : public Control
public:
ColorFieldControl( vcl::Window* pParent, const WinBits& nStyle );
virtual ~ColorFieldControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
@@ -359,7 +360,14 @@ ColorFieldControl::ColorFieldControl( vcl::Window* pParent, const WinBits& nStyl
ColorFieldControl::~ColorFieldControl()
{
+ disposeOnce();
+}
+
+void ColorFieldControl::dispose()
+{
delete mpBitmap;
+ mpBitmap = NULL;
+ Control::dispose();
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeColorFieldControl(vcl::Window *pParent, VclBuilder::stringmap &rMap)
@@ -702,6 +710,7 @@ class ColorSliderControl : public Control
public:
ColorSliderControl( vcl::Window* pParent, const WinBits& nStyle );
virtual ~ColorSliderControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
@@ -744,7 +753,14 @@ ColorSliderControl::ColorSliderControl( vcl::Window* pParent, const WinBits& nSt
ColorSliderControl::~ColorSliderControl()
{
+ disposeOnce();
+}
+
+void ColorSliderControl::dispose()
+{
delete mpBitmap;
+ mpBitmap = NULL;
+ Control::dispose();
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeColorSliderControl(vcl::Window *pParent, VclBuilder::stringmap &rMap)
@@ -957,6 +973,8 @@ class ColorPickerDialog : public ModalDialog
{
public:
ColorPickerDialog( vcl::Window* pParent, sal_Int32 nColor, sal_Int16 nMode );
+ virtual ~ColorPickerDialog() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
void update_color( sal_uInt16 n = UPDATE_ALL );
@@ -976,35 +994,35 @@ private:
double mdCyan, mdMagenta, mdYellow, mdKey;
private:
- ColorFieldControl* mpColorField;
- ColorSliderControl* mpColorSlider;
- ColorPreviewControl* mpColorPreview;
- ColorPreviewControl* mpColorPrevious;
+ VclPtr<ColorFieldControl> mpColorField;
+ VclPtr<ColorSliderControl> mpColorSlider;
+ VclPtr<ColorPreviewControl> mpColorPreview;
+ VclPtr<ColorPreviewControl> mpColorPrevious;
- FixedImage* mpFISliderLeft;
- FixedImage* mpFISliderRight;
+ VclPtr<FixedImage> mpFISliderLeft;
+ VclPtr<FixedImage> mpFISliderRight;
Image maSliderImage;
- RadioButton* mpRBRed;
- RadioButton* mpRBGreen;
- RadioButton* mpRBBlue;
- RadioButton* mpRBHue;
- RadioButton* mpRBSaturation;
- RadioButton* mpRBBrightness;
-
- MetricField* mpMFRed;
- MetricField* mpMFGreen;
- MetricField* mpMFBlue;
- HexColorControl* mpEDHex;
-
- MetricField* mpMFHue;
- MetricField* mpMFSaturation;
- MetricField* mpMFBrightness;
-
- MetricField* mpMFCyan;
- MetricField* mpMFMagenta;
- MetricField* mpMFYellow;
- MetricField* mpMFKey;
+ VclPtr<RadioButton> mpRBRed;
+ VclPtr<RadioButton> mpRBGreen;
+ VclPtr<RadioButton> mpRBBlue;
+ VclPtr<RadioButton> mpRBHue;
+ VclPtr<RadioButton> mpRBSaturation;
+ VclPtr<RadioButton> mpRBBrightness;
+
+ VclPtr<MetricField> mpMFRed;
+ VclPtr<MetricField> mpMFGreen;
+ VclPtr<MetricField> mpMFBlue;
+ VclPtr<HexColorControl> mpEDHex;
+
+ VclPtr<MetricField> mpMFHue;
+ VclPtr<MetricField> mpMFSaturation;
+ VclPtr<MetricField> mpMFBrightness;
+
+ VclPtr<MetricField> mpMFCyan;
+ VclPtr<MetricField> mpMFMagenta;
+ VclPtr<MetricField> mpMFYellow;
+ VclPtr<MetricField> mpMFKey;
};
ColorPickerDialog::ColorPickerDialog( vcl::Window* pParent, sal_Int32 nColor, sal_Int16 nMode )
@@ -1110,6 +1128,34 @@ ColorPickerDialog::ColorPickerDialog( vcl::Window* pParent, sal_Int32 nColor, sa
update_color();
}
+void ColorPickerDialog::dispose()
+{
+ mpColorField.clear();
+ mpColorSlider.clear();
+ mpColorPreview.clear();
+ mpColorPrevious.clear();
+ mpFISliderLeft.clear();
+ mpFISliderRight.clear();
+ mpRBRed.clear();
+ mpRBGreen.clear();
+ mpRBBlue.clear();
+ mpRBHue.clear();
+ mpRBSaturation.clear();
+ mpRBBrightness.clear();
+ mpMFRed.clear();
+ mpMFGreen.clear();
+ mpMFBlue.clear();
+ mpEDHex.clear();
+ mpMFHue.clear();
+ mpMFSaturation.clear();
+ mpMFBrightness.clear();
+ mpMFCyan.clear();
+ mpMFMagenta.clear();
+ mpMFYellow.clear();
+ mpMFKey.clear();
+ ModalDialog::dispose();
+}
+
static int toInt( double dValue, double dRange )
{
return static_cast< int >( std::floor((dValue * dRange) + 0.5 ) );
@@ -1495,10 +1541,10 @@ void SAL_CALL ColorPicker::setTitle( const OUString& sTitle ) throw (RuntimeExce
sal_Int16 SAL_CALL ColorPicker::execute( ) throw (RuntimeException, std::exception)
{
- ColorPickerDialog aDlg( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode );
- sal_Int16 ret = aDlg.Execute();
+ ScopedVclPtrInstance< ColorPickerDialog > aDlg( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode );
+ sal_Int16 ret = aDlg->Execute();
if( ret )
- mnColor = aDlg.GetColor();
+ mnColor = aDlg->GetColor();
return ret;
}
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 6764c45f15fa..a351d820c872 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -100,15 +100,25 @@ SvxCharacterMap::SvxCharacterMap( vcl::Window* pParent, bool bOne_, const SfxIte
CreateOutputItemSet( pSet ? *pSet->GetPool() : SfxGetpApp()->GetPool() );
}
-
-
SvxCharacterMap::~SvxCharacterMap()
{
+ disposeOnce();
}
-
-
-
+void SvxCharacterMap::dispose()
+{
+ m_pShowSet.clear();
+ m_pShowText.clear();
+ m_pOKBtn.clear();
+ m_pFontText.clear();
+ m_pFontLB.clear();
+ m_pSubsetText.clear();
+ m_pSubsetLB.clear();
+ m_pSymbolText.clear();
+ m_pShowChar.clear();
+ m_pCharCodeText.clear();
+ SfxModalDialog::dispose();
+}
void SvxCharacterMap::SetChar( sal_UCS4 c )
@@ -174,8 +184,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxShowText(vcl::Windo
return new SvxShowText(pParent);
}
-
-
void SvxShowText::Paint( const Rectangle& )
{
Color aTextCol = GetTextColor();
@@ -298,9 +306,6 @@ void SvxShowText::SetText( const OUString& rText )
-SvxShowText::~SvxShowText()
-{}
-
// class SvxCharacterMap =================================================
void SvxCharacterMap::init()
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index 6f3643d3a772..0e11f72b8ccd 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -160,18 +160,51 @@ FmSearchDialog::FmSearchDialog(vcl::Window* pParent, const OUString& sInitialTex
FmSearchDialog::~FmSearchDialog()
{
+ disposeOnce();
+}
+
+void FmSearchDialog::dispose()
+{
if (m_aDelayedPaint.IsActive())
m_aDelayedPaint.Stop();
SaveParams();
- if (m_pConfig)
- {
- delete m_pConfig;
- m_pConfig = NULL;
- }
+ delete m_pConfig;
+ m_pConfig = NULL;
delete m_pSearchEngine;
+ m_pSearchEngine = NULL;
+
+ m_prbSearchForText.clear();
+ m_prbSearchForNull.clear();
+ m_prbSearchForNotNull.clear();
+ m_pcmbSearchText.clear();
+ m_pftForm.clear();
+ m_plbForm.clear();
+ m_prbAllFields.clear();
+ m_prbSingleField.clear();
+ m_plbField.clear();
+ m_pftPosition.clear();
+ m_plbPosition.clear();
+ m_pcbUseFormat.clear();
+ m_pcbCase.clear();
+ m_pcbBackwards.clear();
+ m_pcbStartOver.clear();
+ m_pcbWildCard.clear();
+ m_pcbRegular.clear();
+ m_pcbApprox.clear();
+ m_ppbApproxSettings.clear();
+ m_pHalfFullFormsCJK.clear();
+ m_pSoundsLikeCJK.clear();
+ m_pSoundsLikeCJKSettings.clear();
+ m_pftRecord.clear();
+ m_pftHint.clear();
+ m_pbSearchAgain.clear();
+ m_pbClose.clear();
+ m_pPreSearchFocus.clear();
+
+ ModalDialog::dispose();
}
void FmSearchDialog::Init(const OUString& strVisibleFields, const OUString& sInitialText)
@@ -604,7 +637,7 @@ void FmSearchDialog::EnableSearchUI(bool bEnable)
m_pPreSearchFocus->GrabFocus();
if ( WINDOW_EDIT == m_pPreSearchFocus->GetType() )
{
- Edit* pEdit = static_cast< Edit* >( m_pPreSearchFocus );
+ Edit* pEdit = static_cast< Edit* >( m_pPreSearchFocus.get() );
pEdit->SetSelection( Selection( 0, pEdit->GetText().getLength() ) );
}
}
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index a6a9ef3a507e..549d21054447 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -215,6 +215,19 @@ SearchProgress::SearchProgress( vcl::Window* pParent, const INetURLObject& rStar
m_pBtnCancel->SetClickHdl( LINK( this, SearchProgress, ClickCancelBtn ) );
}
+SearchProgress::~SearchProgress()
+{
+ disposeOnce();
+}
+
+void SearchProgress::dispose()
+{
+ m_pFtSearchDir.clear();
+ m_pFtSearchType.clear();
+ m_pBtnCancel.clear();
+ parent_.clear();
+ ModalDialog::dispose();
+}
void SearchProgress::Terminate()
@@ -240,7 +253,7 @@ IMPL_LINK_NOARG(SearchProgress, CleanUpHdl)
EndDialog( RET_OK );
- delete this;
+ disposeOnce();
return 0L;
}
@@ -260,7 +273,7 @@ void SearchProgress::StartExecuteModal( const Link& rEndDialogHdl )
{
assert(!maSearchThread.is());
maSearchThread = new SearchThread(
- this, static_cast< TPGalleryThemeProperties * >(parent_), startUrl_);
+ this, static_cast< TPGalleryThemeProperties * >(parent_.get()), startUrl_);
maSearchThread->launch();
ModalDialog::StartExecuteModal( rEndDialogHdl );
}
@@ -345,6 +358,19 @@ TakeProgress::TakeProgress(vcl::Window* pWindow)
m_pBtnCancel->SetClickHdl( LINK( this, TakeProgress, ClickCancelBtn ) );
}
+TakeProgress::~TakeProgress()
+{
+ disposeOnce();
+}
+
+void TakeProgress::dispose()
+{
+ m_pFtTakeFile.clear();
+ m_pBtnCancel.clear();
+ window_.clear();
+ ModalDialog::dispose();
+}
+
void TakeProgress::Terminate()
{
if (maTakeThread.is())
@@ -405,7 +431,7 @@ IMPL_LINK_NOARG(TakeProgress, CleanUpHdl)
GetParent()->LeaveWait();
EndDialog( RET_OK );
- delete this;
+ disposeOnce();
return 0L;
}
@@ -425,7 +451,7 @@ void TakeProgress::StartExecuteModal( const Link& rEndDialogHdl )
{
assert(!maTakeThread.is());
maTakeThread = new TakeThread(
- this, static_cast< TPGalleryThemeProperties * >(window_), maTakenList);
+ this, static_cast< TPGalleryThemeProperties * >(window_.get()), maTakenList);
maTakeThread->launch();
ModalDialog::StartExecuteModal( rEndDialogHdl );
}
@@ -443,6 +469,18 @@ ActualizeProgress::ActualizeProgress(vcl::Window* pWindow, GalleryTheme* pThm)
m_pBtnCancel->SetClickHdl( LINK( this, ActualizeProgress, ClickCancelBtn ) );
}
+ActualizeProgress::~ActualizeProgress()
+{
+ disposeOnce();
+}
+
+void ActualizeProgress::dispose()
+{
+ m_pFtActualizeFile.clear();
+ m_pBtnCancel.clear();
+ ModalDialog::dispose();
+}
+
short ActualizeProgress::Execute()
{
short nRet;
@@ -511,6 +549,17 @@ TitleDialog::TitleDialog(vcl::Window* pParent, const OUString& rOldTitle)
m_pEdit->GrabFocus();
}
+TitleDialog::~TitleDialog()
+{
+ disposeOnce();
+}
+
+void TitleDialog::dispose()
+{
+ m_pEdit.clear();
+ ModalDialog::dispose();
+}
+
// - GalleryIdDialog -
@@ -532,7 +581,17 @@ GalleryIdDialog::GalleryIdDialog( vcl::Window* pParent, GalleryTheme* _pThm )
m_pBtnOk->SetClickHdl( LINK( this, GalleryIdDialog, ClickOkHdl ) );
}
+GalleryIdDialog::~GalleryIdDialog()
+{
+ disposeOnce();
+}
+void GalleryIdDialog::dispose()
+{
+ m_pBtnOk.clear();
+ m_pLbResName.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(GalleryIdDialog, ClickOkHdl)
{
@@ -552,8 +611,8 @@ IMPL_LINK_NOARG(GalleryIdDialog, ClickOkHdl)
aStr += pInfo->GetThemeName();
aStr += ")";
- InfoBox aBox( this, aStr );
- aBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aBox( this, aStr );
+ aBox->Execute();
m_pLbResName->GrabFocus();
bDifferentThemeExists = true;
}
@@ -616,6 +675,22 @@ TPGalleryThemeGeneral::TPGalleryThemeGeneral(vcl::Window* pParent, const SfxItem
get(m_pFtMSShowChangeDate, "modified");
}
+TPGalleryThemeGeneral::~TPGalleryThemeGeneral()
+{
+ disposeOnce();
+}
+
+void TPGalleryThemeGeneral::dispose()
+{
+ m_pFiMSImage.clear();
+ m_pEdtMSName.clear();
+ m_pFtMSShowType.clear();
+ m_pFtMSShowPath.clear();
+ m_pFtMSShowContent.clear();
+ m_pFtMSShowChangeDate.clear();
+ SfxTabPage::dispose();
+}
+
void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData )
{
pData = _pData;
@@ -682,9 +757,9 @@ bool TPGalleryThemeGeneral::FillItemSet( SfxItemSet* /*rSet*/ )
-SfxTabPage* TPGalleryThemeGeneral::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> TPGalleryThemeGeneral::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new TPGalleryThemeGeneral( pParent, *rSet );
+ return VclPtr<TPGalleryThemeGeneral>::Create( pParent, *rSet );
}
// - TPGalleryThemeProperties -
@@ -756,23 +831,34 @@ void TPGalleryThemeProperties::StartSearchFiles( const OUString& _rFolderURL, sh
TPGalleryThemeProperties::~TPGalleryThemeProperties()
{
+ disposeOnce();
+}
+
+void TPGalleryThemeProperties::dispose()
+{
xMediaPlayer.clear();
xDialogListener.clear();
for ( size_t i = 0, n = aFilterEntryList.size(); i < n; ++i ) {
delete aFilterEntryList[ i ];
}
+ aFilterEntryList.clear();
+
+ m_pCbbFileType.clear();
+ m_pLbxFound.clear();
+ m_pBtnSearch.clear();
+ m_pBtnTake.clear();
+ m_pBtnTakeAll.clear();
+ m_pCbxPreview.clear();
+ m_pWndPreview.clear();
+ SfxTabPage::dispose();
}
-
-
-SfxTabPage* TPGalleryThemeProperties::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> TPGalleryThemeProperties::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new TPGalleryThemeProperties( pParent, *rSet );
+ return VclPtr<TPGalleryThemeProperties>::Create( pParent, *rSet );
}
-
-
OUString TPGalleryThemeProperties::addExtension( const OUString& _rDisplayText, const OUString& _rExtension )
{
OUString sAllFilter( "(*.*)" );
@@ -951,7 +1037,7 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, SelectFileTypeHdl)
void TPGalleryThemeProperties::SearchFiles()
{
- SearchProgress* pProgress = new SearchProgress( this, aURL );
+ SearchProgress* pProgress = VclPtr<SearchProgress>::Create( this, aURL );
aFoundList.clear();
m_pLbxFound->Clear();
@@ -1010,12 +1096,12 @@ void TPGalleryThemeProperties::TakeFiles()
{
if( m_pLbxFound->GetSelectEntryCount() || ( bTakeAll && bEntriesFound ) )
{
- TakeProgress* pTakeProgress = new TakeProgress( this );
+ VclPtrInstance<TakeProgress> pTakeProgress( this );
pTakeProgress->Update();
pTakeProgress->StartExecuteModal(
Link() /* no postprocessing needed, pTakeProgress
- will be deleted in TakeProgress::CleanupHdl */ );
+ will be disposed in TakeProgress::CleanupHdl */ );
}
}
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 9eb47497865e..9e84ce37c102 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -153,6 +153,16 @@ GraphicFilterDialog::GraphicFilterDialog(vcl::Window* pParent,
mpPreview->init(&rGraphic, maModifyHdl);
}
+GraphicFilterDialog::~GraphicFilterDialog()
+{
+ disposeOnce();
+}
+
+void GraphicFilterDialog::dispose()
+{
+ mpPreview.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(GraphicFilterDialog, ImplPreviewTimeoutHdl)
@@ -204,7 +214,18 @@ GraphicFilterMosaic::GraphicFilterMosaic( vcl::Window* pParent, const Graphic& r
mpMtrWidth->GrabFocus();
}
+GraphicFilterMosaic::~GraphicFilterMosaic()
+{
+ disposeOnce();
+}
+void GraphicFilterMosaic::dispose()
+{
+ mpMtrWidth.clear();
+ mpMtrHeight.clear();
+ mpCbxEdges.clear();
+ GraphicFilterDialog::dispose();
+}
Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
double fScaleX, double fScaleY )
@@ -257,6 +278,16 @@ GraphicFilterSmooth::GraphicFilterSmooth( vcl::Window* pParent, const Graphic& r
mpMtrRadius->GrabFocus();
}
+GraphicFilterSmooth::~GraphicFilterSmooth()
+{
+ disposeOnce();
+}
+
+void GraphicFilterSmooth::dispose()
+{
+ mpMtrRadius.clear();
+ GraphicFilterDialog::dispose();
+}
Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double /*fScaleX*/, double /*fScaleY*/ )
@@ -305,6 +336,17 @@ GraphicFilterSolarize::GraphicFilterSolarize( vcl::Window* pParent, const Graphi
mpCbxInvert->SetToggleHdl( GetModifyHdl() );
}
+GraphicFilterSolarize::~GraphicFilterSolarize()
+{
+ disposeOnce();
+}
+
+void GraphicFilterSolarize::dispose()
+{
+ mpMtrThreshold.clear();
+ mpCbxInvert.clear();
+ GraphicFilterDialog::dispose();
+}
Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic,
@@ -356,6 +398,16 @@ GraphicFilterSepia::GraphicFilterSepia( vcl::Window* pParent, const Graphic& rGr
mpMtrSepia->SetModifyHdl( GetModifyHdl() );
}
+GraphicFilterSepia::~GraphicFilterSepia()
+{
+ disposeOnce();
+}
+
+void GraphicFilterSepia::dispose()
+{
+ mpMtrSepia.clear();
+ GraphicFilterDialog::dispose();
+}
Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic,
@@ -399,6 +451,16 @@ GraphicFilterPoster::GraphicFilterPoster(vcl::Window* pParent, const Graphic& rG
mpNumPoster->SetModifyHdl( GetModifyHdl() );
}
+GraphicFilterPoster::~GraphicFilterPoster()
+{
+ disposeOnce();
+}
+
+void GraphicFilterPoster::dispose()
+{
+ mpNumPoster.clear();
+ GraphicFilterDialog::dispose();
+}
Graphic GraphicFilterPoster::GetFilteredGraphic( const Graphic& rGraphic,
@@ -462,6 +524,16 @@ GraphicFilterEmboss::GraphicFilterEmboss(vcl::Window* pParent,
mpCtlLight->GrabFocus();
}
+GraphicFilterEmboss::~GraphicFilterEmboss()
+{
+ disposeOnce();
+}
+
+void GraphicFilterEmboss::dispose()
+{
+ mpCtlLight.clear();
+ GraphicFilterDialog::dispose();
+}
Graphic GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic,
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index 41dc5a1be98b..1270e09f92d4 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -93,7 +93,7 @@ SvxHpLinkDlg::SvxHpLinkDlg (vcl::Window* pParent, SfxBindings* pBindings)
// insert pages
Image aImage;
OUString aStrTitle;
- SvxIconChoiceCtrlEntry* pEntry = NULL;
+ SvxIconChoiceCtrlEntry *pEntry;
aStrTitle = CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLINETTP );
aImage = Image( CUI_RES ( RID_SVXBMP_HLINETTP ) );
@@ -157,11 +157,19 @@ SvxHpLinkDlg::SvxHpLinkDlg (vcl::Window* pParent, SfxBindings* pBindings)
SvxHpLinkDlg::~SvxHpLinkDlg ()
{
+ disposeOnce();
+}
+
+void SvxHpLinkDlg::dispose()
+{
// delete config item, so the base class (IconChoiceDialog) can not load it on the next start
SvtViewOptions aViewOpt( E_TABDIALOG, OUString::number(SID_HYPERLINK_DIALOG) );
aViewOpt.Delete();
delete mpItemSet;
+ mpItemSet = NULL;
+
+ IconChoiceDialog::dispose();
}
/*************************************************************************
diff --git a/cui/source/dialogs/cuiimapwnd.cxx b/cui/source/dialogs/cuiimapwnd.cxx
index 118da3fc5c50..98e059a2109a 100644
--- a/cui/source/dialogs/cuiimapwnd.cxx
+++ b/cui/source/dialogs/cuiimapwnd.cxx
@@ -73,4 +73,19 @@ URLDlg::URLDlg( vcl::Window* pWindow, const OUString& rURL, const OUString& rAlt
m_pCbbTargets->SetText( rTarget );
}
+URLDlg::~URLDlg()
+{
+ disposeOnce();
+}
+
+void URLDlg::dispose()
+{
+ m_pEdtURL.clear();
+ m_pCbbTargets.clear();
+ m_pEdtName.clear();
+ m_pEdtAlternativeText.clear();
+ m_pEdtDescription.clear();
+ ModalDialog::dispose();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/cuitbxform.cxx b/cui/source/dialogs/cuitbxform.cxx
index 46ae5b5e78d6..b54de7fe8e31 100644
--- a/cui/source/dialogs/cuitbxform.cxx
+++ b/cui/source/dialogs/cuitbxform.cxx
@@ -41,4 +41,15 @@ FmInputRecordNoDialog::FmInputRecordNoDialog(vcl::Window * pParent)
m_pRecordNo->SetDecimalDigits(0);
}
+FmInputRecordNoDialog::~FmInputRecordNoDialog()
+{
+ disposeOnce();
+}
+
+void FmInputRecordNoDialog::dispose()
+{
+ m_pRecordNo.clear();
+ ModalDialog::dispose();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index 83ee94c07fce..7745404b4ae5 100644
--- a/cui/source/dialogs/dlgname.cxx
+++ b/cui/source/dialogs/dlgname.cxx
@@ -45,6 +45,19 @@ SvxNameDialog::SvxNameDialog( vcl::Window* pWindow, const OUString& rName, const
pEdtName->SetModifyHdl(LINK(this, SvxNameDialog, ModifyHdl));
}
+SvxNameDialog::~SvxNameDialog()
+{
+ disposeOnce();
+}
+
+void SvxNameDialog::dispose()
+{
+ pFtDescription.clear();
+ pEdtName.clear();
+ pBtnOK.clear();
+ ModalDialog::dispose();
+}
+
IMPL_LINK_NOARG(SvxNameDialog, ModifyHdl)
{
if(aCheckNameHdl.IsSet())
@@ -73,6 +86,19 @@ SvxObjectNameDialog::SvxObjectNameDialog(
pEdtName->SetModifyHdl(LINK(this, SvxObjectNameDialog, ModifyHdl));
}
+SvxObjectNameDialog::~SvxObjectNameDialog()
+{
+ disposeOnce();
+}
+
+void SvxObjectNameDialog::dispose()
+{
+ pEdtName.clear();
+ pBtnOK.clear();
+ ModalDialog::dispose();
+}
+
+
IMPL_LINK_NOARG(SvxObjectNameDialog, ModifyHdl)
{
if(aCheckNameHdl.IsSet())
@@ -105,6 +131,17 @@ SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(
pEdtTitle->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
}
+SvxObjectTitleDescDialog::~SvxObjectTitleDescDialog()
+{
+ disposeOnce();
+}
+
+void SvxObjectTitleDescDialog::dispose()
+{
+ pEdtTitle.clear();
+ pEdtDescription.clear();
+ ModalDialog::dispose();
+}
/*************************************************************************
@@ -138,7 +175,18 @@ SvxMessDialog::SvxMessDialog( vcl::Window* pWindow, const OUString& rText, const
SvxMessDialog::~SvxMessDialog()
{
+ disposeOnce();
+}
+
+void SvxMessDialog::dispose()
+{
delete pImage;
+ pImage = NULL;
+ pFtDescription.clear();
+ pBtn1.clear();
+ pBtn2.clear();
+ pFtImage.clear();
+ ModalDialog::dispose();
}
/*************************************************************************/
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index ade585801826..5fea052f03df 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -338,7 +338,13 @@ namespace svx
SuggestionSet::~SuggestionSet()
{
+ disposeOnce();
+ }
+
+ void SuggestionSet::dispose()
+ {
ClearSet();
+ ValueSet::dispose();
}
void SuggestionSet::UserDraw( const UserDrawEvent& rUDEvt )
@@ -366,29 +372,37 @@ namespace svx
SuggestionDisplay::SuggestionDisplay( vcl::Window* pParent, WinBits nBits )
: Control( pParent, nBits )
, m_bDisplayListBox( true )
- , m_aValueSet( this )
- , m_aListBox( this,GetStyle() | WB_BORDER )
+ , m_aValueSet( VclPtr<SuggestionSet>::Create(this) )
+ , m_aListBox( VclPtr<ListBox>::Create(this,GetStyle() | WB_BORDER) )
, m_bInSelectionUpdate( false )
{
- m_aValueSet.SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) );
- m_aListBox.SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) );
+ m_aValueSet->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) );
+ m_aListBox->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) );
- m_aValueSet.SetLineCount( LINE_CNT );
- m_aValueSet.SetStyle( m_aValueSet.GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL );
- m_aValueSet.SetBorderStyle( WindowBorderStyle::MONO );
+ m_aValueSet->SetLineCount( LINE_CNT );
+ m_aValueSet->SetStyle( m_aValueSet->GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL );
+ m_aValueSet->SetBorderStyle( WindowBorderStyle::MONO );
OUString aOneCharacter("AU");
long nItemWidth = 2*GetTextWidth( aOneCharacter );
- m_aValueSet.SetItemWidth( nItemWidth );
+ m_aValueSet->SetItemWidth( nItemWidth );
Size aSize( approximate_char_width() * 48, GetTextHeight() * 5 );
- m_aValueSet.SetSizePixel( aSize );
- m_aListBox.SetSizePixel( aSize );
+ m_aValueSet->SetSizePixel( aSize );
+ m_aListBox->SetSizePixel( aSize );
implUpdateDisplay();
}
SuggestionDisplay::~SuggestionDisplay()
{
+ disposeOnce();
+ }
+
+ void SuggestionDisplay::dispose()
+ {
+ m_aValueSet.disposeAndClear();
+ m_aListBox.disposeAndClear();
+ Control::dispose();
}
void SuggestionDisplay::implUpdateDisplay()
@@ -396,8 +410,8 @@ namespace svx
bool bShowBox = IsVisible() && m_bDisplayListBox;
bool bShowSet = IsVisible() && !m_bDisplayListBox;
- m_aListBox.Show( bShowBox );
- m_aValueSet.Show( bShowSet );
+ m_aListBox->Show( bShowBox );
+ m_aValueSet->Show( bShowSet );
}
void SuggestionDisplay::StateChanged( StateChangedType nStateChange )
@@ -409,8 +423,8 @@ namespace svx
Control& SuggestionDisplay::implGetCurrentControl()
{
if( m_bDisplayListBox )
- return m_aListBox;
- return m_aValueSet;
+ return *m_aListBox.get();
+ return *m_aValueSet.get();
}
void SuggestionDisplay::KeyInput( const KeyEvent& rKEvt )
@@ -467,15 +481,15 @@ namespace svx
return 0L;
m_bInSelectionUpdate = true;
- if( pControl == &m_aListBox )
+ if( pControl == m_aListBox.get() )
{
- sal_uInt16 nPos = m_aListBox.GetSelectEntryPos();
- m_aValueSet.SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
+ sal_uInt16 nPos = m_aListBox->GetSelectEntryPos();
+ m_aValueSet->SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
}
else
{
- sal_uInt16 nPos = m_aValueSet.GetSelectItemId()-1; //itemid == pos+1 (id 0 has special meaning)
- m_aListBox.SelectEntryPos( nPos );
+ sal_uInt16 nPos = m_aValueSet->GetSelectItemId()-1; //itemid == pos+1 (id 0 has special meaning)
+ m_aListBox->SelectEntryPos( nPos );
}
m_bInSelectionUpdate = false;
m_aSelectLink.Call( this );
@@ -488,38 +502,38 @@ namespace svx
}
void SuggestionDisplay::Clear()
{
- m_aListBox.Clear();
- m_aValueSet.Clear();
+ m_aListBox->Clear();
+ m_aValueSet->Clear();
}
void SuggestionDisplay::InsertEntry( const OUString& rStr )
{
- sal_uInt16 nItemId = m_aListBox.InsertEntry( rStr ) + 1; //itemid == pos+1 (id 0 has special meaning)
- m_aValueSet.InsertItem( nItemId );
+ sal_uInt16 nItemId = m_aListBox->InsertEntry( rStr ) + 1; //itemid == pos+1 (id 0 has special meaning)
+ m_aValueSet->InsertItem( nItemId );
OUString* pItemData = new OUString( rStr );
- m_aValueSet.SetItemData( nItemId, pItemData );
+ m_aValueSet->SetItemData( nItemId, pItemData );
}
void SuggestionDisplay::SelectEntryPos( sal_uInt16 nPos )
{
- m_aListBox.SelectEntryPos( nPos );
- m_aValueSet.SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
+ m_aListBox->SelectEntryPos( nPos );
+ m_aValueSet->SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
}
sal_uInt16 SuggestionDisplay::GetEntryCount() const
{
- return m_aListBox.GetEntryCount();
+ return m_aListBox->GetEntryCount();
}
OUString SuggestionDisplay::GetEntry( sal_uInt16 nPos ) const
{
- return m_aListBox.GetEntry( nPos );
+ return m_aListBox->GetEntry( nPos );
}
OUString SuggestionDisplay::GetSelectEntry() const
{
- return m_aListBox.GetSelectEntry();
+ return m_aListBox->GetSelectEntry();
}
void SuggestionDisplay::SetHelpIds()
{
this->SetHelpId( HID_HANGULDLG_SUGGESTIONS );
- m_aValueSet.SetHelpId( HID_HANGULDLG_SUGGESTIONS_GRID );
- m_aListBox.SetHelpId( HID_HANGULDLG_SUGGESTIONS_LIST );
+ m_aValueSet->SetHelpId( HID_HANGULDLG_SUGGESTIONS_GRID );
+ m_aListBox->SetHelpId( HID_HANGULDLG_SUGGESTIONS_LIST );
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSuggestionDisplay( vcl::Window *pParent, VclBuilder::stringmap & )
@@ -591,11 +605,35 @@ namespace svx
m_pSuggestions->SetHelpIds();
}
-
- HangulHanjaConversionDialog::~HangulHanjaConversionDialog( )
+ HangulHanjaConversionDialog::~HangulHanjaConversionDialog()
{
+ disposeOnce();
}
+ void HangulHanjaConversionDialog::dispose()
+ {
+ m_pFind.clear();
+ m_pIgnore.clear();
+ m_pIgnoreAll.clear();
+ m_pReplace.clear();
+ m_pReplaceAll.clear();
+ m_pOptions.clear();
+ m_pSuggestions.clear();
+ m_pSimpleConversion.clear();
+ m_pHangulBracketed.clear();
+ m_pHanjaBracketed.clear();
+ m_pWordInput.clear();
+ m_pOriginalWord.clear();
+ m_pHanjaAbove.clear();
+ m_pHanjaBelow.clear();
+ m_pHangulAbove.clear();
+ m_pHangulBelow.clear();
+ m_pHangulOnly.clear();
+ m_pHanjaOnly.clear();
+ m_pReplaceByChar.clear();
+ m_pIgnoreNonPrimary.clear();
+ ModalDialog::dispose();
+ }
void HangulHanjaConversionDialog::FillSuggestions( const ::com::sun::star::uno::Sequence< OUString >& _rSuggestions )
{
@@ -723,8 +761,8 @@ namespace svx
IMPL_LINK_NOARG( HangulHanjaConversionDialog, OnOption )
{
- HangulHanjaOptionsDialog aOptDlg( this );
- aOptDlg.Execute();
+ ScopedVclPtrInstance< HangulHanjaOptionsDialog > aOptDlg(this);
+ aOptDlg->Execute();
m_aOptionsChangedLink.Call( this );
return 0L;
}
@@ -1003,9 +1041,9 @@ namespace svx
IMPL_LINK_NOARG(HangulHanjaOptionsDialog, NewDictHdl)
{
OUString aName;
- HangulHanjaNewDictDialog aNewDlg( this );
- aNewDlg.Execute();
- if( aNewDlg.GetName( aName ) )
+ ScopedVclPtrInstance< HangulHanjaNewDictDialog > aNewDlg(this);
+ aNewDlg->Execute();
+ if( aNewDlg->GetName( aName ) )
{
if( m_xConversionDictionaryList.is() )
{
@@ -1039,8 +1077,8 @@ namespace svx
DBG_ASSERT( pEntry, "+HangulHanjaEditDictDialog::EditDictHdl(): call of edit should not be possible with no selection!" );
if( pEntry )
{
- HangulHanjaEditDictDialog aEdDlg( this, m_aDictList, m_pDictsLB->GetSelectEntryPos() );
- aEdDlg.Execute();
+ ScopedVclPtrInstance< HangulHanjaEditDictDialog > aEdDlg(this, m_aDictList, m_pDictsLB->GetSelectEntryPos());
+ aEdDlg->Execute();
}
return 0L;
}
@@ -1125,17 +1163,34 @@ namespace svx
HangulHanjaOptionsDialog::~HangulHanjaOptionsDialog()
{
- SvTreeListEntry* pEntry = m_pDictsLB->First();
- while( pEntry )
+ disposeOnce();
+ }
+
+ void HangulHanjaOptionsDialog::dispose()
+ {
+ if (m_pDictsLB)
{
- OUString const * pDel = static_cast<OUString const *>(pEntry->GetUserData());
- if( pDel )
- delete pDel;
- pEntry = m_pDictsLB->Next( pEntry );
+ SvTreeListEntry* pEntry = m_pDictsLB->First();
+ while( pEntry )
+ {
+ delete static_cast<OUString const *>(pEntry->GetUserData());
+ pEntry->SetUserData( NULL );
+ pEntry = m_pDictsLB->Next( pEntry );
+ }
}
- if( m_pCheckButtonData )
- delete m_pCheckButtonData;
+ delete m_pCheckButtonData;
+ m_pCheckButtonData = NULL;
+
+ m_pDictsLB.clear();
+ m_pIgnorepostCB.clear();
+ m_pShowrecentlyfirstCB.clear();
+ m_pAutoreplaceuniqueCB.clear();
+ m_pNewPB.clear();
+ m_pEditPB.clear();
+ m_pDeletePB.clear();
+ m_pOkPB.clear();
+ ModalDialog::dispose();
}
void HangulHanjaOptionsDialog::AddDict( const OUString& _rName, bool _bChecked )
@@ -1182,6 +1237,18 @@ namespace svx
m_pDictNameED->SetModifyHdl( LINK( this, HangulHanjaNewDictDialog, ModifyHdl ) );
}
+ HangulHanjaNewDictDialog::~HangulHanjaNewDictDialog()
+ {
+ disposeOnce();
+ }
+
+ void HangulHanjaNewDictDialog::dispose()
+ {
+ m_pDictNameED.clear();
+ m_pOkBtn.clear();
+ ModalDialog::dispose();
+ }
+
bool HangulHanjaNewDictDialog::GetName( OUString& _rRetName ) const
{
if( m_bEntered )
@@ -1359,6 +1426,15 @@ namespace svx
SuggestionEdit::~SuggestionEdit()
{
+ disposeOnce();
+ }
+
+ void SuggestionEdit::dispose()
+ {
+ m_pPrev.clear();
+ m_pNext.clear();
+ m_pScrollBar.clear();
+ Edit::dispose();
}
bool SuggestionEdit::PreNotify( NotifyEvent& rNEvt )
@@ -1769,8 +1845,23 @@ namespace svx
HangulHanjaEditDictDialog::~HangulHanjaEditDictDialog()
{
- if( m_pSuggestions )
- delete m_pSuggestions;
+ disposeOnce();
+ }
+
+ void HangulHanjaEditDictDialog::dispose()
+ {
+ delete m_pSuggestions;
+ m_pSuggestions = NULL;
+ m_aBookLB.clear();
+ m_aOriginalLB.clear();
+ m_aEdit1.clear();
+ m_aEdit2.clear();
+ m_aEdit3.clear();
+ m_aEdit4.clear();
+ m_aScrollSB.clear();
+ m_aNewPB.clear();
+ m_aDeletePB.clear();
+ ModalDialog::dispose();
}
void HangulHanjaEditDictDialog::UpdateScrollbar()
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 4711a1f574ce..b0657eef30cf 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -129,12 +129,23 @@ SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDia
SvxHyperlinkNewDocTp::~SvxHyperlinkNewDocTp ()
{
- for ( sal_uInt16 n=0; n<m_pLbDocTypes->GetEntryCount(); n++ )
+ disposeOnce();
+}
+
+void SvxHyperlinkNewDocTp::dispose()
+{
+ if (m_pLbDocTypes)
{
- DocumentTypeData* pTypeData = static_cast<DocumentTypeData*>(
- m_pLbDocTypes->GetEntryData ( n ));
- delete pTypeData;
+ for ( sal_uInt16 n=0; n<m_pLbDocTypes->GetEntryCount(); n++ )
+ delete static_cast<DocumentTypeData*>(m_pLbDocTypes->GetEntryData ( n ));
+ m_pLbDocTypes = NULL;
}
+ m_pRbtEditNow.clear();
+ m_pRbtEditLater.clear();
+ m_pCbbPath.clear();
+ m_pBtCreate.clear();
+ m_pLbDocTypes.clear();
+ SvxHyperlinkTabPageBase::dispose();
}
/*************************************************************************
@@ -232,9 +243,9 @@ void SvxHyperlinkNewDocTp::GetCurentItemData ( OUString& rStrURL, OUString& aStr
|*
|************************************************************************/
-IconChoicePage* SvxHyperlinkNewDocTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr<IconChoicePage> SvxHyperlinkNewDocTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
{
- return new SvxHyperlinkNewDocTp( pWindow, pDlg, rItemSet );
+ return VclPtr<SvxHyperlinkNewDocTp>::Create( pWindow, pDlg, rItemSet );
}
/*************************************************************************
@@ -260,8 +271,8 @@ bool SvxHyperlinkNewDocTp::AskApply()
bool bRet = ImplGetURLObject( m_pCbbPath->GetText(), m_pCbbPath->GetBaseURL(), aINetURLObject );
if ( !bRet )
{
- WarningBox aWarning( this, WB_OK, CUI_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) );
- aWarning.Execute();
+ ScopedVclPtrInstance< WarningBox > aWarning( this, WB_OK, CUI_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) );
+ aWarning->Execute();
}
return bRet;
}
@@ -310,8 +321,8 @@ void SvxHyperlinkNewDocTp::DoApply ()
if( bOk )
{
- WarningBox aWarning( this, WB_YES_NO, CUI_RESSTR(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) );
- bCreate = aWarning.Execute() == RET_YES;
+ ScopedVclPtrInstance<WarningBox> aWarning( this, WB_YES_NO, CUI_RESSTR(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) );
+ bCreate = aWarning->Execute() == RET_YES;
}
}
diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx
index 11fe8e63db34..fd9340d599b2 100644
--- a/cui/source/dialogs/hldoctp.cxx
+++ b/cui/source/dialogs/hldoctp.cxx
@@ -71,8 +71,19 @@ SvxHyperlinkDocTp::SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* p
maTimer.SetTimeoutHdl ( LINK ( this, SvxHyperlinkDocTp, TimeoutHdl_Impl ) );
}
-SvxHyperlinkDocTp::~SvxHyperlinkDocTp ()
+SvxHyperlinkDocTp::~SvxHyperlinkDocTp()
{
+ disposeOnce();
+}
+
+void SvxHyperlinkDocTp::dispose()
+{
+ m_pCbbPath.clear();
+ m_pBtFileopen.clear();
+ m_pEdTarget.clear();
+ m_pFtFullURL.clear();
+ m_pBtBrowse.clear();
+ SvxHyperlinkTabPageBase::dispose();
}
/*************************************************************************
@@ -157,9 +168,9 @@ void SvxHyperlinkDocTp::GetCurentItemData ( OUString& rStrURL, OUString& aStrNam
|*
|************************************************************************/
-IconChoicePage* SvxHyperlinkDocTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr<IconChoicePage> SvxHyperlinkDocTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
{
- return new SvxHyperlinkDocTp( pWindow, pDlg, rItemSet );
+ return VclPtr<SvxHyperlinkDocTp>::Create( pWindow, pDlg, rItemSet );
}
/*************************************************************************
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 3c7bfcc1c4a4..e6cb7c0a4b31 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -81,8 +81,23 @@ SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( vcl::Window *pParent,
maTimer.SetTimeoutHdl ( LINK ( this, SvxHyperlinkInternetTp, TimeoutHdl_Impl ) );
}
-SvxHyperlinkInternetTp::~SvxHyperlinkInternetTp ()
+SvxHyperlinkInternetTp::~SvxHyperlinkInternetTp()
{
+ disposeOnce();
+}
+
+void SvxHyperlinkInternetTp::dispose()
+{
+ m_pRbtLinktypInternet.clear();
+ m_pRbtLinktypFTP.clear();
+ m_pCbbTarget.clear();
+ m_pBtBrowse.clear();
+ m_pFtLogin.clear();
+ m_pEdLogin.clear();
+ m_pFtPassword.clear();
+ m_pEdPassword.clear();
+ m_pCbAnonymous.clear();
+ SvxHyperlinkTabPageBase::dispose();
}
/*************************************************************************
@@ -187,9 +202,9 @@ OUString SvxHyperlinkInternetTp::CreateAbsoluteURL() const
|*
|************************************************************************/
-IconChoicePage* SvxHyperlinkInternetTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr<IconChoicePage> SvxHyperlinkInternetTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
{
- return new SvxHyperlinkInternetTp( pWindow, pDlg, rItemSet );
+ return VclPtr<SvxHyperlinkInternetTp>::Create( pWindow, pDlg, rItemSet );
}
/*************************************************************************
@@ -401,7 +416,7 @@ IMPL_LINK_NOARG(SvxHyperlinkInternetTp, ClickBrowseHdl_Impl)
SfxBoolItem aBrowse( SID_BROWSE, true );
const SfxPoolItem *ppItems[] = { &aName, &aNewView, &aSilent, &aReadOnly, &aRefererItem, &aBrowse, NULL };
- static_cast<SvxHpLinkDlg*>(mpDialog)->GetBindings()->Execute( SID_OPENDOC, ppItems, 0, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
+ static_cast<SvxHpLinkDlg*>(mpDialog.get())->GetBindings()->Execute( SID_OPENDOC, ppItems, 0, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
return 0L;
}
diff --git a/cui/source/dialogs/hlmailtp.cxx b/cui/source/dialogs/hlmailtp.cxx
index 5c114ff317f0..10336197a848 100644
--- a/cui/source/dialogs/hlmailtp.cxx
+++ b/cui/source/dialogs/hlmailtp.cxx
@@ -66,8 +66,18 @@ SvxHyperlinkMailTp::SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog*
m_pBtAdrBook->Hide();
}
-SvxHyperlinkMailTp::~SvxHyperlinkMailTp ()
+SvxHyperlinkMailTp::~SvxHyperlinkMailTp()
{
+ disposeOnce();
+}
+
+void SvxHyperlinkMailTp::dispose()
+{
+ m_pCbbReceiver.clear();
+ m_pBtAdrBook.clear();
+ m_pFtSubject.clear();
+ m_pEdSubject.clear();
+ SvxHyperlinkTabPageBase::dispose();
}
/*************************************************************************
@@ -161,9 +171,9 @@ OUString SvxHyperlinkMailTp::CreateAbsoluteURL() const
|*
|************************************************************************/
-IconChoicePage* SvxHyperlinkMailTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr<IconChoicePage> SvxHyperlinkMailTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
{
- return new SvxHyperlinkMailTp( pWindow, pDlg, rItemSet );
+ return VclPtr<SvxHyperlinkMailTp>::Create( pWindow, pDlg, rItemSet );
}
/*************************************************************************
diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx
index a2b83836abf2..80b8690d5713 100644
--- a/cui/source/dialogs/hlmarkwn.cxx
+++ b/cui/source/dialogs/hlmarkwn.cxx
@@ -72,6 +72,17 @@ SvxHlmarkTreeLBox::SvxHlmarkTreeLBox(vcl::Window* pParent, WinBits nStyle)
SetNodeDefaultImages();
}
+SvxHlmarkTreeLBox::~SvxHlmarkTreeLBox()
+{
+ disposeOnce();
+}
+
+void SvxHlmarkTreeLBox::dispose()
+{
+ mpParentWnd.clear();
+ SvTreeListBox::dispose();
+}
+
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxHlmarkTreeLBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
{
WinBits nWinStyle = WB_TABSTOP;
@@ -150,7 +161,17 @@ SvxHlinkDlgMarkWnd::SvxHlinkDlgMarkWnd( SvxHyperlinkTabPageBase *pParent )
SvxHlinkDlgMarkWnd::~SvxHlinkDlgMarkWnd()
{
+ disposeOnce();
+}
+
+void SvxHlinkDlgMarkWnd::dispose()
+{
ClearTree();
+ mpBtApply.clear();
+ mpBtClose.clear();
+ mpLbTree.clear();
+ mpParent.clear();
+ ModalDialog::dispose();
}
/*************************************************************************
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 293b04069896..9260c684cfac 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -105,11 +105,25 @@ SvxHyperlinkTabPageBase::SvxHyperlinkTabPageBase ( vcl::Window *pParent,
mpMarkWnd = new SvxHlinkDlgMarkWnd ( this );
}
-SvxHyperlinkTabPageBase::~SvxHyperlinkTabPageBase ()
+SvxHyperlinkTabPageBase::~SvxHyperlinkTabPageBase()
+{
+ disposeOnce();
+}
+
+void SvxHyperlinkTabPageBase::dispose()
{
maTimer.Stop();
- delete mpMarkWnd;
+ mpMarkWnd.disposeAndClear();
+
+ mpCbbFrame.clear();
+ mpLbForm.clear();
+ mpEdIndication.clear();
+ mpEdText.clear();
+ mpBtScript.clear();
+ mpDialog.clear();
+
+ IconChoicePage::dispose();
}
void SvxHyperlinkTabPageBase::ActivatePage()
@@ -283,13 +297,13 @@ void SvxHyperlinkTabPageBase::SetInitFocus()
// Ask dialog whether the curretn doc is a HTML-doc
bool SvxHyperlinkTabPageBase::IsHTMLDoc() const
{
- return static_cast<SvxHpLinkDlg*>(mpDialog)->IsHTMLDoc();
+ return static_cast<SvxHpLinkDlg*>(mpDialog.get())->IsHTMLDoc();
}
// retrieve dispatcher
SfxDispatcher* SvxHyperlinkTabPageBase::GetDispatcher() const
{
- return static_cast<SvxHpLinkDlg*>(mpDialog)->GetDispatcher();
+ return static_cast<SvxHpLinkDlg*>(mpDialog.get())->GetDispatcher();
}
// Click on imagebutton : Script
@@ -319,10 +333,10 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
bool bIsInputEnabled = GetParent()->IsInputEnabled();
if ( bIsInputEnabled )
GetParent()->EnableInput( false );
- SfxMacroAssignDlg aDlg( this, mxDocumentFrame, *pItemSet );
+ ScopedVclPtrInstance< SfxMacroAssignDlg > aDlg( this, mxDocumentFrame, *pItemSet );
// add events
- SfxMacroTabPage *pMacroPage = static_cast<SfxMacroTabPage*>( aDlg.GetTabPage() );
+ SfxMacroTabPage *pMacroPage = static_cast<SfxMacroTabPage*>( aDlg->GetTabPage() );
if ( pHyperlinkItem->GetMacroEvents() & HYPERDLG_EVENT_MOUSEOVER_OBJECT )
pMacroPage->AddEvent( OUString( CUI_RESSTR(RID_SVXSTR_HYPDLG_MACROACT1) ),
@@ -338,11 +352,11 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
GetParent()->EnableInput( true );
// execute dlg
DisableClose( true );
- short nRet = aDlg.Execute();
+ short nRet = aDlg->Execute();
DisableClose( false );
if ( RET_OK == nRet )
{
- const SfxItemSet* pOutSet = aDlg.GetOutputItemSet();
+ const SfxItemSet* pOutSet = aDlg->GetOutputItemSet();
const SfxPoolItem* pItem;
if( SfxItemState::SET == pOutSet->GetItemState( SID_ATTR_MACROITEM, false, &pItem ))
{
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index c6c7bb19b71c..e124a435fefc 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -512,9 +512,22 @@ SvxHyphenWordDialog::SvxHyphenWordDialog(
Enable( false );
}
-
SvxHyphenWordDialog::~SvxHyphenWordDialog()
{
+ disposeOnce();
+}
+
+void SvxHyphenWordDialog::dispose()
+{
+ m_pWordEdit.clear();
+ m_pLeftBtn.clear();
+ m_pRightBtn.clear();
+ m_pOkBtn.clear();
+ m_pContBtn.clear();
+ m_pDelBtn.clear();
+ m_pHyphAll.clear();
+ m_pCloseBtn.clear();
+ SfxModalDialog::dispose();
}
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 1c999e3cde65..d1c8c3523e9d 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -52,9 +52,15 @@ IconChoicePage::IconChoicePage( vcl::Window *pParent, const OString& rID,
}
-
IconChoicePage::~IconChoicePage()
{
+ disposeOnce();
+}
+
+void IconChoicePage::dispose()
+{
+ pDialog.clear();
+ TabPage::dispose();
}
/**********************************************************************
@@ -150,8 +156,8 @@ void IconChoicePage::DataChanged( const DataChangedEvent& rDCEvt )
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvtIconChoiceCtrl(vcl::Window *pParent, VclBuilder::stringmap &)
{
return new SvtIconChoiceCtrl(pParent, WB_3DLOOK | WB_ICON | WB_BORDER |
- WB_NOCOLUMNHEADER | WB_HIGHLIGHTFRAME |
- WB_NODRAGSELECTION | WB_TABSTOP);
+ WB_NOCOLUMNHEADER | WB_HIGHLIGHTFRAME |
+ WB_NODRAGSELECTION | WB_TABSTOP);
}
IconChoiceDialog::IconChoiceDialog ( vcl::Window* pParent, const OUString& rID,
@@ -209,6 +215,11 @@ IconChoiceDialog::IconChoiceDialog ( vcl::Window* pParent, const OUString& rID,
IconChoiceDialog ::~IconChoiceDialog ()
{
+ disposeOnce();
+}
+
+void IconChoiceDialog::dispose()
+{
// save configuration at INI-Manager
// and remove pages
//SvtViewOptions aTabDlgOpt( E_TABDIALOG, rId );
@@ -231,22 +242,35 @@ IconChoiceDialog ::~IconChoiceDialog ()
if ( pData->bOnDemand )
delete &pData->pPage->GetItemSet();
- delete pData->pPage;
+ pData->pPage.disposeAndClear();
}
delete pData;
}
+ maPageList.clear();
- // remove Userdata from Icons
- for ( sal_uLong i=0; i < m_pIconCtrl->GetEntryCount(); i++)
+ if (m_pIconCtrl)
{
- SvxIconChoiceCtrlEntry* pEntry = m_pIconCtrl->GetEntry ( i );
- sal_uInt16* pUserData = static_cast<sal_uInt16*>(pEntry->GetUserData());
- delete pUserData;
+ // remove Userdata from Icons
+ for ( sal_uLong i=0; i < m_pIconCtrl->GetEntryCount(); i++)
+ {
+ SvxIconChoiceCtrlEntry* pEntry = m_pIconCtrl->GetEntry ( i );
+ delete static_cast<sal_uInt16*>(pEntry->GetUserData());
+ }
}
-
delete pRanges;
+ pRanges = NULL;
delete pOutSet;
+ pOutSet = NULL;
+
+ m_pIconCtrl.clear();
+ m_pOKBtn.clear();
+ m_pApplyBtn.clear();
+ m_pCancelBtn.clear();
+ m_pHelpBtn.clear();
+ m_pResetBtn.clear();
+ m_pTabContainer.clear();
+ ModalDialog::dispose();
}
/**********************************************************************
@@ -532,7 +556,7 @@ bool IconChoiceDialog::DeActivatePageImpl ()
for ( size_t i = 0, nCount = maPageList.size(); i < nCount; ++i )
{
IconChoicePageData* pObj = maPageList[ i ];
- if ( pObj->pPage != pPage )
+ if ( pObj->pPage.get() != pPage )
pObj->bRefresh = true;
else
pObj->bRefresh = false;
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index fc9d8218c97d..0b24ea2a535c 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -191,6 +191,24 @@ SvInsertOleDlg::SvInsertOleDlg
RadioHdl( NULL );
}
+SvInsertOleDlg::~SvInsertOleDlg()
+{
+ disposeOnce();
+}
+
+void SvInsertOleDlg::dispose()
+{
+ m_pRbNewObject.clear();
+ m_pRbObjectFromfile.clear();
+ m_pObjectTypeFrame.clear();
+ m_pLbObjecttype.clear();
+ m_pFileFrame.clear();
+ m_pEdFilepath.clear();
+ m_pBtnFilepath.clear();
+ m_pCbFilelink.clear();
+ InsertObjectDialog_Impl::dispose();
+}
+
short SvInsertOleDlg::Execute()
{
short nRet = RET_OK;
@@ -395,10 +413,18 @@ SvInsertPlugInDialog::SvInsertPlugInDialog(vcl::Window* pParent,
SvInsertPlugInDialog::~SvInsertPlugInDialog()
{
- delete m_pURL;
+ disposeOnce();
}
-
+void SvInsertPlugInDialog::dispose()
+{
+ delete m_pURL;
+ m_pURL = NULL;
+ m_pEdFileurl.clear();
+ m_pBtnFileurl.clear();
+ m_pEdPluginsOptions.clear();
+ InsertObjectDialog_Impl::dispose();
+}
static void Plugin_ImplFillCommandSequence( const OUString& aCommands, uno::Sequence< beans::PropertyValue >& aCommandSequence )
{
@@ -489,6 +515,30 @@ SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog( vcl::Window *pParent
Init();
}
+SfxInsertFloatingFrameDialog::~SfxInsertFloatingFrameDialog()
+{
+ disposeOnce();
+}
+
+void SfxInsertFloatingFrameDialog::dispose()
+{
+ m_pEDName.clear();
+ m_pEDURL.clear();
+ m_pBTOpen.clear();
+ m_pRBScrollingOn.clear();
+ m_pRBScrollingOff.clear();
+ m_pRBScrollingAuto.clear();
+ m_pRBFrameBorderOn.clear();
+ m_pRBFrameBorderOff.clear();
+ m_pFTMarginWidth.clear();
+ m_pNMMarginWidth.clear();
+ m_pCBMarginWidthDefault.clear();
+ m_pFTMarginHeight.clear();
+ m_pNMMarginHeight.clear();
+ m_pCBMarginHeightDefault.clear();
+ InsertObjectDialog_Impl::dispose();
+}
+
void SfxInsertFloatingFrameDialog::Init()
{
get(m_pEDName, "edname");
diff --git a/cui/source/dialogs/insrc.cxx b/cui/source/dialogs/insrc.cxx
index ef1eecff6a99..13f18c3b5493 100644
--- a/cui/source/dialogs/insrc.cxx
+++ b/cui/source/dialogs/insrc.cxx
@@ -33,21 +33,29 @@ sal_uInt16 SvxInsRowColDlg::getInsertCount() const
}
SvxInsRowColDlg::SvxInsRowColDlg(vcl::Window* pParent, bool bCol, const OString& sHelpId )
- : ModalDialog(pParent, "InsertRowColumnDialog", "cui/ui/insertrowcolumn.ui")
+ : m_pDialog(VclPtr<ModalDialog>::Create(pParent, "InsertRowColumnDialog", "cui/ui/insertrowcolumn.ui"))
, aRow(CUI_RESSTR(RID_SVXSTR_ROW))
, aCol(CUI_RESSTR(RID_SVXSTR_COL))
, bColumn(bCol)
{
- get(m_pCountEdit, "insert_number");
- get(m_pBeforeBtn, "insert_before");
- get(m_pAfterBtn, "insert_after");
- SetText( bColumn ? aCol : aRow );
- SetHelpId( sHelpId );
+ m_pDialog->get(m_pCountEdit, "insert_number");
+ m_pDialog->get(m_pBeforeBtn, "insert_before");
+ m_pDialog->get(m_pAfterBtn, "insert_after");
+ m_pDialog->SetText( bColumn ? aCol : aRow );
+ m_pDialog->SetHelpId( sHelpId );
+}
+
+SvxInsRowColDlg::~SvxInsRowColDlg()
+{
+ m_pCountEdit.clear();
+ m_pBeforeBtn.clear();
+ m_pAfterBtn.clear();
+ m_pDialog.disposeAndClear();
}
short SvxInsRowColDlg::Execute()
{
- return ModalDialog::Execute();
+ return m_pDialog->Execute();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index 505df5a9b4a4..0995ae4c6ad5 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -145,6 +145,22 @@ SvBaseLinksDlg::SvBaseLinksDlg( vcl::Window * pParent, LinkManager* pMgr, bool b
SvBaseLinksDlg::~SvBaseLinksDlg()
{
+ disposeOnce();
+}
+
+void SvBaseLinksDlg::dispose()
+{
+ m_pTbLinks.clear();
+ m_pFtFullFileName.clear();
+ m_pFtFullSourceName.clear();
+ m_pFtFullTypeName.clear();
+ m_pRbAutomatic.clear();
+ m_pRbManual.clear();
+ m_pPbUpdateNow.clear();
+ m_pPbOpenSource.clear();
+ m_pPbChangeSource.clear();
+ m_pPbBreakLink.clear();
+ ModalDialog::dispose();
}
/*************************************************************************
@@ -428,9 +444,9 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
if( !xLink.Is() )
return 0;
- QueryBox aBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() );
+ ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() );
- if( RET_YES == aBox.Execute() )
+ if( RET_YES == aBox->Execute() )
{
m_pTbLinks->GetModel()->Remove( m_pTbLinks->GetEntry( nPos ) );
@@ -459,9 +475,9 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
}
else
{
- QueryBox aBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() );
+ ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() );
- if( RET_YES == aBox.Execute() )
+ if( RET_YES == aBox->Execute() )
{
SvBaseLinkMemberList aLinkList;
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index e4adae253e24..8cdc64439efa 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -186,7 +186,7 @@ SvxMultiPathDialog::SvxMultiPathDialog(vcl::Window* pParent)
Size aSize(LogicToPixel(Size(195, 77), MAP_APPFONT));
pRadioLBContainer->set_width_request(aSize.Width());
pRadioLBContainer->set_height_request(aSize.Height());
- m_pRadioLB = new svx::SvxRadioButtonListBox(*pRadioLBContainer, 0);
+ m_pRadioLB = VclPtr<svx::SvxRadioButtonListBox>::Create(*pRadioLBContainer, 0);
static long aStaticTabs[]= { 2, 0, 12 };
m_pRadioLB->SvSimpleTable::SetTabs( aStaticTabs );
@@ -224,21 +224,44 @@ SvxPathSelectDialog::SvxPathSelectDialog(vcl::Window* pParent)
SvxMultiPathDialog::~SvxMultiPathDialog()
{
- sal_uInt16 nPos = (sal_uInt16)m_pRadioLB->GetEntryCount();
- while ( nPos-- )
+ disposeOnce();
+}
+
+void SvxMultiPathDialog::dispose()
+{
+ if (m_pRadioLB)
{
- SvTreeListEntry* pEntry = m_pRadioLB->GetEntry( nPos );
- delete static_cast<OUString*>(pEntry->GetUserData());
+ sal_uInt16 nPos = (sal_uInt16)m_pRadioLB->GetEntryCount();
+ while ( nPos-- )
+ {
+ SvTreeListEntry* pEntry = m_pRadioLB->GetEntry( nPos );
+ delete static_cast<OUString*>(pEntry->GetUserData());
+ }
}
- delete m_pRadioLB;
+ m_pRadioLB.disposeAndClear();
+ m_pAddBtn.clear();
+ m_pDelBtn.clear();
+ ModalDialog::dispose();
}
SvxPathSelectDialog::~SvxPathSelectDialog()
{
- sal_uInt16 nPos = m_pPathLB->GetEntryCount();
- while ( nPos-- )
- delete static_cast<OUString*>(m_pPathLB->GetEntryData(nPos));
+ disposeOnce();
+}
+
+void SvxPathSelectDialog::dispose()
+{
+ if (m_pPathLB)
+ {
+ sal_uInt16 nPos = m_pPathLB->GetEntryCount();
+ while ( nPos-- )
+ delete static_cast<OUString*>(m_pPathLB->GetEntryData(nPos));
+ }
+ m_pPathLB.clear();
+ m_pAddBtn.clear();
+ m_pDelBtn.clear();
+ ModalDialog::dispose();
}
OUString SvxMultiPathDialog::GetPath() const
diff --git a/cui/source/dialogs/newtabledlg.cxx b/cui/source/dialogs/newtabledlg.cxx
index ae6a0e757fa2..a83e11ac991f 100644
--- a/cui/source/dialogs/newtabledlg.cxx
+++ b/cui/source/dialogs/newtabledlg.cxx
@@ -22,15 +22,22 @@
#include "newtabledlg.hxx"
SvxNewTableDialog::SvxNewTableDialog( vcl::Window* pParent )
-: ModalDialog( pParent, "NewTableDialog", "cui/ui/newtabledialog.ui" )
+ : m_pDialog( VclPtr<ModalDialog>::Create( pParent, "NewTableDialog", "cui/ui/newtabledialog.ui" ) )
{
- get(mpNumRows, "rows");
- get(mpNumColumns, "columns");
+ m_pDialog->get(mpNumRows, "rows");
+ m_pDialog->get(mpNumColumns, "columns");
+}
+
+SvxNewTableDialog::~SvxNewTableDialog()
+{
+ mpNumColumns.clear();
+ mpNumRows.clear();
+ m_pDialog.disposeAndClear();
}
short SvxNewTableDialog::Execute()
{
- return ModalDialog::Execute();
+ return m_pDialog->Execute();
}
sal_Int32 SvxNewTableDialog::getRows() const
diff --git a/cui/source/dialogs/passwdomdlg.cxx b/cui/source/dialogs/passwdomdlg.cxx
index bca8cd9c211e..1b47dda9aa79 100644
--- a/cui/source/dialogs/passwdomdlg.cxx
+++ b/cui/source/dialogs/passwdomdlg.cxx
@@ -31,15 +31,15 @@
struct PasswordToOpenModifyDialog_Impl
{
- PasswordToOpenModifyDialog * m_pParent;
+ VclPtr<PasswordToOpenModifyDialog> m_pParent;
- Edit* m_pPasswdToOpenED;
- Edit* m_pReenterPasswdToOpenED;
- VclExpander* m_pOptionsExpander;
- OKButton* m_pOk;
- CheckBox* m_pOpenReadonlyCB;
- Edit* m_pPasswdToModifyED;
- Edit* m_pReenterPasswdToModifyED;
+ VclPtr<Edit> m_pPasswdToOpenED;
+ VclPtr<Edit> m_pReenterPasswdToOpenED;
+ VclPtr<VclExpander> m_pOptionsExpander;
+ VclPtr<OKButton> m_pOk;
+ VclPtr<CheckBox> m_pOpenReadonlyCB;
+ VclPtr<Edit> m_pPasswdToModifyED;
+ VclPtr<Edit> m_pReenterPasswdToModifyED;
OUString m_aOneMismatch;
OUString m_aTwoMismatch;
@@ -101,9 +101,9 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG
m_pPasswdToModifyED->GetText().isEmpty();
if (bInvalidState)
{
- MessageDialog aErrorBox(m_pParent,
+ ScopedVclPtrInstance<MessageDialog> aErrorBox(m_pParent,
m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2);
- aErrorBox.Execute();
+ aErrorBox->Execute();
}
else // check for mismatched passwords...
{
@@ -112,8 +112,8 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG
const int nMismatch = (bToOpenMatch? 0 : 1) + (bToModifyMatch? 0 : 1);
if (nMismatch > 0)
{
- MessageDialog aErrorBox(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch);
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch);
+ aErrorBox->Execute();
Edit* pEdit = !bToOpenMatch ? m_pPasswdToOpenED : m_pPasswdToModifyED;
Edit* pRepeatEdit = !bToOpenMatch? m_pReenterPasswdToOpenED : m_pReenterPasswdToModifyED;
@@ -153,6 +153,12 @@ PasswordToOpenModifyDialog::PasswordToOpenModifyDialog(
PasswordToOpenModifyDialog::~PasswordToOpenModifyDialog()
{
+ disposeOnce();
+}
+
+void PasswordToOpenModifyDialog::dispose()
+{
+ SfxModalDialog::dispose();
}
diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx
index a7478f5c23df..ff6263a2587e 100644
--- a/cui/source/dialogs/pastedlg.cxx
+++ b/cui/source/dialogs/pastedlg.cxx
@@ -52,6 +52,19 @@ SvPasteObjectDialog::SvPasteObjectDialog( vcl::Window* pParent )
ObjectLB().SetDoubleClickHdl( LINK( this, SvPasteObjectDialog, DoubleClickHdl ) );
}
+SvPasteObjectDialog::~SvPasteObjectDialog()
+{
+ disposeOnce();
+}
+
+void SvPasteObjectDialog::dispose()
+{
+ m_pFtObjectSource.clear();
+ m_pLbInsertList.clear();
+ m_pOKButton.clear();
+ ModalDialog::dispose();
+}
+
void SvPasteObjectDialog::SelectObject()
{
if (m_pLbInsertList->GetEntryCount())
@@ -79,10 +92,6 @@ IMPL_LINK_INLINE_START( SvPasteObjectDialog, DoubleClickHdl, ListBox *, pListBox
}
IMPL_LINK_INLINE_END( SvPasteObjectDialog, DoubleClickHdl, ListBox *, pListBox )
-SvPasteObjectDialog::~SvPasteObjectDialog()
-{
-}
-
/*************************************************************************
|* SvPasteObjectDialog::Insert()
*************************************************************************/
diff --git a/cui/source/dialogs/postdlg.cxx b/cui/source/dialogs/postdlg.cxx
index b740fd9e91bb..c1e43e1939c4 100644
--- a/cui/source/dialogs/postdlg.cxx
+++ b/cui/source/dialogs/postdlg.cxx
@@ -124,8 +124,21 @@ SvxPostItDialog::SvxPostItDialog(vcl::Window* pParent, const SfxItemSet& rCoreSe
SvxPostItDialog::~SvxPostItDialog()
{
+ disposeOnce();
+}
+
+void SvxPostItDialog::dispose()
+{
delete pOutSet;
pOutSet = 0;
+ m_pLastEditFT.clear();
+ m_pEditED.clear();
+ m_pInsertAuthor.clear();
+ m_pAuthorBtn.clear();
+ m_pOKBtn.clear();
+ m_pPrevBtn.clear();
+ m_pNextBtn.clear();
+ SfxModalDialog::dispose();
}
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 2e4a87157ec5..98a97d0e8656 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -96,12 +96,18 @@ SFTreeListBox::SFTreeListBox(vcl::Window* pParent)
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSFTreeListBox(vcl::Window *pParent, VclBuilder::stringmap &)
{
- return new SFTreeListBox(pParent);
+ return VclPtr<SFTreeListBox>::Create(pParent);
}
SFTreeListBox::~SFTreeListBox()
{
+ disposeOnce();
+}
+
+void SFTreeListBox::dispose()
+{
deleteAllTree();
+ SvTreeListBox::dispose();
}
void SFTreeListBox::delUserData( SvTreeListEntry* pEntry )
@@ -437,6 +443,17 @@ CuiInputDialog::CuiInputDialog(vcl::Window * pParent, sal_uInt16 nMode )
}
}
+CuiInputDialog::~CuiInputDialog()
+{
+ disposeOnce();
+}
+
+void CuiInputDialog::dispose()
+{
+ m_pEdit.clear();
+ ModalDialog::dispose();
+}
+
// ScriptOrgDialog ------------------------------------------------------------
@@ -487,8 +504,21 @@ SvxScriptOrgDialog::SvxScriptOrgDialog( vcl::Window* pParent, const OUString& la
SvxScriptOrgDialog::~SvxScriptOrgDialog()
{
+ disposeOnce();
+}
+
+void SvxScriptOrgDialog::dispose()
+{
// clear the SelectHdl so that it isn't called during the dtor
m_pScriptsBox->SetSelectHdl( Link() );
+ m_pScriptsBox.clear();
+ m_pRunButton.clear();
+ m_pCloseButton.clear();
+ m_pCreateButton.clear();
+ m_pEditButton.clear();
+ m_pRenameButton.clear();
+ m_pDelButton.clear();
+ SfxModalDialog::dispose();
};
short SvxScriptOrgDialog::Execute()
@@ -876,7 +906,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
}
}
- boost::scoped_ptr< CuiInputDialog > xNewDlg( new CuiInputDialog( static_cast<vcl::Window*>(this), nMode ) );
+ ScopedVclPtrInstance< CuiInputDialog > xNewDlg( static_cast<vcl::Window*>(this), nMode );
xNewDlg->SetObjectName( aNewName );
do
@@ -892,9 +922,9 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
bValid = false;
OUString aError( m_createErrStr );
aError += m_createDupStr;
- MessageDialog aErrorBox(static_cast<vcl::Window*>(this), aError);
- aErrorBox.SetText( m_createErrTitleStr );
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError);
+ aErrorBox->SetText( m_createErrTitleStr );
+ aErrorBox->Execute();
xNewDlg->SetObjectName( aNewName );
break;
}
@@ -974,9 +1004,9 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
{
//ISSUE L10N & message from exception?
OUString aError( m_createErrStr );
- MessageDialog aErrorBox(static_cast<vcl::Window*>(this), aError);
- aErrorBox.SetText( m_createErrTitleStr );
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError);
+ aErrorBox->SetText( m_createErrTitleStr );
+ aErrorBox->Execute();
}
}
@@ -999,7 +1029,7 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry )
}
sal_uInt16 nMode = INPUTMODE_RENAME;
- boost::scoped_ptr< CuiInputDialog > xNewDlg( new CuiInputDialog( static_cast<vcl::Window*>(this), nMode ) );
+ ScopedVclPtrInstance< CuiInputDialog > xNewDlg( static_cast<vcl::Window*>(this), nMode );
xNewDlg->SetObjectName( aNewName );
bool bValid;
@@ -1050,9 +1080,9 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry )
{
//ISSUE L10N & message from exception?
OUString aError( m_renameErrStr );
- MessageDialog aErrorBox(static_cast<vcl::Window*>(this), aError);
- aErrorBox.SetText( m_renameErrTitleStr );
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError);
+ aErrorBox->SetText( m_renameErrTitleStr );
+ aErrorBox->Execute();
}
}
void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
@@ -1061,9 +1091,9 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
Reference< browse::XBrowseNode > node = getBrowseNode( pEntry );
// ISSUE L10N string & can we centre list?
OUString aQuery = m_delQueryStr + getListOfChildren( node, 0 );
- MessageDialog aQueryBox(static_cast<vcl::Window*>(this), aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- aQueryBox.SetText( m_delQueryTitleStr );
- if ( aQueryBox.Execute() == RET_NO )
+ VclPtrInstance< MessageDialog > aQueryBox(static_cast<vcl::Window*>(this), aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ aQueryBox->SetText( m_delQueryTitleStr );
+ if ( aQueryBox->Execute() == RET_NO )
{
return;
}
@@ -1096,9 +1126,9 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
else
{
//ISSUE L10N & message from exception?
- MessageDialog aErrorBox(static_cast<vcl::Window*>(this), m_delErrStr);
- aErrorBox.SetText( m_delErrTitleStr );
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), m_delErrStr);
+ aErrorBox->SetText( m_delErrTitleStr );
+ aErrorBox->Execute();
}
}
@@ -1468,11 +1498,10 @@ IMPL_LINK( SvxScriptErrorDialog, ShowDialog, OUString*, pMessage )
message = OUString( CUI_RES( RID_SVXSTR_ERROR_TITLE ) );
}
- MessageDialog* pBox = new MessageDialog(NULL, message, VCL_MESSAGE_WARNING);
+ ScopedVclPtrInstance<MessageDialog> pBox( nullptr, message, VCL_MESSAGE_WARNING );
pBox->SetText( CUI_RES( RID_SVXSTR_ERROR_TITLE ) );
pBox->Execute();
- delete pBox;
delete pMessage;
return 0;
diff --git a/cui/source/dialogs/showcols.cxx b/cui/source/dialogs/showcols.cxx
index 94e286ecd92d..4c86ac4da191 100644
--- a/cui/source/dialogs/showcols.cxx
+++ b/cui/source/dialogs/showcols.cxx
@@ -39,6 +39,17 @@ FmShowColsDialog::FmShowColsDialog(vcl::Window* pParent)
m_pOK->SetClickHdl( LINK( this, FmShowColsDialog, OnClickedOk ) );
}
+FmShowColsDialog::~FmShowColsDialog()
+{
+ disposeOnce();
+}
+
+void FmShowColsDialog::dispose()
+{
+ m_pList.clear();
+ m_pOK.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(FmShowColsDialog, OnClickedOk)
{
diff --git a/cui/source/dialogs/splitcelldlg.cxx b/cui/source/dialogs/splitcelldlg.cxx
index e3b6d18c58a3..69bfd0ec0051 100644
--- a/cui/source/dialogs/splitcelldlg.cxx
+++ b/cui/source/dialogs/splitcelldlg.cxx
@@ -24,16 +24,27 @@
#include "splitcelldlg.hxx"
#include "cuires.hrc"
+namespace {
+ class NoApplyDialog : public SvxStandardDialog
+ {
+ public:
+ NoApplyDialog(vcl::Window *pParent, const OUString &rId, const OUString &rXML) :
+ SvxStandardDialog(pParent, rId, rXML) { }
+ protected:
+ virtual void Apply() SAL_OVERRIDE {}
+ };
+}
+
SvxSplitTableDlg::SvxSplitTableDlg( vcl::Window *pParent, bool bIsTableVertical,
long nMaxVertical, long nMaxHorizontal )
- : SvxStandardDialog(pParent, "SplitCellsDialog", "cui/ui/splitcellsdialog.ui")
+ : m_pDialog(VclPtr<NoApplyDialog>::Create(pParent, "SplitCellsDialog", "cui/ui/splitcellsdialog.ui"))
, mnMaxVertical(nMaxVertical)
, mnMaxHorizontal(nMaxHorizontal)
{
- get(m_pCountEdit, "countnf");
- get(m_pHorzBox, "hori");
- get(m_pVertBox, "vert");
- get(m_pPropCB, "prop");
+ m_pDialog->get(m_pCountEdit, "countnf");
+ m_pDialog->get(m_pHorzBox, "hori");
+ m_pDialog->get(m_pVertBox, "vert");
+ m_pDialog->get(m_pPropCB, "prop");
m_pHorzBox->SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
m_pPropCB->SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
m_pVertBox->SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
@@ -55,6 +66,11 @@ SvxSplitTableDlg::SvxSplitTableDlg( vcl::Window *pParent, bool bIsTableVertical,
SvxSplitTableDlg::~SvxSplitTableDlg()
{
+ m_pCountEdit.clear();
+ m_pHorzBox.clear();
+ m_pVertBox.clear();
+ m_pPropCB.clear();
+ m_pDialog.disposeAndClear();
}
IMPL_LINK( SvxSplitTableDlg, ClickHdl, Button *, pButton )
@@ -83,11 +99,7 @@ long SvxSplitTableDlg::GetCount() const
short SvxSplitTableDlg::Execute()
{
- return SvxStandardDialog::Execute();
-}
-
-void SvxSplitTableDlg::Apply()
-{
+ return m_pDialog->Execute();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx
index 39fbcd2cc99a..44976012dad2 100644
--- a/cui/source/dialogs/srchxtra.cxx
+++ b/cui/source/dialogs/srchxtra.cxx
@@ -64,7 +64,14 @@ SvxSearchFormatDialog::SvxSearchFormatDialog(vcl::Window* pParent, const SfxItem
SvxSearchFormatDialog::~SvxSearchFormatDialog()
{
+ disposeOnce();
+}
+
+void SvxSearchFormatDialog::dispose()
+{
delete m_pFontList;
+ m_pFontList = NULL;
+ SfxTabDialog::dispose();
}
void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
@@ -171,6 +178,17 @@ SvxSearchAttributeDialog::SvxSearchAttributeDialog(vcl::Window* pParent,
m_pAttrLB->SelectEntryPos( 0 );
}
+SvxSearchAttributeDialog::~SvxSearchAttributeDialog()
+{
+ disposeOnce();
+}
+
+void SvxSearchAttributeDialog::dispose()
+{
+ m_pAttrLB.clear();
+ m_pOKBtn.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(SvxSearchAttributeDialog, OKHdl)
@@ -241,4 +259,18 @@ SvxSearchSimilarityDialog::SvxSearchSimilarityDialog
m_pRelaxBox->Check( bRelax );
}
+SvxSearchSimilarityDialog::~SvxSearchSimilarityDialog()
+{
+ disposeOnce();
+}
+
+void SvxSearchSimilarityDialog::dispose()
+{
+ m_pOtherFld.clear();
+ m_pLongerFld.clear();
+ m_pShorterFld.clear();
+ m_pRelaxBox.clear();
+ ModalDialog::dispose();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index 5ad4a5dae338..953bbc7b0e69 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -66,6 +66,17 @@ LookUpComboBox::LookUpComboBox(vcl::Window *pParent)
EnableAutocomplete( false );
}
+LookUpComboBox::~LookUpComboBox()
+{
+ disposeOnce();
+}
+
+void LookUpComboBox::dispose()
+{
+ m_pDialog.clear();
+ ComboBox::dispose();
+}
+
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeLookUpComboBox(vcl::Window *pParent, VclBuilder::stringmap &)
{
return new LookUpComboBox(pParent);
@@ -76,10 +87,6 @@ void LookUpComboBox::init(SvxThesaurusDialog *pDialog)
m_pDialog = pDialog;
}
-LookUpComboBox::~LookUpComboBox()
-{
-}
-
void LookUpComboBox::Modify()
{
m_aModifyIdle.Start();
@@ -100,13 +107,21 @@ ReplaceEdit::ReplaceEdit(vcl::Window *pParent)
{
}
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeReplaceEdit(vcl::Window *pParent, VclBuilder::stringmap &)
+ReplaceEdit::~ReplaceEdit()
{
- return new ReplaceEdit(pParent);
+ disposeOnce();
}
-ReplaceEdit::~ReplaceEdit()
+void ReplaceEdit::dispose()
{
+ m_pBtn.clear();
+ Edit::dispose();
+}
+
+
+extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeReplaceEdit(vcl::Window *pParent, VclBuilder::stringmap &)
+{
+ return new ReplaceEdit(pParent);
}
void ReplaceEdit::Modify()
@@ -178,7 +193,14 @@ void ThesaurusAlternativesCtrl::init(SvxThesaurusDialog *pDialog)
ThesaurusAlternativesCtrl::~ThesaurusAlternativesCtrl()
{
+ disposeOnce();
+}
+
+void ThesaurusAlternativesCtrl::dispose()
+{
ClearExtraData();
+ m_pDialog.clear();
+ SvxCheckListBox::dispose();
}
void ThesaurusAlternativesCtrl::ClearExtraData()
@@ -516,14 +538,25 @@ SvxThesaurusDialog::SvxThesaurusDialog(
Enable( false );
}
-IMPL_LINK( SvxThesaurusDialog, ReplaceBtnHdl_Impl, Button *, EMPTYARG /*pBtn*/ )
+SvxThesaurusDialog::~SvxThesaurusDialog()
{
- EndDialog(RET_OK);
- return 0;
+ disposeOnce();
}
-SvxThesaurusDialog::~SvxThesaurusDialog()
+void SvxThesaurusDialog::dispose()
+{
+ m_pLeftBtn.clear();
+ m_pWordCB.clear();
+ m_pAlternativesCT.clear();
+ m_pReplaceEdit.clear();
+ m_pLangLB.clear();
+ SvxStandardDialog::dispose();
+}
+
+IMPL_LINK( SvxThesaurusDialog, ReplaceBtnHdl_Impl, Button *, EMPTYARG /*pBtn*/ )
{
+ EndDialog(RET_OK);
+ return 0;
}
void SvxThesaurusDialog::SetWindowTitle( LanguageType nLanguage )
diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index 32dea8c5ab77..5b2dff90d8d0 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -289,7 +289,28 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
}
SvxZoomDialog::~SvxZoomDialog()
-{}
+{
+ disposeOnce();
+}
+
+void SvxZoomDialog::dispose()
+{
+ mpOutSet.reset();
+ m_pOptimalBtn.clear();
+ m_pWholePageBtn.clear();
+ m_pPageWidthBtn.clear();
+ m_p100Btn.clear();
+ m_pUserBtn.clear();
+ m_pUserEdit.clear();
+ m_pViewFrame.clear();
+ m_pAutomaticBtn.clear();
+ m_pSingleBtn.clear();
+ m_pColumnsBtn.clear();
+ m_pColumnsEdit.clear();
+ m_pBookModeChk.clear();
+ m_pOKBtn.clear();
+ SfxModalDialog::dispose();
+}
IMPL_LINK(SvxZoomDialog, UserHdl, RadioButton *, pButton)
{
diff --git a/cui/source/factory/cuiexp.cxx b/cui/source/factory/cuiexp.cxx
index 8bb9d51ef1f6..754d8b47a092 100644
--- a/cui/source/factory/cuiexp.cxx
+++ b/cui/source/factory/cuiexp.cxx
@@ -17,6 +17,35 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include "sfx2/basedlgs.hxx"
+#include "cuigaldlg.hxx"
+#include "hlmarkwn.hxx"
+#include "srchxtra.hxx"
+#include "cuisrchdlg.hxx"
+#include "transfrm.hxx"
+#include "labdlg.hxx"
+#include "cuitbxform.hxx"
+#include "optdict.hxx"
+#include "dlgname.hxx"
+#include "cuiimapwnd.hxx"
+#include "multipat.hxx"
+#include "cuifmsearch.hxx"
+#include "cuigrfflt.hxx"
+#include "cuitabarea.hxx"
+#include "insdlg.hxx"
+#include "pastedlg.hxx"
+#include "linkdlg.hxx"
+#include "postdlg.hxx"
+#include "passwdomdlg.hxx"
+#include "cuihyperdlg.hxx"
+#include "selector.hxx"
+#include "SpellDialog.hxx"
+#include "zoom.hxx"
+#include "showcols.hxx"
+#include "hyphen.hxx"
+#include "thesdlg.hxx"
+#include "hangulhanjadlg.hxx"
+#include "dstribut.hxx"
#include "dlgfact.hxx"
#include "sal/types.h"
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index f2f368ad4dc1..6158d9abceba 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -105,10 +105,11 @@ IMPL_ABSTDLG_BASE(AbstractFmShowColsDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractHyphenWordDialog_Impl)
IMPL_ABSTDLG_BASE(AbstractThesaurusDialog_Impl)
-AbstractSvxZoomDialog_Impl::~AbstractSvxZoomDialog_Impl() \
+AbstractSvxZoomDialog_Impl::~AbstractSvxZoomDialog_Impl()
{
- delete pDlg;
+ pDlg.disposeAndClear();
}
+
short AbstractSvxZoomDialog_Impl::Execute()
{
return pDlg->Execute();
@@ -154,7 +155,7 @@ IMPL_ABSTDLG_BASE(AbstractPasswordToOpenModifyDialog_Impl);
// virtual
VclAbstractDialog2_Impl::~VclAbstractDialog2_Impl()
{
- delete m_pDlg;
+ m_pDlg.disposeAndClear();
}
// virtual
@@ -970,12 +971,12 @@ bool AbstractPasswordToOpenModifyDialog_Impl::IsRecommendToOpenReadonly() const
// Create dialogs with simplest interface
VclAbstractDialog* AbstractDialogFactory_Impl::CreateVclDialog( vcl::Window* pParent, sal_uInt32 nResId )
{
- Dialog* pDlg=NULL;
+ VclPtr<Dialog> pDlg;
switch ( nResId )
{
case RID_DEFAULTABOUT:
{
- pDlg = new AboutDialog(pParent);
+ pDlg = VclPtr<AboutDialog>::Create(pParent);
break;
}
case SID_OPTIONS_TREEDIALOG :
@@ -986,7 +987,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateVclDialog( vcl::Window* pPa
if (nResId == SID_OPTIONS_TREEDIALOG)
bActivateLastSelection = true;
Reference< frame::XFrame > xFrame;
- OfaTreeOptionsDialog* pOptDlg = new OfaTreeOptionsDialog( pParent, xFrame, bActivateLastSelection );
+ VclPtrInstance<OfaTreeOptionsDialog> pOptDlg( pParent, xFrame, bActivateLastSelection );
if (nResId == SID_OPTIONS_DATABASES)
{
pOptDlg->ActivatePage(SID_SB_DBREGISTEROPTIONS);
@@ -996,7 +997,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateVclDialog( vcl::Window* pPa
//open the tab page "tools/options/languages"
pOptDlg->ActivatePage(OFA_TP_LANGUAGES_FOR_SET_DOCUMENT_LANGUAGE);
}
- pDlg = pOptDlg;
+ pDlg.reset(pOptDlg);
}
break;
default:
@@ -1018,17 +1019,17 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateFrameDialog(
vcl::Window* pParent, const Reference< frame::XFrame >& rxFrame,
sal_uInt32 nResId, const OUString& rParameter )
{
- Dialog* pDlg = NULL;
+ VclPtr<Dialog> pDlg;
if ( SID_OPTIONS_TREEDIALOG == nResId || SID_OPTIONS_DATABASES == nResId )
{
// only activate last page if we dont want to activate a special page
bool bActivateLastSelection = ( nResId != SID_OPTIONS_DATABASES && rParameter.isEmpty() );
- OfaTreeOptionsDialog* pOptDlg = new OfaTreeOptionsDialog( pParent, rxFrame, bActivateLastSelection );
+ VclPtrInstance<OfaTreeOptionsDialog> pOptDlg( pParent, rxFrame, bActivateLastSelection );
if ( nResId == SID_OPTIONS_DATABASES )
pOptDlg->ActivatePage(SID_SB_DBREGISTEROPTIONS);
else if ( !rParameter.isEmpty() )
pOptDlg->ActivatePage( rParameter );
- pDlg = pOptDlg;
+ pDlg.reset(pOptDlg);
}
if ( pDlg )
@@ -1049,10 +1050,10 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabDialog( sal_uInt32 nR
switch ( nResId )
{
case RID_OFA_AUTOCORR_DLG :
- pDlg = new OfaAutoCorrDlg( pParent, pAttrSet );
+ pDlg = VclPtr<OfaAutoCorrDlg>::Create( pParent, pAttrSet );
break;
case RID_SVXDLG_CUSTOMIZE :
- pDlg = new SvxConfigDialog( pParent, pAttrSet );
+ pDlg = VclPtr<SvxConfigDialog>::Create( pParent, pAttrSet );
break;
default:
break;
@@ -1070,17 +1071,17 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabDialog( sal_uInt32 nR
bool /*bEditFmt*/,
const OUString * )
{
- SfxTabDialog* pDlg=NULL;
+ VclPtr<SfxTabDialog> pDlg;
switch ( nResId )
{
case RID_OFA_AUTOCORR_DLG :
- pDlg = new OfaAutoCorrDlg( pParent, pAttrSet );
+ pDlg = VclPtr<OfaAutoCorrDlg>::Create( pParent, pAttrSet );
break;
case RID_SVXDLG_CUSTOMIZE :
{
- SvxConfigDialog* pDlg1 = new SvxConfigDialog( pParent, pAttrSet );
+ VclPtrInstance<SvxConfigDialog> pDlg1( pParent, pAttrSet );
pDlg1->SetFrame(xViewFrame);
- pDlg = (SfxTabDialog*)pDlg1;
+ pDlg.reset(pDlg1);
}
break;
default:
@@ -1098,7 +1099,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTextTabDialog( vcl::Wind
SdrView* pView,
SdrModel* )
{
- SfxTabDialog* pDlg = new SvxTextTabDialog( pParent, pAttrSet, pView );
+ VclPtrInstance<SvxTextTabDialog> pDlg( pParent, pAttrSet, pView );
return new CuiAbstractTabDialog_Impl( pDlg );
}
@@ -1107,7 +1108,7 @@ AbstractSvxCaptionDialog* AbstractDialogFactory_Impl::CreateCaptionDialog(
const SdrView* pView,
sal_uInt16 nAnchorTypes )
{
- SvxCaptionTabDialog* pDlg = new SvxCaptionTabDialog( pParent, pView, nAnchorTypes );
+ VclPtrInstance<SvxCaptionTabDialog> pDlg( pParent, pView, nAnchorTypes );
return new AbstractSvxCaptionDialog_Impl( pDlg );
}
@@ -1116,14 +1117,14 @@ AbstractSvxDistributeDialog* AbstractDialogFactory_Impl::CreateSvxDistributeD
SvxDistributeHorizontal eHor ,
SvxDistributeVertical eVer)
{
- SvxDistributeDialog* pDlg = new SvxDistributeDialog( pParent, rAttr, eHor, eVer);
+ VclPtrInstance<SvxDistributeDialog> pDlg( pParent, rAttr, eHor, eVer);
return new AbstractSvxDistributeDialog_Impl( pDlg );
}
AbstractHangulHanjaConversionDialog* AbstractDialogFactory_Impl::CreateHangulHanjaConversionDialog(vcl::Window* pParent,
editeng::HangulHanjaConversion::ConversionDirection _ePrimaryDirection )
{
- HangulHanjaConversionDialog* pDlg = new HangulHanjaConversionDialog( pParent, _ePrimaryDirection);
+ VclPtrInstance<HangulHanjaConversionDialog> pDlg( pParent, _ePrimaryDirection);
return new AbstractHangulHanjaConversionDialog_Impl( pDlg );
}
@@ -1131,7 +1132,7 @@ AbstractThesaurusDialog* AbstractDialogFactory_Impl::CreateThesaurusDialog( vcl:
css::uno::Reference< css::linguistic2::XThesaurus > xThesaurus,
const OUString &rWord, sal_Int16 nLanguage )
{
- SvxThesaurusDialog* pDlg = new SvxThesaurusDialog( pParent, xThesaurus, rWord, nLanguage );
+ VclPtrInstance<SvxThesaurusDialog> pDlg( pParent, xThesaurus, rWord, nLanguage );
return new AbstractThesaurusDialog_Impl( pDlg );
}
@@ -1140,19 +1141,19 @@ AbstractHyphenWordDialog* AbstractDialogFactory_Impl::CreateHyphenWordDialog( vc
::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > &xHyphen,
SvxSpellWrapper* pWrapper )
{
- SvxHyphenWordDialog* pDlg = new SvxHyphenWordDialog( rWord, nLang, pParent, xHyphen, pWrapper );
+ VclPtrInstance<SvxHyphenWordDialog> pDlg( rWord, nLang, pParent, xHyphen, pWrapper );
return new AbstractHyphenWordDialog_Impl( pDlg );
}
AbstractFmShowColsDialog * AbstractDialogFactory_Impl::CreateFmShowColsDialog( vcl::Window* pParent )
{
- FmShowColsDialog* pDlg = new FmShowColsDialog( pParent);
+ VclPtrInstance<FmShowColsDialog> pDlg( pParent);
return new AbstractFmShowColsDialog_Impl( pDlg );
}
AbstractSvxZoomDialog * AbstractDialogFactory_Impl::CreateSvxZoomDialog( vcl::Window* pParent,
const SfxItemSet& rCoreSet)
{
- SvxZoomDialog* pDlg = new SvxZoomDialog( pParent, rCoreSet);
+ VclPtrInstance<SvxZoomDialog> pDlg( pParent, rCoreSet);
return new AbstractSvxZoomDialog_Impl( pDlg );
}
@@ -1161,26 +1162,26 @@ AbstractSpellDialog * AbstractDialogFactory_Impl::CreateSvxSpellDialog(
SfxBindings* pBindings,
svx::SpellDialogChildWindow* pSpellChildWindow )
{
- svx::SpellDialog* pDlg = new svx::SpellDialog(pSpellChildWindow, pParent, pBindings);
+ VclPtrInstance<svx::SpellDialog> pDlg(pSpellChildWindow, pParent, pBindings);
return new AbstractSpellDialog_Impl(pDlg);
}
VclAbstractRefreshableDialog * AbstractDialogFactory_Impl::CreateActualizeProgressDialog( vcl::Window* pParent, GalleryTheme* pThm )
{
- Dialog* pDlg = new ActualizeProgress( pParent, pThm);
+ VclPtrInstance<ActualizeProgress> pDlg(pParent, pThm);
return new VclAbstractRefreshableDialog_Impl( pDlg );
}
AbstractSearchProgress * AbstractDialogFactory_Impl::CreateSearchProgressDialog( vcl::Window* pParent,
const INetURLObject& rStartURL )
{
- SearchProgress* pDlg = new SearchProgress( pParent, rStartURL);
+ SearchProgress* pDlg = VclPtr<SearchProgress>::Create( pParent, rStartURL);
return new AbstractSearchProgress_Impl( pDlg );
}
AbstractTakeProgress * AbstractDialogFactory_Impl::CreateTakeProgressDialog( vcl::Window* pParent )
{
- TakeProgress* pDlg = new TakeProgress( pParent );
+ VclPtrInstance<TakeProgress> pDlg( pParent );
return new AbstractTakeProgress_Impl( pDlg );
}
@@ -1195,7 +1196,7 @@ AbstractScriptSelectorDialog*
AbstractDialogFactory_Impl::CreateScriptSelectorDialog(
vcl::Window* pParent, bool bShowSlots, const Reference< frame::XFrame >& _rxFrame )
{
- SvxScriptSelectorDialog* pDlg = new SvxScriptSelectorDialog(pParent, bShowSlots, _rxFrame);
+ VclPtrInstance<SvxScriptSelectorDialog> pDlg(pParent, bShowSlots, _rxFrame);
return new AbstractScriptSelectorDialog_Impl(pDlg);
}
@@ -1216,21 +1217,21 @@ void AbstractScriptSelectorDialog_Impl::SetRunLabel()
VclAbstractDialog * AbstractDialogFactory_Impl::CreateSvxScriptOrgDialog( vcl::Window* pParent,
const OUString& rLanguage)
{
- Dialog* pDlg = new SvxScriptOrgDialog( pParent, rLanguage);
+ VclPtrInstance<SvxScriptOrgDialog> pDlg( pParent, rLanguage);
return new CuiVclAbstractDialog_Impl( pDlg );
}
AbstractTitleDialog * AbstractDialogFactory_Impl::CreateTitleDialog( vcl::Window* pParent,
const OUString& rOldText)
{
- TitleDialog* pDlg = new TitleDialog( pParent, rOldText);
+ VclPtrInstance<TitleDialog> pDlg( pParent, rOldText);
return new AbstractTitleDialog_Impl( pDlg );
}
AbstractGalleryIdDialog * AbstractDialogFactory_Impl::CreateGalleryIdDialog( vcl::Window* pParent,
GalleryTheme* pThm )
{
- GalleryIdDialog* pDlg = new GalleryIdDialog( pParent, pThm);
+ VclPtrInstance<GalleryIdDialog> pDlg( pParent, pThm);
return new AbstractGalleryIdDialog_Impl( pDlg );
}
@@ -1238,7 +1239,7 @@ VclAbstractDialog2 * AbstractDialogFactory_Impl::CreateGalleryThemePropertiesDia
ExchangeData* pData,
SfxItemSet* pItemSet)
{
- Dialog* pDlg = new GalleryThemeProperties( pParent, pData, pItemSet);
+ VclPtrInstance<GalleryThemeProperties> pDlg( pParent, pData, pItemSet);
return new VclAbstractDialog2_Impl( pDlg );
}
@@ -1247,7 +1248,8 @@ AbstractURLDlg * AbstractDialogFactory_Impl::CreateURLDialog( vcl::Window* pPare
const OUString& rTarget, const OUString& rName,
TargetList& rTargetList )
{
- URLDlg* pDlg = new URLDlg( pParent, rURL, rAltText, rDescription, rTarget, rName, rTargetList);
+ VclPtrInstance<URLDlg> pDlg( pParent, rURL, rAltText, rDescription,
+ rTarget, rName, rTargetList);
return new AbstractURLDlg_Impl( pDlg );
}
@@ -1257,7 +1259,7 @@ AbstractSvxHlinkDlgMarkWnd* AbstractDialogFactory_Impl::CreateSvxHlinkDlgMarkWnd
switch ( nResId )
{
case RID_SVXFLOAT_HYPERLINK_MARKWND :
- pDlg = new SvxHlinkDlgMarkWnd( pParent );
+ pDlg = VclPtr<SvxHlinkDlgMarkWnd>::Create ( pParent );
break;
default:
break;
@@ -1271,7 +1273,7 @@ AbstractSvxHlinkDlgMarkWnd* AbstractDialogFactory_Impl::CreateSvxHlinkDlgMarkWnd
SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabItemDialog(vcl::Window* pParent,
const SfxItemSet& rSet)
{
- SfxTabDialog* pDlg = new SvxSearchFormatDialog(pParent, rSet);
+ VclPtrInstance<SvxSearchFormatDialog> pDlg(pParent, rSet);
return new CuiAbstractTabDialog_Impl(pDlg);
}
@@ -1279,7 +1281,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateSvxSearchAttributeDial
SearchAttrItemList& rLst,
const sal_uInt16* pWhRanges )
{
- Dialog* pDlg = new SvxSearchAttributeDialog( pParent, rLst, pWhRanges);
+ VclPtrInstance<SvxSearchAttributeDialog> pDlg( pParent, rLst, pWhRanges);
return new CuiVclAbstractDialog_Impl( pDlg );
}
@@ -1289,7 +1291,7 @@ AbstractSvxSearchSimilarityDialog * AbstractDialogFactory_Impl::CreateSvxSearchS
sal_uInt16 nShorter,
sal_uInt16 nLonger)
{
- SvxSearchSimilarityDialog* pDlg = new SvxSearchSimilarityDialog( pParent, bRelax, nOther, nShorter, nLonger );
+ VclPtrInstance<SvxSearchSimilarityDialog> pDlg( pParent, bRelax, nOther, nShorter, nLonger );
return new AbstractSvxSearchSimilarityDialog_Impl( pDlg );
}
@@ -1300,7 +1302,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxBorderBackgroundDlg(
bool bEnableSelector,
bool bEnableDrawingLayerFillStyles)
{
- SfxTabDialog* pDlg = new SvxBorderBackgroundDlg(
+ VclPtrInstance<SvxBorderBackgroundDlg> pDlg(
pParent,
rCoreSet,
bEnableSelector,
@@ -1314,7 +1316,7 @@ AbstractSvxTransformTabDialog* AbstractDialogFactory_Impl::CreateSvxTransformTab
const SdrView* pView,
sal_uInt16 nAnchorTypes )
{
- SvxTransformTabDialog* pDlg = new SvxTransformTabDialog( pParent, pAttr,pView, nAnchorTypes);
+ VclPtrInstance<SvxTransformTabDialog> pDlg( pParent, pAttr,pView, nAnchorTypes);
return new AbstractSvxTransformTabDialog_Impl( pDlg );
}
@@ -1325,19 +1327,19 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSchTransformTabDialog( v
bool bSizeTabPage
)
{
- SfxTabDialog* pDlg=NULL;
+ VclPtr<SfxTabDialog> pDlg;
switch ( nResId )
{
case RID_SCH_TransformTabDLG_SVXPAGE_ANGLE :
{
- pDlg = new SvxTransformTabDialog( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE);
+ pDlg.reset( VclPtr<SvxTransformTabDialog>::Create( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE) );
pDlg->RemoveTabPage( "RID_SVXPAGE_ANGLE" );
pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" );
}
break;
case RID_SCH_TransformTabDLG_SVXPAGE_SLANT:
{
- pDlg = new SvxTransformTabDialog( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE);
+ pDlg.reset(VclPtr<SvxTransformTabDialog>::Create ( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE ) );
pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" );
}
break;
@@ -1354,20 +1356,20 @@ AbstractSvxJSearchOptionsDialog * AbstractDialogFactory_Impl::CreateSvxJSearchOp
const SfxItemSet& rOptionsSet,
sal_Int32 nInitialFlags)
{
- SvxJSearchOptionsDialog* pDlg = new SvxJSearchOptionsDialog( pParent, rOptionsSet, nInitialFlags );
+ VclPtrInstance<SvxJSearchOptionsDialog> pDlg( pParent, rOptionsSet, nInitialFlags );
return new AbstractSvxJSearchOptionsDialog_Impl( pDlg );
}
AbstractFmInputRecordNoDialog * AbstractDialogFactory_Impl::CreateFmInputRecordNoDialog( vcl::Window* pParent )
{
- FmInputRecordNoDialog* pDlg = new FmInputRecordNoDialog( pParent );
+ VclPtrInstance<FmInputRecordNoDialog> pDlg( pParent );
return new AbstractFmInputRecordNoDialog_Impl( pDlg );
}
AbstractSvxNewDictionaryDialog * AbstractDialogFactory_Impl::CreateSvxNewDictionaryDialog( vcl::Window* pParent,
::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > &xSpl )
{
- SvxNewDictionaryDialog* pDlg = new SvxNewDictionaryDialog( pParent, xSpl );
+ VclPtrInstance<SvxNewDictionaryDialog> pDlg( pParent, xSpl );
return new AbstractSvxNewDictionaryDialog_Impl( pDlg );
}
@@ -1380,7 +1382,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateSvxEditDictionaryDialo
switch ( nResId )
{
case RID_SFXDLG_EDITDICT :
- pDlg = new SvxEditDictionaryDialog( pParent, rName, xSpl );
+ pDlg = VclPtr<SvxEditDictionaryDialog>::Create( pParent, rName, xSpl );
break;
default:
break;
@@ -1394,36 +1396,36 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateSvxEditDictionaryDialo
AbstractSvxNameDialog * AbstractDialogFactory_Impl::CreateSvxNameDialog( vcl::Window* pParent,
const OUString& rName, const OUString& rDesc )
{
- SvxNameDialog* pDlg = new SvxNameDialog( pParent, rName, rDesc );
+ VclPtrInstance<SvxNameDialog> pDlg( pParent, rName, rDesc );
return new AbstractSvxNameDialog_Impl( pDlg );
}
AbstractSvxObjectNameDialog* AbstractDialogFactory_Impl::CreateSvxObjectNameDialog(vcl::Window* pParent, const OUString& rName )
{
- return new AbstractSvxObjectNameDialog_Impl(new SvxObjectNameDialog(pParent, rName));
+ return new AbstractSvxObjectNameDialog_Impl(VclPtr<SvxObjectNameDialog>::Create(pParent, rName));
}
AbstractSvxObjectTitleDescDialog* AbstractDialogFactory_Impl::CreateSvxObjectTitleDescDialog(vcl::Window* pParent, const OUString& rTitle, const OUString& rDescription)
{
- return new AbstractSvxObjectTitleDescDialog_Impl(new SvxObjectTitleDescDialog(pParent, rTitle, rDescription));
+ return new AbstractSvxObjectTitleDescDialog_Impl(VclPtr<SvxObjectTitleDescDialog>::Create(pParent, rTitle, rDescription));
}
AbstractSvxMessDialog * AbstractDialogFactory_Impl::CreateSvxMessDialog( vcl::Window* pParent, sal_uInt32,
const OUString& rText, const OUString& rDesc, Image* pImg )
{
- SvxMessDialog* pDlg = new SvxMessDialog( pParent, rText, rDesc, pImg );
+ VclPtrInstance<SvxMessDialog> pDlg( pParent, rText, rDesc, pImg );
return new AbstractSvxMessDialog_Impl( pDlg );
}
AbstractSvxMultiPathDialog * AbstractDialogFactory_Impl::CreateSvxMultiPathDialog(vcl::Window* pParent)
{
- SvxMultiPathDialog* pDlg = new SvxMultiPathDialog(pParent);
+ VclPtrInstance<SvxMultiPathDialog> pDlg(pParent);
return new AbstractSvxMultiPathDialog_Impl( pDlg );
}
AbstractSvxMultiPathDialog * AbstractDialogFactory_Impl::CreateSvxPathSelectDialog(vcl::Window* pParent)
{
- SvxPathSelectDialog* pDlg = new SvxPathSelectDialog(pParent);
+ VclPtrInstance<SvxPathSelectDialog> pDlg(pParent);
return new AbstractSvxPathSelectDialog_Impl( pDlg );
}
@@ -1435,7 +1437,7 @@ AbstractSvxHpLinkDlg * AbstractDialogFactory_Impl::CreateSvxHpLinkDlg (vcl::Wind
switch ( nResId )
{
case SID_HYPERLINK_DIALOG :
- pDlg = new SvxHpLinkDlg( pParent, pBindings );
+ pDlg = VclPtr<SvxHpLinkDlg>::Create( pParent, pBindings );
break;
default:
break;
@@ -1452,7 +1454,8 @@ AbstractFmSearchDialog* AbstractDialogFactory_Impl::CreateFmSearchDialog(vcl::W
sal_Int16 nInitialContext,
const Link& lnkContextSupplier)
{
- FmSearchDialog* pDlg = new FmSearchDialog( pParent, strInitialText, _rContexts, nInitialContext, lnkContextSupplier );
+ VclPtrInstance<FmSearchDialog> pDlg( pParent, strInitialText, _rContexts,
+ nInitialContext, lnkContextSupplier );
return new AbstractFmSearchDialog_Impl( pDlg );
}
@@ -1460,7 +1463,7 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterEmb
const Graphic& rGraphic,
RECT_POINT eLightSource)
{
- GraphicFilterDialog* pDlg = new GraphicFilterEmboss( pParent, rGraphic, eLightSource );
+ VclPtrInstance<GraphicFilterEmboss> pDlg( pParent, rGraphic, eLightSource );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
@@ -1468,7 +1471,7 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterPos
const Graphic& rGraphic,
sal_uInt16 nCount)
{
- GraphicFilterDialog* pDlg = new GraphicFilterPoster( pParent, rGraphic, nCount );
+ VclPtrInstance<GraphicFilterPoster> pDlg( pParent, rGraphic, nCount );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
@@ -1476,21 +1479,21 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSep
const Graphic& rGraphic,
sal_uInt16 nCount)
{
- GraphicFilterDialog* pDlg = new GraphicFilterSepia( pParent, rGraphic, nCount );
+ VclPtrInstance<GraphicFilterSepia> pDlg( pParent, rGraphic, nCount );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSmooth(vcl::Window* pParent,
const Graphic& rGraphic, double nRadius)
{
- GraphicFilterDialog* pDlg = new GraphicFilterSmooth( pParent, rGraphic, nRadius );
+ VclPtrInstance<GraphicFilterSmooth> pDlg( pParent, rGraphic, nRadius );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSolarize (vcl::Window* pParent,
const Graphic& rGraphic, sal_uInt8 nGreyThreshold, bool bInvert)
{
- GraphicFilterDialog* pDlg = new GraphicFilterSolarize( pParent, rGraphic, nGreyThreshold, bInvert );
+ VclPtrInstance<GraphicFilterSolarize> pDlg( pParent, rGraphic, nGreyThreshold, bInvert );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
@@ -1498,7 +1501,7 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterMos
const Graphic& rGraphic, sal_uInt16 nTileWidth, sal_uInt16 nTileHeight,
bool bEnhanceEdges)
{
- GraphicFilterDialog* pDlg = new GraphicFilterMosaic(pParent, rGraphic, nTileWidth, nTileHeight, bEnhanceEdges);
+ VclPtrInstance<GraphicFilterMosaic> pDlg(pParent, rGraphic, nTileWidth, nTileHeight, bEnhanceEdges);
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
@@ -1507,7 +1510,7 @@ AbstractSvxAreaTabDialog* AbstractDialogFactory_Impl::CreateSvxAreaTabDialog( vc
SdrModel* pModel,
bool bShadow)
{
- SvxAreaTabDialog* pDlg = new SvxAreaTabDialog( pParent, pAttr, pModel, bShadow );
+ VclPtrInstance<SvxAreaTabDialog> pDlg( pParent, pAttr, pModel, bShadow );
return new AbstractSvxAreaTabDialog_Impl( pDlg );
}
@@ -1516,7 +1519,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxLineTabDialog( vcl::W
const SdrObject* pObj ,
bool bHasObj)
{
- SfxTabDialog* pDlg = new SvxLineTabDialog( pParent, pAttr, pModel,pObj,bHasObj );
+ VclPtrInstance<SvxLineTabDialog> pDlg( pParent, pAttr, pModel,pObj,bHasObj );
return new CuiAbstractTabDialog_Impl( pDlg );
}
@@ -1530,10 +1533,10 @@ SfxAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( vcl::Window* pPa
switch ( nResId )
{
case SID_EVENTCONFIG :
- pDlg = new SfxMacroAssignDlg( pParent, _rxDocumentFrame, rAttr );
+ pDlg = VclPtr<SfxMacroAssignDlg>::Create( pParent, _rxDocumentFrame, rAttr );
break;
case RID_SVXDLG_CHARMAP :
- pDlg = new SvxCharacterMap( pParent, true, &rAttr );
+ pDlg = VclPtr<SvxCharacterMap>::Create( pParent, true, &rAttr );
break;
default:
break;
@@ -1555,13 +1558,13 @@ SfxAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( vcl::Window* pPa
switch ( nResId )
{
case RID_SVXPAGE_MEASURE :
- pDlg = new SvxMeasureDialog( pParent, rAttr, pView );
+ pDlg = VclPtr<SvxMeasureDialog>::Create( pParent, rAttr, pView );
break;
case RID_SVXPAGE_CONNECTION :
- pDlg = new SvxConnectionDialog( pParent, rAttr, pView );
+ pDlg = VclPtr<SvxConnectionDialog>::Create( pParent, rAttr, pView );
break;
case RID_SFXPAGE_DBREGISTER :
- pDlg = new DatabaseRegistrationDialog( pParent, rAttr );
+ pDlg = VclPtr<DatabaseRegistrationDialog>::Create( pParent, rAttr );
break;
default:
break;
@@ -1577,7 +1580,7 @@ AbstractSvxPostItDialog* AbstractDialogFactory_Impl::CreateSvxPostItDialog( vcl:
const SfxItemSet& rCoreSet,
bool bPrevNext )
{
- SvxPostItDialog* pDlg = new SvxPostItDialog( pParent, rCoreSet, bPrevNext );
+ VclPtrInstance<SvxPostItDialog> pDlg( pParent, rCoreSet, bPrevNext );
return new AbstractSvxPostItDialog_Impl( pDlg );
}
@@ -1589,7 +1592,7 @@ public:
:m_aItems( SfxGetpApp()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM )
{
m_aItems.Put( SfxBoolItem( SID_ATTR_MACROITEM, _bUnoDialogMode ) );
- m_pDialog.reset( new SvxMacroAssignDlg( _pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent ) );
+ m_pDialog.reset( VclPtr<SvxMacroAssignDlg>::Create( _pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent ) );
}
virtual short Execute() SAL_OVERRIDE;
@@ -1597,7 +1600,7 @@ public:
private:
SfxItemSet m_aItems;
- ::std::unique_ptr< SvxMacroAssignDlg > m_pDialog;
+ VclPtr< SvxMacroAssignDlg > m_pDialog;
};
short SvxMacroAssignDialog::Execute()
@@ -1765,11 +1768,11 @@ SfxAbstractInsertObjectDialog* AbstractDialogFactory_Impl::CreateInsertObjectDia
{
InsertObjectDialog_Impl* pDlg=0;
if ( rCommand == ".uno:InsertObject" )
- pDlg = new SvInsertOleDlg( pParent, xStor, pList );
+ pDlg = VclPtr<SvInsertOleDlg>::Create( pParent, xStor, pList );
else if ( rCommand == ".uno:InsertPlugin" )
- pDlg = new SvInsertPlugInDialog( pParent, xStor );
+ pDlg = VclPtr<SvInsertPlugInDialog>::Create( pParent, xStor );
else if ( rCommand == ".uno:InsertObjectFloatingFrame" )
- pDlg = new SfxInsertFloatingFrameDialog( pParent, xStor );
+ pDlg = VclPtr<SfxInsertFloatingFrameDialog>::Create( pParent, xStor );
if ( pDlg )
{
@@ -1784,7 +1787,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateEditObjectDialog( vcl::Wind
{
if ( rCommand == ".uno:InsertObjectFloatingFrame" )
{
- InsertObjectDialog_Impl* pDlg = new SfxInsertFloatingFrameDialog( pParent, xObj );
+ VclPtrInstance<SfxInsertFloatingFrameDialog> pDlg( pParent, xObj );
pDlg->SetHelpId( OUStringToOString( rCommand, RTL_TEXTENCODING_UTF8 ) );
return new CuiVclAbstractDialog_Impl( pDlg );
}
@@ -1795,12 +1798,12 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateEditObjectDialog( vcl::Wind
SfxAbstractPasteDialog* AbstractDialogFactory_Impl::CreatePasteDialog( vcl::Window* pParent )
{
- return new AbstractPasteDialog_Impl( new SvPasteObjectDialog( pParent ) );
+ return new AbstractPasteDialog_Impl( VclPtr<SvPasteObjectDialog>::Create( pParent ) );
}
SfxAbstractLinksDialog* AbstractDialogFactory_Impl::CreateLinksDialog( vcl::Window* pParent, sfx2::LinkManager* pMgr, bool bHTML, sfx2::SvBaseLink* p)
{
- SvBaseLinksDlg* pLinkDlg = new SvBaseLinksDlg( pParent, pMgr, bHTML );
+ VclPtrInstance<SvBaseLinksDlg> pLinkDlg( pParent, pMgr, bHTML );
if ( p )
pLinkDlg->SetActLink(p);
return new AbstractLinksDialog_Impl( pLinkDlg );
@@ -1808,7 +1811,7 @@ SfxAbstractLinksDialog* AbstractDialogFactory_Impl::CreateLinksDialog( vcl::Wind
SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog( vcl::Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, const SdrObject* /*pObj*/ )
{
- return new CuiAbstractTabDialog_Impl( new SvxFormatCellsDialog( pParent, pAttr, pModel ) );
+ return new CuiAbstractTabDialog_Impl( VclPtr<SvxFormatCellsDialog>::Create( pParent, pAttr, pModel ) );
}
SvxAbstractSplittTableDialog* AbstractDialogFactory_Impl::CreateSvxSplittTableDialog( vcl::Window* pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )
@@ -1824,7 +1827,7 @@ SvxAbstractNewTableDialog* AbstractDialogFactory_Impl::CreateSvxNewTableDialog(
VclAbstractDialog* AbstractDialogFactory_Impl::CreateOptionsDialog(
vcl::Window* pParent, const OUString& rExtensionId, const OUString& /*rApplicationContext*/ )
{
- return new CuiVclAbstractDialog_Impl( new OfaTreeOptionsDialog( pParent, rExtensionId ) );
+ return new CuiVclAbstractDialog_Impl( VclPtr<OfaTreeOptionsDialog>::Create( pParent, rExtensionId ) );
}
SvxAbstractInsRowColDlg* AbstractDialogFactory_Impl::CreateSvxInsRowColDlg( vcl::Window* pParent, bool bCol, const OString& sHelpId )
@@ -1836,7 +1839,7 @@ AbstractPasswordToOpenModifyDialog * AbstractDialogFactory_Impl::CreatePasswordT
vcl::Window * pParent,
sal_uInt16 nMinPasswdLen, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify )
{
- PasswordToOpenModifyDialog * pDlg = new PasswordToOpenModifyDialog( pParent, nMinPasswdLen, nMaxPasswdLen, bIsPasswordToModify );
+ VclPtrInstance<PasswordToOpenModifyDialog> pDlg( pParent, nMinPasswdLen, nMaxPasswdLen, bIsPasswordToModify );
return new AbstractPasswordToOpenModifyDialog_Impl( pDlg );
}
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index ffb15778c5e1..808a80c96fa5 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -61,7 +61,7 @@ class HangulHanjaConversionDialog;
using namespace svx;
#define DECL_ABSTDLG_BASE(Class,DialogClass) \
- DialogClass* pDlg; \
+ VclPtr<DialogClass> pDlg; \
public: \
Class( DialogClass* p) \
: pDlg(p) \
@@ -72,16 +72,16 @@ public: \
#define IMPL_ABSTDLG_BASE(Class) \
Class::~Class() \
{ \
- delete pDlg; \
+ pDlg.disposeAndClear(); \
} \
-short Class::Execute() \
+short Class::Execute() \
{ \
return pDlg->Execute(); \
}
class VclAbstractDialog2_Impl : public VclAbstractDialog2
{
- Dialog* m_pDlg;
+ ScopedVclPtr<Dialog> m_pDlg;
Link m_aEndDlgHdl;
public:
VclAbstractDialog2_Impl( Dialog* p ) : m_pDlg( p ) {}
diff --git a/cui/source/factory/init.cxx b/cui/source/factory/init.cxx
index eb24820e3351..cdf2ed91d22b 100644
--- a/cui/source/factory/init.cxx
+++ b/cui/source/factory/init.cxx
@@ -28,7 +28,7 @@ extern "C"
SAL_DLLPUBLIC_EXPORT bool GetSpecialCharsForEdit(vcl::Window* i_pParent, const vcl::Font& i_rFont, OUString& o_rResult)
{
bool bRet = false;
- boost::scoped_ptr<SvxCharacterMap> aDlg(new SvxCharacterMap( i_pParent ));
+ VclPtrInstance< SvxCharacterMap > aDlg( i_pParent );
aDlg->DisableFontSelection();
aDlg->SetCharFont(i_rFont);
if ( aDlg->Execute() == RET_OK )
diff --git a/cui/source/inc/ControlFocusHelper.hxx b/cui/source/inc/ControlFocusHelper.hxx
index b984838fa09c..6530f3cf6740 100644
--- a/cui/source/inc/ControlFocusHelper.hxx
+++ b/cui/source/inc/ControlFocusHelper.hxx
@@ -26,11 +26,13 @@
class SvxControlFocusHelper : public Control
{
private:
- Control* m_pFocusCtrl;
+ VclPtr<Control> m_pFocusCtrl;
public:
SvxControlFocusHelper( vcl::Window* pParent, const ResId& rId ) :
Control( pParent, rId ), m_pFocusCtrl( NULL ) {}
+ virtual ~SvxControlFocusHelper();
+ virtual void dispose() SAL_OVERRIDE;
void SetFocusControl( Control* pCtrl ) { m_pFocusCtrl = pCtrl; }
diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx
index 7b8646fee38b..411df36dd123 100644
--- a/cui/source/inc/SpellDialog.hxx
+++ b/cui/source/inc/SpellDialog.hxx
@@ -76,7 +76,6 @@ protected:
public:
SentenceEditWindow_Impl(vcl::Window* pParent, WinBits nBits);
- virtual ~SentenceEditWindow_Impl();
void SetModifyHdl(const Link& rLink) SAL_OVERRIDE { m_aModifyLink = rLink;}
@@ -125,33 +124,33 @@ class SpellDialog : public SfxModelessDialog
friend class SentenceEditWindow_Impl;
private:
- FixedText* m_pLanguageFT;
- SvxLanguageBox* m_pLanguageLB;
+ VclPtr<FixedText> m_pLanguageFT;
+ VclPtr<SvxLanguageBox> m_pLanguageLB;
- FixedText* m_pExplainFT;
- FixedHyperlink* m_pExplainLink;
+ VclPtr<FixedText> m_pExplainFT;
+ VclPtr<FixedHyperlink> m_pExplainLink;
- FixedText* m_pNotInDictFT;
- SentenceEditWindow_Impl* m_pSentenceED;
+ VclPtr<FixedText> m_pNotInDictFT;
+ VclPtr<SentenceEditWindow_Impl> m_pSentenceED;
- FixedText* m_pSuggestionFT;
- ListBox* m_pSuggestionLB;
+ VclPtr<FixedText> m_pSuggestionFT;
+ VclPtr<ListBox> m_pSuggestionLB;
- PushButton* m_pIgnorePB;
- PushButton* m_pIgnoreAllPB;
- PushButton* m_pIgnoreRulePB;
- PushButton* m_pAddToDictPB;
- MenuButton* m_pAddToDictMB;
+ VclPtr<PushButton> m_pIgnorePB;
+ VclPtr<PushButton> m_pIgnoreAllPB;
+ VclPtr<PushButton> m_pIgnoreRulePB;
+ VclPtr<PushButton> m_pAddToDictPB;
+ VclPtr<MenuButton> m_pAddToDictMB;
- PushButton* m_pChangePB;
- PushButton* m_pChangeAllPB;
- PushButton* m_pAutoCorrPB;
+ VclPtr<PushButton> m_pChangePB;
+ VclPtr<PushButton> m_pChangeAllPB;
+ VclPtr<PushButton> m_pAutoCorrPB;
- CheckBox* m_pCheckGrammarCB;
+ VclPtr<CheckBox> m_pCheckGrammarCB;
- PushButton* m_pOptionsPB;
- PushButton* m_pUndoPB;
- CloseButton* m_pClosePB;
+ VclPtr<PushButton> m_pOptionsPB;
+ VclPtr<PushButton> m_pUndoPB;
+ VclPtr<CloseButton> m_pClosePB;
OUString m_sResumeST;
OUString m_sIgnoreOnceST;
@@ -220,6 +219,7 @@ public:
vcl::Window * pParent,
SfxBindings* pBindings);
virtual ~SpellDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetLanguage( sal_uInt16 nLang );
virtual bool Close() SAL_OVERRIDE;
diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx
index 132ab541702e..82cfac00ee18 100644
--- a/cui/source/inc/about.hxx
+++ b/cui/source/inc/about.hxx
@@ -34,13 +34,13 @@ private:
BitmapEx aBackgroundBitmap;
BitmapEx aLogoBitmap;
- VclMultiLineEdit* m_pVersion;
- FixedText* m_pDescriptionText;
- FixedText* m_pCopyrightText;
- FixedImage* m_pLogoImage;
- FixedText* m_pLogoReplacement;
- PushButton* m_pCreditsButton;
- PushButton* m_pWebsiteButton;
+ VclPtr<VclMultiLineEdit> m_pVersion;
+ VclPtr<FixedText> m_pDescriptionText;
+ VclPtr<FixedText> m_pCopyrightText;
+ VclPtr<FixedImage> m_pLogoImage;
+ VclPtr<FixedText> m_pLogoReplacement;
+ VclPtr<PushButton> m_pCreditsButton;
+ VclPtr<PushButton> m_pWebsiteButton;
OUString m_aVersionTextStr;
OUString m_aVendorTextStr;
@@ -66,6 +66,8 @@ protected:
public:
AboutDialog(vcl::Window* pParent);
+ virtual ~AboutDialog();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( HandleClick, PushButton* );
};
diff --git a/cui/source/inc/acccfg.hxx b/cui/source/inc/acccfg.hxx
index 88d096f8425f..6c487cabc80f 100644
--- a/cui/source/inc/acccfg.hxx
+++ b/cui/source/inc/acccfg.hxx
@@ -53,7 +53,7 @@ class SfxStringItem;
class SfxAccCfgTabListBox_Impl : public SvTabListBox
{
- SfxAcceleratorConfigPage* m_pAccelConfigPage;
+ VclPtr<SfxAcceleratorConfigPage> m_pAccelConfigPage;
void KeyInput( const KeyEvent &rKEvt ) SAL_OVERRIDE;
@@ -67,6 +67,8 @@ public:
, m_pAccelConfigPage(NULL)
{
}
+ virtual ~SfxAccCfgTabListBox_Impl();
+ virtual void dispose() SAL_OVERRIDE;
void SetAccelConfigPage(SfxAcceleratorConfigPage* pAccelConfigPage)
{
@@ -118,17 +120,17 @@ private:
const SfxStringItem* m_pFontItem;
sfx2::FileDialogHelper* m_pFileDlg;
- SfxAccCfgTabListBox_Impl* m_pEntriesBox;
- RadioButton* m_pOfficeButton;
- RadioButton* m_pModuleButton;
- PushButton* m_pChangeButton;
- PushButton* m_pRemoveButton;
- SfxConfigGroupListBox* m_pGroupLBox;
- SfxConfigFunctionListBox* m_pFunctionBox;
- SvTreeListBox* m_pKeyBox;
- PushButton* m_pLoadButton;
- PushButton* m_pSaveButton;
- PushButton* m_pResetButton;
+ VclPtr<SfxAccCfgTabListBox_Impl> m_pEntriesBox;
+ VclPtr<RadioButton> m_pOfficeButton;
+ VclPtr<RadioButton> m_pModuleButton;
+ VclPtr<PushButton> m_pChangeButton;
+ VclPtr<PushButton> m_pRemoveButton;
+ VclPtr<SfxConfigGroupListBox> m_pGroupLBox;
+ VclPtr<SfxConfigFunctionListBox> m_pFunctionBox;
+ VclPtr<SvTreeListBox> m_pKeyBox;
+ VclPtr<PushButton> m_pLoadButton;
+ VclPtr<PushButton> m_pSaveButton;
+ VclPtr<PushButton> m_pResetButton;
OUString aLoadAccelConfigStr;
OUString aSaveAccelConfigStr;
OUString aFilterAllStr;
@@ -172,6 +174,7 @@ private:
public:
SfxAcceleratorConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet );
virtual ~SfxAcceleratorConfigPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE;
diff --git a/cui/source/inc/align.hxx b/cui/source/inc/align.hxx
index b6d9e46baa9b..b0f5e0aa7b5f 100644
--- a/cui/source/inc/align.hxx
+++ b/cui/source/inc/align.hxx
@@ -58,8 +58,9 @@ class AlignmentTabPage : public SfxTabPage
public:
virtual ~AlignmentTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
static const sal_uInt16* GetRanges() { return s_pRanges; }
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -78,36 +79,36 @@ private:
DECL_LINK( UpdateEnableHdl, void* );
private:
- ListBox* m_pLbHorAlign;
- FixedText* m_pFtIndent;
- MetricField* m_pEdIndent;
- FixedText* m_pFtVerAlign;
- ListBox* m_pLbVerAlign;
-
- DialControl* m_pCtrlDial;
- FixedText* m_pFtRotate;
- NumericField* m_pNfRotate;
- FixedText* m_pFtRefEdge;
- ValueSet* m_pVsRefEdge;
- TriStateBox* m_pCbStacked;
- TriStateBox* m_pCbAsianMode;
+ VclPtr<ListBox> m_pLbHorAlign;
+ VclPtr<FixedText> m_pFtIndent;
+ VclPtr<MetricField> m_pEdIndent;
+ VclPtr<FixedText> m_pFtVerAlign;
+ VclPtr<ListBox> m_pLbVerAlign;
+
+ VclPtr<DialControl> m_pCtrlDial;
+ VclPtr<FixedText> m_pFtRotate;
+ VclPtr<NumericField> m_pNfRotate;
+ VclPtr<FixedText> m_pFtRefEdge;
+ VclPtr<ValueSet> m_pVsRefEdge;
+ VclPtr<TriStateBox> m_pCbStacked;
+ VclPtr<TriStateBox> m_pCbAsianMode;
OrientationHelper* m_pOrientHlp;
- VclHBox* m_pBoxDirection;
- TriStateBox* m_pBtnWrap;
- TriStateBox* m_pBtnHyphen;
- TriStateBox* m_pBtnShrink;
- FrameDirListBox* m_pLbFrameDir;
+ VclPtr<VclHBox> m_pBoxDirection;
+ VclPtr<TriStateBox> m_pBtnWrap;
+ VclPtr<TriStateBox> m_pBtnHyphen;
+ VclPtr<TriStateBox> m_pBtnShrink;
+ VclPtr<FrameDirListBox> m_pLbFrameDir;
// hidden labels/string
- FixedText* m_pFtBotLock;
- FixedText* m_pFtTopLock;
- FixedText* m_pFtCelLock;
- FixedText* m_pFtABCD;
-
- VclContainer* m_pAlignmentFrame;
- VclContainer* m_pOrientFrame;
- VclContainer* m_pPropertiesFrame;
+ VclPtr<FixedText> m_pFtBotLock;
+ VclPtr<FixedText> m_pFtTopLock;
+ VclPtr<FixedText> m_pFtCelLock;
+ VclPtr<FixedText> m_pFtABCD;
+
+ VclPtr<VclContainer> m_pAlignmentFrame;
+ VclPtr<VclContainer> m_pOrientFrame;
+ VclPtr<VclContainer> m_pPropertiesFrame;
};
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx
index 8d6d1bc16f58..d56700e45e7a 100644
--- a/cui/source/inc/autocdlg.hxx
+++ b/cui/source/inc/autocdlg.hxx
@@ -43,8 +43,8 @@ namespace editeng { class SortedAutoCompleteStrings; }
class OfaAutoCorrDlg : public SfxTabDialog
{
- VclContainer* m_pLanguageBox;
- SvxLanguageBox* m_pLanguageLB;
+ VclPtr<VclContainer> m_pLanguageBox;
+ VclPtr<SvxLanguageBox> m_pLanguageLB;
sal_uInt16 m_nReplacePageId;
sal_uInt16 m_nExceptionsPageId;
@@ -53,6 +53,8 @@ class OfaAutoCorrDlg : public SfxTabDialog
public:
OfaAutoCorrDlg(vcl::Window* pParent, const SfxItemSet *pSet);
+ virtual ~OfaAutoCorrDlg();
+ virtual void dispose() SAL_OVERRIDE;
void EnableLanguage(bool bEnable);
};
@@ -94,7 +96,7 @@ class OfaAutocorrOptionsPage : public SfxTabPage
using TabPage::ActivatePage;
private:
- SvxCheckListBox *m_pCheckLB;
+ VclPtr<SvxCheckListBox> m_pCheckLB;
OUString m_sInput;
OUString m_sDoubleCaps;
@@ -107,8 +109,10 @@ private:
public:
OfaAutocorrOptionsPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ virtual ~OfaAutocorrOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -123,8 +127,8 @@ class OfaSwAutoFmtOptionsPage : public SfxTabPage
{
using TabPage::ActivatePage;
- OfaACorrCheckListBox* m_pCheckLB;
- PushButton* m_pEditPB;
+ VclPtr<OfaACorrCheckListBox> m_pCheckLB;
+ VclPtr<PushButton> m_pEditPB;
OUString sDeleteEmptyPara;
OUString sUseReplaceTbl;
@@ -163,9 +167,10 @@ class OfaSwAutoFmtOptionsPage : public SfxTabPage
OfaSwAutoFmtOptionsPage( vcl::Window* pParent,
const SfxItemSet& rSet );
virtual ~OfaSwAutoFmtOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
- public:
- static SfxTabPage* Create( vcl::Window* pParent,
+public:
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -224,12 +229,12 @@ private:
StringChangeTable aChangesTable;
- CheckBox* m_pTextOnlyCB;
- AutoCorrEdit* m_pShortED;
- AutoCorrEdit* m_pReplaceED;
- SvTabListBox* m_pReplaceTLB;
- PushButton* m_pNewReplacePB;
- PushButton* m_pDeleteReplacePB;
+ VclPtr<CheckBox> m_pTextOnlyCB;
+ VclPtr<AutoCorrEdit> m_pShortED;
+ VclPtr<AutoCorrEdit> m_pReplaceED;
+ VclPtr<SvTabListBox> m_pReplaceTLB;
+ VclPtr<PushButton> m_pNewReplacePB;
+ VclPtr<PushButton> m_pDeleteReplacePB;
OUString sModify;
OUString sNew;
@@ -257,8 +262,9 @@ private:
public:
OfaAutocorrReplacePage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaAutocorrReplacePage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet);
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -289,17 +295,17 @@ class OfaAutocorrExceptPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
- AutoCorrEdit* m_pAbbrevED;
- ListBox* m_pAbbrevLB;
- PushButton* m_pNewAbbrevPB;
- PushButton* m_pDelAbbrevPB;
- CheckBox* m_pAutoAbbrevCB;
-
- AutoCorrEdit* m_pDoubleCapsED;
- ListBox* m_pDoubleCapsLB;
- PushButton* m_pNewDoublePB;
- PushButton* m_pDelDoublePB;
- CheckBox* m_pAutoCapsCB;
+ VclPtr<AutoCorrEdit> m_pAbbrevED;
+ VclPtr<ListBox> m_pAbbrevLB;
+ VclPtr<PushButton> m_pNewAbbrevPB;
+ VclPtr<PushButton> m_pDelAbbrevPB;
+ VclPtr<CheckBox> m_pAutoAbbrevCB;
+
+ VclPtr<AutoCorrEdit> m_pDoubleCapsED;
+ VclPtr<ListBox> m_pDoubleCapsLB;
+ VclPtr<PushButton> m_pNewDoublePB;
+ VclPtr<PushButton> m_pDelDoublePB;
+ VclPtr<CheckBox> m_pAutoCapsCB;
StringsTable aStringsTable;
CollatorWrapper* pCompareClass;
@@ -315,8 +321,9 @@ private:
public:
OfaAutocorrExceptPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaAutocorrExceptPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -335,29 +342,29 @@ class OfaQuoteTabPage : public SfxTabPage
private:
/// For anything but writer
- SvxCheckListBox* m_pCheckLB;
+ VclPtr<SvxCheckListBox> m_pCheckLB;
/// Just for writer
- OfaACorrCheckListBox* m_pSwCheckLB;
+ VclPtr<OfaACorrCheckListBox> m_pSwCheckLB;
OUString sNonBrkSpace;
OUString sOrdinal;
SvLBoxButtonData* pCheckButtonData;
- CheckBox* m_pSingleTypoCB;
- PushButton* m_pSglStartQuotePB;
- FixedText* m_pSglStartExFT;
- PushButton* m_pSglEndQuotePB;
- FixedText* m_pSglEndExFT;
- PushButton* m_pSglStandardPB;
+ VclPtr<CheckBox> m_pSingleTypoCB;
+ VclPtr<PushButton> m_pSglStartQuotePB;
+ VclPtr<FixedText> m_pSglStartExFT;
+ VclPtr<PushButton> m_pSglEndQuotePB;
+ VclPtr<FixedText> m_pSglEndExFT;
+ VclPtr<PushButton> m_pSglStandardPB;
- CheckBox* m_pDoubleTypoCB;
- PushButton* m_pDblStartQuotePB;
- FixedText* m_pDblStartExFT;
- PushButton* m_pDblEndQuotePB;
- FixedText* m_pDblEndExFT;
- PushButton* m_pDblStandardPB;
+ VclPtr<CheckBox> m_pDoubleTypoCB;
+ VclPtr<PushButton> m_pDblStartQuotePB;
+ VclPtr<FixedText> m_pDblStartExFT;
+ VclPtr<PushButton> m_pDblEndQuotePB;
+ VclPtr<FixedText> m_pDblEndExFT;
+ VclPtr<PushButton> m_pDblStandardPB;
OUString m_sStartQuoteDlg;
OUString m_sEndQuoteDlg;
@@ -381,8 +388,9 @@ private:
OfaQuoteTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
public:
virtual ~OfaQuoteTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -397,31 +405,33 @@ class OfaAutoCompleteTabPage : public SfxTabPage
public:
class AutoCompleteMultiListBox : public MultiListBox
{
- OfaAutoCompleteTabPage* m_pPage;
+ VclPtr<OfaAutoCompleteTabPage> m_pPage;
public:
AutoCompleteMultiListBox(vcl::Window *pParent, WinBits nBits)
: MultiListBox(pParent, nBits)
, m_pPage(NULL)
{
}
+ virtual ~AutoCompleteMultiListBox();
+ virtual void dispose() SAL_OVERRIDE;
void SetPage(OfaAutoCompleteTabPage *pPage) { m_pPage = pPage; }
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
};
private:
using TabPage::ActivatePage;
- CheckBox* m_pCBActiv; ///<Enable word completion
- CheckBox* m_pCBAppendSpace;///<Append space
- CheckBox* m_pCBAsTip; ///<Show as tip
-
- CheckBox* m_pCBCollect;///<Collect words
- CheckBox* m_pCBRemoveList;///<...save the list for later use...
-
- ListBox* m_pDCBExpandKey;
- NumericField* m_pNFMinWordlen;
- NumericField* m_pNFMaxEntries;
- AutoCompleteMultiListBox* m_pLBEntries;
- PushButton* m_pPBEntries;
+ VclPtr<CheckBox> m_pCBActiv; ///<Enable word completion
+ VclPtr<CheckBox> m_pCBAppendSpace;///<Append space
+ VclPtr<CheckBox> m_pCBAsTip; ///<Show as tip
+
+ VclPtr<CheckBox> m_pCBCollect;///<Collect words
+ VclPtr<CheckBox> m_pCBRemoveList;///<...save the list for later use...
+
+ VclPtr<ListBox> m_pDCBExpandKey;
+ VclPtr<NumericField> m_pNFMinWordlen;
+ VclPtr<NumericField> m_pNFMaxEntries;
+ VclPtr<AutoCompleteMultiListBox> m_pLBEntries;
+ VclPtr<PushButton> m_pPBEntries;
editeng::SortedAutoCompleteStrings* m_pAutoCompleteList;
sal_uInt16 m_nAutoCmpltListCnt;
@@ -430,9 +440,9 @@ private:
OfaAutoCompleteTabPage( vcl::Window* pParent,
const SfxItemSet& rSet );
public:
- virtual ~OfaAutoCompleteTabPage();
-
- static SfxTabPage* Create( vcl::Window* pParent,
+ virtual ~OfaAutoCompleteTabPage();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -456,12 +466,9 @@ class OfaSmartTagOptionsTabPage : public SfxTabPage
private:
// controls
- CheckBox* m_pMainCB;
- SvxCheckListBox* m_pSmartTagTypesLB;
- PushButton* m_pPropertiesPB;
-
- /// construction via Create()
- OfaSmartTagOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ VclPtr<CheckBox> m_pMainCB;
+ VclPtr<SvxCheckListBox> m_pSmartTagTypesLB;
+ VclPtr<PushButton> m_pPropertiesPB;
/** Inserts items into m_aSmartTagTypesLB
@@ -496,10 +503,12 @@ private:
DECL_LINK(SelectHdl, void *);
public:
-
+ /// construction via Create()
+ OfaSmartTagOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaSmartTagOptionsTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet);
+ static VclPtr<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/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx
index 0686c81ceb3a..70d01e9b87ff 100644
--- a/cui/source/inc/backgrnd.hxx
+++ b/cui/source/inc/backgrnd.hxx
@@ -47,7 +47,7 @@ class SvxBackgroundTabPage : public SvxTabPage
using TabPage::DeactivatePage;
static const sal_uInt16 pPageRanges[];
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
// returns the area of the which-values
static const sal_uInt16* GetRanges() { return pPageRanges; }
@@ -71,40 +71,41 @@ protected:
private:
SvxBackgroundTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet );
virtual ~SvxBackgroundTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- VclContainer* m_pAsGrid;
- FixedText* m_pSelectTxt;
- ListBox* m_pLbSelect;
- FixedText* m_pTblDesc;
- ListBox* m_pTblLBox;
- ListBox* m_pParaLBox;
+ VclPtr<VclContainer> m_pAsGrid;
+ VclPtr<FixedText> m_pSelectTxt;
+ VclPtr<ListBox> m_pLbSelect;
+ VclPtr<FixedText> m_pTblDesc;
+ VclPtr<ListBox> m_pTblLBox;
+ VclPtr<ListBox> m_pParaLBox;
- VclFrame* m_pBackGroundColorFrame;
- SvxColorValueSet* m_pBackgroundColorSet;
- BackgroundPreviewImpl* m_pPreviewWin1;
+ VclPtr<VclFrame> m_pBackGroundColorFrame;
+ VclPtr<SvxColorValueSet> m_pBackgroundColorSet;
+ VclPtr<BackgroundPreviewImpl> m_pPreviewWin1;
- FixedText* m_pColTransFT;///<color transparency
- MetricField* m_pColTransMF;
- CheckBox* m_pBtnPreview;
+ VclPtr<FixedText> m_pColTransFT;///<color transparency
+ VclPtr<MetricField> m_pColTransMF;
+ VclPtr<CheckBox> m_pBtnPreview;
// Background Bitmap ----------------------------------
- VclContainer* m_pBitmapContainer;
- VclContainer* m_pFileFrame;
- PushButton* m_pBtnBrowse;
- CheckBox* m_pBtnLink;
- FixedText* m_pFtUnlinked;
- FixedText* m_pFtFile;
-
- VclContainer* m_pTypeFrame;
- RadioButton* m_pBtnPosition;
- RadioButton* m_pBtnArea;
- RadioButton* m_pBtnTile;
- SvxRectCtl* m_pWndPosition;
-
- VclContainer* m_pGraphTransFrame;///<transparency of graphics
- MetricField* m_pGraphTransMF;
-
- BackgroundPreviewImpl* m_pPreviewWin2;
+ VclPtr<VclContainer> m_pBitmapContainer;
+ VclPtr<VclContainer> m_pFileFrame;
+ VclPtr<PushButton> m_pBtnBrowse;
+ VclPtr<CheckBox> m_pBtnLink;
+ VclPtr<FixedText> m_pFtUnlinked;
+ VclPtr<FixedText> m_pFtFile;
+
+ VclPtr<VclContainer> m_pTypeFrame;
+ VclPtr<RadioButton> m_pBtnPosition;
+ VclPtr<RadioButton> m_pBtnArea;
+ VclPtr<RadioButton> m_pBtnTile;
+ VclPtr<SvxRectCtl> m_pWndPosition;
+
+ VclPtr<VclContainer> m_pGraphTransFrame;///<transparency of graphics
+ VclPtr<MetricField> m_pGraphTransMF;
+
+ VclPtr<BackgroundPreviewImpl> m_pPreviewWin2;
// DDListBox for Writer -------------------------------
diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx
index 9e2ed6622c9d..8f129977a546 100644
--- a/cui/source/inc/border.hxx
+++ b/cui/source/inc/border.hxx
@@ -45,7 +45,9 @@ class SvxBorderTabPage : public SfxTabPage
static const sal_uInt16 pRanges[];
public:
- static SfxTabPage* Create( vcl::Window* pParent,
+ virtual ~SvxBorderTabPage();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
static const sal_uInt16* GetRanges() { return pRanges; }
@@ -61,40 +63,39 @@ protected:
private:
SvxBorderTabPage( vcl::Window* pParent, const SfxItemSet& rCoreAttrs );
- virtual ~SvxBorderTabPage();
// Controls
- ValueSet* m_pWndPresets;
- FixedText* m_pUserDefFT;
- svx::FrameSelector* m_pFrameSel;
-
- LineListBox* m_pLbLineStyle;
- ColorListBox* m_pLbLineColor;
- MetricField* m_pLineWidthMF;
-
- VclContainer* m_pSpacingFrame;
- FixedText* m_pLeftFT;
- MetricField* m_pLeftMF;
- FixedText* m_pRightFT;
- MetricField* m_pRightMF;
- FixedText* m_pTopFT;
- MetricField* m_pTopMF;
- FixedText* m_pBottomFT;
- MetricField* m_pBottomMF;
- CheckBox* m_pSynchronizeCB;
-
- VclContainer* m_pShadowFrame;
- ValueSet* m_pWndShadows;
- FixedText* m_pFtShadowSize;
- MetricField* m_pEdShadowSize;
- FixedText* m_pFtShadowColor;
- ColorListBox* m_pLbShadowColor;
-
-
- VclContainer* m_pPropertiesFrame;///< properties - "Merge with next paragraph" in Writer
- CheckBox* m_pMergeWithNextCB;
+ VclPtr<ValueSet> m_pWndPresets;
+ VclPtr<FixedText> m_pUserDefFT;
+ VclPtr<svx::FrameSelector> m_pFrameSel;
+
+ VclPtr<LineListBox> m_pLbLineStyle;
+ VclPtr<ColorListBox> m_pLbLineColor;
+ VclPtr<MetricField> m_pLineWidthMF;
+
+ VclPtr<VclContainer> m_pSpacingFrame;
+ VclPtr<FixedText> m_pLeftFT;
+ VclPtr<MetricField> m_pLeftMF;
+ VclPtr<FixedText> m_pRightFT;
+ VclPtr<MetricField> m_pRightMF;
+ VclPtr<FixedText> m_pTopFT;
+ VclPtr<MetricField> m_pTopMF;
+ VclPtr<FixedText> m_pBottomFT;
+ VclPtr<MetricField> m_pBottomMF;
+ VclPtr<CheckBox> m_pSynchronizeCB;
+
+ VclPtr<VclContainer> m_pShadowFrame;
+ VclPtr<ValueSet> m_pWndShadows;
+ VclPtr<FixedText> m_pFtShadowSize;
+ VclPtr<MetricField> m_pEdShadowSize;
+ VclPtr<FixedText> m_pFtShadowColor;
+ VclPtr<ColorListBox> m_pLbShadowColor;
+
+
+ VclPtr<VclContainer> m_pPropertiesFrame;///< properties - "Merge with next paragraph" in Writer
+ VclPtr<CheckBox> m_pMergeWithNextCB;
// #i29550#
- CheckBox* m_pMergeAdjacentBordersCB;
+ VclPtr<CheckBox> m_pMergeAdjacentBordersCB;
ImageList aShadowImgLstH;
ImageList aShadowImgLst;
@@ -114,8 +115,8 @@ private:
std::set<sal_Int16> maUsedBorderStyles;
// Handler
- DECL_LINK( SelStyleHdl_Impl, ListBox* pLb );
- DECL_LINK( SelColHdl_Impl, ListBox* pLb );
+ DECL_LINK( SelStyleHdl_Impl, ListBox* );
+ DECL_LINK( SelColHdl_Impl, ListBox* );
DECL_LINK( SelPreHdl_Impl, void* );
DECL_LINK( SelSdwHdl_Impl, void* );
DECL_LINK( LinesChanged_Impl, void* );
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index 58505ff614e2..759b1406d3e6 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -315,7 +315,7 @@ public:
class SvxMenuEntriesListBox : public SvTreeListBox
{
private:
- SvxConfigPage* pPage;
+ VclPtr<SvxConfigPage> pPage;
protected:
bool m_bIsInternalDrag;
@@ -323,6 +323,7 @@ protected:
public:
SvxMenuEntriesListBox(vcl::Window*, SvxConfigPage*);
virtual ~SvxMenuEntriesListBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE;
@@ -359,30 +360,30 @@ protected:
// the top section of the tab page where top level menus and toolbars
// are displayed in a listbox
- VclFrame* m_pTopLevel;
- FixedText* m_pTopLevelLabel;
- ListBox* m_pTopLevelListBox;
- PushButton* m_pNewTopLevelButton;
- MenuButton* m_pModifyTopLevelButton;
+ VclPtr<VclFrame> m_pTopLevel;
+ VclPtr<FixedText> m_pTopLevelLabel;
+ VclPtr<ListBox> m_pTopLevelListBox;
+ VclPtr<PushButton> m_pNewTopLevelButton;
+ VclPtr<MenuButton> m_pModifyTopLevelButton;
// the contents section where the contents of the selected
// menu or toolbar are displayed
- VclFrame* m_pContents;
- FixedText* m_pContentsLabel;
- VclContainer* m_pEntries;
- SvTreeListBox* m_pContentsListBox;
+ VclPtr<VclFrame> m_pContents;
+ VclPtr<FixedText> m_pContentsLabel;
+ VclPtr<VclContainer> m_pEntries;
+ VclPtr<SvTreeListBox> m_pContentsListBox;
- PushButton* m_pAddCommandsButton;
- MenuButton* m_pModifyCommandButton;
+ VclPtr<PushButton> m_pAddCommandsButton;
+ VclPtr<MenuButton> m_pModifyCommandButton;
- PushButton* m_pMoveUpButton;
- PushButton* m_pMoveDownButton;
+ VclPtr<PushButton> m_pMoveUpButton;
+ VclPtr<PushButton> m_pMoveDownButton;
- ListBox* m_pSaveInListBox;
+ VclPtr<ListBox> m_pSaveInListBox;
- VclMultiLineEdit* m_pDescriptionField;
+ VclPtr<VclMultiLineEdit> m_pDescriptionField;
- SvxScriptSelectorDialog* m_pSelectorDlg;
+ VclPtr<SvxScriptSelectorDialog> m_pSelectorDlg;
/// the ResourceURL to select when opening the dialog
OUString m_aURLToSelect;
@@ -410,7 +411,7 @@ protected:
SvTreeListEntry* pTarget = NULL,
bool bFront = false );
- void AddSubMenusToUI( const OUString& rBaseTitle,
+ void AddSubMenusToUI( const OUString& rBaseTitle,
SvxConfigEntry* pParentData );
SvTreeListEntry* InsertEntryIntoUI ( SvxConfigEntry* pNewEntryData,
@@ -423,6 +424,9 @@ protected:
public:
+ virtual ~SvxConfigPage();
+ virtual void dispose() SAL_OVERRIDE;
+
static bool CanConfig( const OUString& rModuleId );
SaveInData* GetSaveInData() { return pCurrentSaveInData; }
@@ -483,6 +487,7 @@ private:
public:
SvxMenuConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet );
virtual ~SvxMenuConfigPage();
+ virtual void dispose() SAL_OVERRIDE;
SaveInData* CreateSaveInData(
const ::com::sun::star::uno::Reference <
@@ -495,11 +500,11 @@ public:
class SvxMainMenuOrganizerDialog : public ModalDialog
{
- VclContainer* m_pMenuBox;
- Edit* m_pMenuNameEdit;
- SvTreeListBox* m_pMenuListBox;
- PushButton* m_pMoveUpButton;
- PushButton* m_pMoveDownButton;
+ VclPtr<VclContainer> m_pMenuBox;
+ VclPtr<Edit> m_pMenuNameEdit;
+ VclPtr<SvTreeListBox> m_pMenuListBox;
+ VclPtr<PushButton> m_pMoveUpButton;
+ VclPtr<PushButton> m_pMoveDownButton;
SvxEntries* mpEntries;
SvTreeListEntry* pNewMenuEntry;
@@ -515,8 +520,8 @@ public:
SvxMainMenuOrganizerDialog (
vcl::Window*, SvxEntries*,
SvxConfigEntry*, bool bCreateMenu = false );
-
- virtual ~SvxMainMenuOrganizerDialog ();
+ virtual ~SvxMainMenuOrganizerDialog();
+ virtual void dispose() SAL_OVERRIDE;
SvxEntries* GetEntries() { return mpEntries;}
void SetEntries( SvxEntries* );
@@ -528,7 +533,7 @@ class SvxToolbarEntriesListBox : public SvxMenuEntriesListBox
Size m_aCheckBoxImageSizePixel;
Link m_aChangedListener;
SvLBoxButtonData* m_pButtonData;
- SvxConfigPage* pPage;
+ VclPtr<SvxConfigPage> pPage;
void ChangeVisibility( SvTreeListEntry* pEntry );
@@ -544,6 +549,7 @@ public:
SvxToolbarEntriesListBox(vcl::Window* pParent, SvxToolbarConfigPage* pPg);
virtual ~SvxToolbarEntriesListBox();
+ virtual void dispose() SAL_OVERRIDE;
void SetChangedListener( const Link& aChangedListener )
{ m_aChangedListener = aChangedListener; }
@@ -584,6 +590,7 @@ private:
public:
SvxToolbarConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet );
virtual ~SvxToolbarConfigPage();
+ virtual void dispose() SAL_OVERRIDE;
SvTreeListEntry* AddFunction( SvTreeListEntry* pTarget = NULL,
bool bFront = false,
@@ -662,8 +669,8 @@ public:
class SvxNewToolbarDialog : public ModalDialog
{
private:
- Edit* m_pEdtName;
- OKButton* m_pBtnOK;
+ VclPtr<Edit> m_pEdtName;
+ VclPtr<OKButton> m_pBtnOK;
Link aCheckNameHdl;
@@ -671,8 +678,10 @@ private:
public:
SvxNewToolbarDialog(vcl::Window* pWindow, const OUString& rName);
+ virtual ~SvxNewToolbarDialog();
+ virtual void dispose() SAL_OVERRIDE;
- ListBox* m_pSaveInListBox;
+ VclPtr<ListBox> m_pSaveInListBox;
OUString GetName()
{
@@ -702,10 +711,10 @@ struct SvxIconSelectorToolBoxItem
class SvxIconSelectorDialog : public ModalDialog
{
private:
- ToolBox* pTbSymbol;
- FixedText* pFtNote;
- PushButton* pBtnImport;
- PushButton* pBtnDelete;
+ VclPtr<ToolBox> pTbSymbol;
+ VclPtr<FixedText> pFtNote;
+ VclPtr<PushButton> pBtnImport;
+ VclPtr<PushButton> pBtnDelete;
Size aTbSize;
sal_uInt16 m_nNextId;
@@ -741,6 +750,7 @@ public:
);
virtual ~SvxIconSelectorDialog();
+ virtual void dispose() SAL_OVERRIDE;
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
GetSelectedIcon();
@@ -769,10 +779,12 @@ public:
class SvxIconChangeDialog : public ModalDialog
{
private:
- FixedImage* pFImageInfo;
- VclMultiLineEdit* pLineEditDescription;
+ VclPtr<FixedImage> pFImageInfo;
+ VclPtr<VclMultiLineEdit> pLineEditDescription;
public:
SvxIconChangeDialog(vcl::Window *pWindow, const OUString& aMessage);
+ virtual ~SvxIconChangeDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
#endif // INCLUDED_CUI_SOURCE_INC_CFG_HXX
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index 3e445ce0e853..984e8e9e4c80 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -113,6 +113,7 @@ class SfxConfigFunctionListBox : public SvTreeListBox
public:
SfxConfigFunctionListBox(vcl::Window*, WinBits nStyle);
virtual ~SfxConfigFunctionListBox();
+ virtual void dispose() SAL_OVERRIDE;
void ClearAll();
using Window::GetHelpText;
@@ -127,7 +128,7 @@ struct SvxConfigGroupBoxResource_Impl;
class SfxConfigGroupListBox : public SvTreeListBox
{
SvxConfigGroupBoxResource_Impl* pImp;
- SfxConfigFunctionListBox* pFunctionListBox;
+ VclPtr<SfxConfigFunctionListBox> pFunctionListBox;
SfxGroupInfoArr_Impl aArr;
OUString m_sModuleLongName;
@@ -162,6 +163,7 @@ protected:
public:
SfxConfigGroupListBox(vcl::Window* pParent, WinBits nStyle);
virtual ~SfxConfigGroupListBox();
+ virtual void dispose() SAL_OVERRIDE;
void ClearAll();
void Init(const css::uno::Reference< css::uno::XComponentContext >& xContext,
diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx
index 9a471ff3e048..fad03f168fe4 100644
--- a/cui/source/inc/chardlg.hxx
+++ b/cui/source/inc/chardlg.hxx
@@ -47,14 +47,12 @@ class FontList;
class SvxCharBasePage : public SfxTabPage
{
protected:
- SvxFontPrevWindow* m_pPreviewWin;
+ VclPtr<SvxFontPrevWindow> m_pPreviewWin;
bool m_bPreviewBackgroundToCharacter;
SvxCharBasePage(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet& rItemset);
- virtual ~SvxCharBasePage();
-
void SetPrevFontWidthScale( const SfxItemSet& rSet );
void SetPrevFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc );
@@ -63,6 +61,9 @@ protected:
inline SvxFont& GetPreviewCTLFont();
public:
+ virtual ~SvxCharBasePage();
+ virtual void dispose() SAL_OVERRIDE;
+
using SfxTabPage::ActivatePage;
using SfxTabPage::DeactivatePage;
@@ -79,38 +80,38 @@ class SvxCharNamePage : public SvxCharBasePage
private:
static const sal_uInt16 pNameRanges[];
- VclContainer* m_pWestFrame;
- FixedText* m_pWestFontNameFT;
- FontNameBox* m_pWestFontNameLB;
- FixedText* m_pWestFontStyleFT;
- FontStyleBox* m_pWestFontStyleLB;
- FixedText* m_pWestFontSizeFT;
- FontSizeBox* m_pWestFontSizeLB;
- FixedText* m_pWestFontLanguageFT;
- SvxLanguageComboBox* m_pWestFontLanguageLB;
- FixedText* m_pWestFontTypeFT;
-
- VclContainer* m_pEastFrame;
- FixedText* m_pEastFontNameFT;
- FontNameBox* m_pEastFontNameLB;
- FixedText* m_pEastFontStyleFT;
- FontStyleBox* m_pEastFontStyleLB;
- FixedText* m_pEastFontSizeFT;
- FontSizeBox* m_pEastFontSizeLB;
- FixedText* m_pEastFontLanguageFT;
- SvxLanguageBox* m_pEastFontLanguageLB;
- FixedText* m_pEastFontTypeFT;
-
- VclContainer* m_pCTLFrame;
- FixedText* m_pCTLFontNameFT;
- FontNameBox* m_pCTLFontNameLB;
- FixedText* m_pCTLFontStyleFT;
- FontStyleBox* m_pCTLFontStyleLB;
- FixedText* m_pCTLFontSizeFT;
- FontSizeBox* m_pCTLFontSizeLB;
- FixedText* m_pCTLFontLanguageFT;
- SvxLanguageBox* m_pCTLFontLanguageLB;
- FixedText* m_pCTLFontTypeFT;
+ VclPtr<VclContainer> m_pWestFrame;
+ VclPtr<FixedText> m_pWestFontNameFT;
+ VclPtr<FontNameBox> m_pWestFontNameLB;
+ VclPtr<FixedText> m_pWestFontStyleFT;
+ VclPtr<FontStyleBox> m_pWestFontStyleLB;
+ VclPtr<FixedText> m_pWestFontSizeFT;
+ VclPtr<FontSizeBox> m_pWestFontSizeLB;
+ VclPtr<FixedText> m_pWestFontLanguageFT;
+ VclPtr<SvxLanguageComboBox> m_pWestFontLanguageLB;
+ VclPtr<FixedText> m_pWestFontTypeFT;
+
+ VclPtr<VclContainer> m_pEastFrame;
+ VclPtr<FixedText> m_pEastFontNameFT;
+ VclPtr<FontNameBox> m_pEastFontNameLB;
+ VclPtr<FixedText> m_pEastFontStyleFT;
+ VclPtr<FontStyleBox> m_pEastFontStyleLB;
+ VclPtr<FixedText> m_pEastFontSizeFT;
+ VclPtr<FontSizeBox> m_pEastFontSizeLB;
+ VclPtr<FixedText> m_pEastFontLanguageFT;
+ VclPtr<SvxLanguageBox> m_pEastFontLanguageLB;
+ VclPtr<FixedText> m_pEastFontTypeFT;
+
+ VclPtr<VclContainer> m_pCTLFrame;
+ VclPtr<FixedText> m_pCTLFontNameFT;
+ VclPtr<FontNameBox> m_pCTLFontNameLB;
+ VclPtr<FixedText> m_pCTLFontStyleFT;
+ VclPtr<FontStyleBox> m_pCTLFontStyleLB;
+ VclPtr<FixedText> m_pCTLFontSizeFT;
+ VclPtr<FontSizeBox> m_pCTLFontSizeLB;
+ VclPtr<FixedText> m_pCTLFontLanguageFT;
+ VclPtr<SvxLanguageBox> m_pCTLFontLanguageLB;
+ VclPtr<FixedText> m_pCTLFontTypeFT;
SvxCharNamePage_Impl* m_pImpl;
@@ -152,8 +153,9 @@ public:
public:
virtual ~SvxCharNamePage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pNameRanges; }
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -176,44 +178,43 @@ class SvxCharEffectsPage : public SvxCharBasePage
private:
static const sal_uInt16 pEffectsRanges[];
- FixedText* m_pFontColorFT;
- ColorListBox* m_pFontColorLB;
+ VclPtr<FixedText> m_pFontColorFT;
+ VclPtr<ColorListBox> m_pFontColorLB;
- FixedText* m_pEffectsFT;
- ListBox* m_pEffectsLB;
+ VclPtr<FixedText> m_pEffectsFT;
+ VclPtr<ListBox> m_pEffectsLB;
- FixedText* m_pReliefFT;
- ListBox* m_pReliefLB;
+ VclPtr<FixedText> m_pReliefFT;
+ VclPtr<ListBox> m_pReliefLB;
- TriStateBox* m_pOutlineBtn;
- TriStateBox* m_pShadowBtn;
- TriStateBox* m_pBlinkingBtn;
- TriStateBox* m_pHiddenBtn;
+ VclPtr<TriStateBox> m_pOutlineBtn;
+ VclPtr<TriStateBox> m_pShadowBtn;
+ VclPtr<TriStateBox> m_pBlinkingBtn;
+ VclPtr<TriStateBox> m_pHiddenBtn;
- ListBox* m_pOverlineLB;
- FixedText* m_pOverlineColorFT;
- ColorListBox* m_pOverlineColorLB;
+ VclPtr<ListBox> m_pOverlineLB;
+ VclPtr<FixedText> m_pOverlineColorFT;
+ VclPtr<ColorListBox> m_pOverlineColorLB;
- ListBox* m_pStrikeoutLB;
+ VclPtr<ListBox> m_pStrikeoutLB;
- ListBox* m_pUnderlineLB;
- FixedText* m_pUnderlineColorFT;
- ColorListBox* m_pUnderlineColorLB;
+ VclPtr<ListBox> m_pUnderlineLB;
+ VclPtr<FixedText> m_pUnderlineColorFT;
+ VclPtr<ColorListBox> m_pUnderlineColorLB;
- CheckBox* m_pIndividualWordsBtn;
+ VclPtr<CheckBox> m_pIndividualWordsBtn;
- FixedText* m_pEmphasisFT;
- ListBox* m_pEmphasisLB;
+ VclPtr<FixedText> m_pEmphasisFT;
+ VclPtr<ListBox> m_pEmphasisLB;
- FixedText* m_pPositionFT;
- ListBox* m_pPositionLB;
+ VclPtr<FixedText> m_pPositionFT;
+ VclPtr<ListBox> m_pPositionLB;
sal_uInt16 m_nHtmlMode;
OUString m_aTransparentColorName;
SvxCharEffectsPage( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxCharEffectsPage();
void Initialize();
void UpdatePreview_Impl();
@@ -228,12 +229,14 @@ private:
DECL_LINK( ColorBoxSelectHdl_Impl, ColorListBox* );
public:
- using SfxTabPage::DeactivatePage;
+ virtual ~SvxCharEffectsPage();
+ virtual void dispose() SAL_OVERRIDE;
+ using SfxTabPage::DeactivatePage;
virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pEffectsRanges; }
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -254,30 +257,30 @@ class SvxCharPositionPage : public SvxCharBasePage
static const sal_uInt16 pPositionRanges[];
private:
- RadioButton* m_pHighPosBtn;
- RadioButton* m_pNormalPosBtn;
- RadioButton* m_pLowPosBtn;
- FixedText* m_pHighLowFT;
- MetricField* m_pHighLowMF;
- CheckBox* m_pHighLowRB;
- FixedText* m_pFontSizeFT;
- MetricField* m_pFontSizeMF;
-
- VclContainer* m_pRotationContainer;
-
- FixedText* m_pScalingFT;
- FixedText* m_pScalingAndRotationFT;
- RadioButton* m_p0degRB;
- RadioButton* m_p90degRB;
- RadioButton* m_p270degRB;
- CheckBox* m_pFitToLineCB;
-
- MetricField* m_pScaleWidthMF;
-
- ListBox* m_pKerningLB;
- FixedText* m_pKerningFT;
- MetricField* m_pKerningMF;
- CheckBox* m_pPairKerningBtn;
+ VclPtr<RadioButton> m_pHighPosBtn;
+ VclPtr<RadioButton> m_pNormalPosBtn;
+ VclPtr<RadioButton> m_pLowPosBtn;
+ VclPtr<FixedText> m_pHighLowFT;
+ VclPtr<MetricField> m_pHighLowMF;
+ VclPtr<CheckBox> m_pHighLowRB;
+ VclPtr<FixedText> m_pFontSizeFT;
+ VclPtr<MetricField> m_pFontSizeMF;
+
+ VclPtr<VclContainer> m_pRotationContainer;
+
+ VclPtr<FixedText> m_pScalingFT;
+ VclPtr<FixedText> m_pScalingAndRotationFT;
+ VclPtr<RadioButton> m_p0degRB;
+ VclPtr<RadioButton> m_p90degRB;
+ VclPtr<RadioButton> m_p270degRB;
+ VclPtr<CheckBox> m_pFitToLineCB;
+
+ VclPtr<MetricField> m_pScaleWidthMF;
+
+ VclPtr<ListBox> m_pKerningLB;
+ VclPtr<FixedText> m_pKerningFT;
+ VclPtr<MetricField> m_pKerningMF;
+ VclPtr<CheckBox> m_pPairKerningBtn;
short m_nSuperEsc;
short m_nSubEsc;
@@ -289,7 +292,6 @@ private:
sal_uInt8 m_nSubProp;
SvxCharPositionPage( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxCharPositionPage();
void Initialize();
void UpdatePreview_Impl( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc );
@@ -307,6 +309,9 @@ private:
DECL_LINK(ScaleWidthModifyHdl_Impl, void *);
public:
+ virtual ~SvxCharPositionPage();
+ virtual void dispose() SAL_OVERRIDE;
+
using SfxTabPage::ActivatePage;
using SfxTabPage::DeactivatePage;
@@ -314,7 +319,7 @@ public:
virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pPositionRanges; }
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -331,16 +336,15 @@ class SvxCharTwoLinesPage : public SvxCharBasePage
{
private:
static const sal_uInt16 pTwoLinesRanges[];
- CheckBox* m_pTwoLinesBtn;
- VclContainer* m_pEnclosingFrame;
- ListBox* m_pStartBracketLB;
- ListBox* m_pEndBracketLB;
+ VclPtr<CheckBox> m_pTwoLinesBtn;
+ VclPtr<VclContainer> m_pEnclosingFrame;
+ VclPtr<ListBox> m_pStartBracketLB;
+ VclPtr<ListBox> m_pEndBracketLB;
sal_uInt16 m_nStartBracketPosition;
sal_uInt16 m_nEndBracketPosition;
SvxCharTwoLinesPage(vcl::Window* pParent, const SfxItemSet& rSet);
- virtual ~SvxCharTwoLinesPage();
void UpdatePreview_Impl();
void Initialize();
@@ -351,14 +355,16 @@ private:
DECL_LINK( CharacterMapHdl_Impl, ListBox* );
public:
+ virtual ~SvxCharTwoLinesPage();
+ virtual void dispose() SAL_OVERRIDE;
+
using SfxTabPage::ActivatePage;
using SfxTabPage::DeactivatePage;
virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
-public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pTwoLinesRanges; }
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/inc/connect.hxx b/cui/source/inc/connect.hxx
index a85dabdb8a5f..875ff89baf9b 100644
--- a/cui/source/inc/connect.hxx
+++ b/cui/source/inc/connect.hxx
@@ -34,21 +34,21 @@ class SvxConnectionPage : public SfxTabPage
{
private:
static const sal_uInt16 pRanges[];
- ListBox* m_pLbType;
+ VclPtr<ListBox> m_pLbType;
- FixedText* m_pFtLine1;
- MetricField* m_pMtrFldLine1;
- FixedText* m_pFtLine2;
- MetricField* m_pMtrFldLine2;
- FixedText* m_pFtLine3;
- MetricField* m_pMtrFldLine3;
+ VclPtr<FixedText> m_pFtLine1;
+ VclPtr<MetricField> m_pMtrFldLine1;
+ VclPtr<FixedText> m_pFtLine2;
+ VclPtr<MetricField> m_pMtrFldLine2;
+ VclPtr<FixedText> m_pFtLine3;
+ VclPtr<MetricField> m_pMtrFldLine3;
- MetricField* m_pMtrFldHorz1;
- MetricField* m_pMtrFldVert1;
- MetricField* m_pMtrFldHorz2;
- MetricField* m_pMtrFldVert2;
+ VclPtr<MetricField> m_pMtrFldHorz1;
+ VclPtr<MetricField> m_pMtrFldVert1;
+ VclPtr<MetricField> m_pMtrFldHorz2;
+ VclPtr<MetricField> m_pMtrFldVert2;
- SvxXConnectionPreview* m_pCtlPreview;
+ VclPtr<SvxXConnectionPreview> m_pCtlPreview;
const SfxItemSet& rOutAttrs;
SfxItemSet aAttrSet;
@@ -63,8 +63,9 @@ public:
SvxConnectionPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs );
virtual ~SvxConnectionPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -82,7 +83,6 @@ class SvxConnectionDialog : public SfxSingleTabDialog
public:
SvxConnectionDialog( vcl::Window* pParent, const SfxItemSet& rAttr,
const SdrView* pView );
- virtual ~SvxConnectionDialog();
};
#endif // INCLUDED_CUI_SOURCE_INC_CONNECT_HXX
diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx
index a2e30e516502..596d3231443e 100644
--- a/cui/source/inc/cuicharmap.hxx
+++ b/cui/source/inc/cuicharmap.hxx
@@ -41,7 +41,6 @@ class SvxShowText : public Control
public:
SvxShowText( vcl::Window* pParent,
bool bCenter = false );
- virtual ~SvxShowText();
void SetFont( const vcl::Font& rFont );
void SetText( const OUString& rText ) SAL_OVERRIDE;
@@ -68,16 +67,16 @@ private:
void init();
- SvxShowCharSet* m_pShowSet;
- Edit* m_pShowText;
- PushButton* m_pOKBtn;
- FixedText* m_pFontText;
- ListBox* m_pFontLB;
- FixedText* m_pSubsetText;
- ListBox* m_pSubsetLB;
- FixedText* m_pSymbolText;
- SvxShowText* m_pShowChar;
- FixedText* m_pCharCodeText;
+ VclPtr<SvxShowCharSet> m_pShowSet;
+ VclPtr<Edit> m_pShowText;
+ VclPtr<PushButton> m_pOKBtn;
+ VclPtr<FixedText> m_pFontText;
+ VclPtr<ListBox> m_pFontLB;
+ VclPtr<FixedText> m_pSubsetText;
+ VclPtr<ListBox> m_pSubsetLB;
+ VclPtr<FixedText> m_pSymbolText;
+ VclPtr<SvxShowText> m_pShowChar;
+ VclPtr<FixedText> m_pCharCodeText;
vcl::Font aFont;
bool bOne;
const SubsetMap* pSubsetMap;
@@ -94,7 +93,8 @@ private:
public:
SvxCharacterMap( vcl::Window* pParent, bool bOne=true, const SfxItemSet* pSet=0 );
- virtual ~SvxCharacterMap();
+ virtual ~SvxCharacterMap();
+ virtual void dispose() SAL_OVERRIDE;
void DisableFontSelection();
diff --git a/cui/source/inc/cuifmsearch.hxx b/cui/source/inc/cuifmsearch.hxx
index d163b3d44b6f..d56c9d5ee2a4 100644
--- a/cui/source/inc/cuifmsearch.hxx
+++ b/cui/source/inc/cuifmsearch.hxx
@@ -47,36 +47,36 @@ class FmSearchDialog : public ModalDialog
friend class FmSearchEngine;
// my all Controls
- RadioButton *m_prbSearchForText;
- RadioButton *m_prbSearchForNull;
- RadioButton *m_prbSearchForNotNull;
- ComboBox *m_pcmbSearchText;
- FixedText *m_pftForm;
- ListBox *m_plbForm;
- RadioButton *m_prbAllFields;
- RadioButton *m_prbSingleField;
- ListBox *m_plbField;
- FixedText *m_pftPosition;
- ListBox *m_plbPosition;
- CheckBox *m_pcbUseFormat;
- CheckBox *m_pcbCase;
- CheckBox *m_pcbBackwards;
- CheckBox *m_pcbStartOver;
- CheckBox *m_pcbWildCard;
- CheckBox *m_pcbRegular;
- CheckBox *m_pcbApprox;
- PushButton *m_ppbApproxSettings;
- CheckBox *m_pHalfFullFormsCJK;
- CheckBox *m_pSoundsLikeCJK;
- PushButton *m_pSoundsLikeCJKSettings;
- FixedText *m_pftRecord;
- FixedText *m_pftHint;
- PushButton *m_pbSearchAgain;
- CancelButton *m_pbClose;
+ VclPtr<RadioButton> m_prbSearchForText;
+ VclPtr<RadioButton> m_prbSearchForNull;
+ VclPtr<RadioButton> m_prbSearchForNotNull;
+ VclPtr<ComboBox> m_pcmbSearchText;
+ VclPtr<FixedText> m_pftForm;
+ VclPtr<ListBox> m_plbForm;
+ VclPtr<RadioButton> m_prbAllFields;
+ VclPtr<RadioButton> m_prbSingleField;
+ VclPtr<ListBox> m_plbField;
+ VclPtr<FixedText> m_pftPosition;
+ VclPtr<ListBox> m_plbPosition;
+ VclPtr<CheckBox> m_pcbUseFormat;
+ VclPtr<CheckBox> m_pcbCase;
+ VclPtr<CheckBox> m_pcbBackwards;
+ VclPtr<CheckBox> m_pcbStartOver;
+ VclPtr<CheckBox> m_pcbWildCard;
+ VclPtr<CheckBox> m_pcbRegular;
+ VclPtr<CheckBox> m_pcbApprox;
+ VclPtr<PushButton> m_ppbApproxSettings;
+ VclPtr<CheckBox> m_pHalfFullFormsCJK;
+ VclPtr<CheckBox> m_pSoundsLikeCJK;
+ VclPtr<PushButton> m_pSoundsLikeCJKSettings;
+ VclPtr<FixedText> m_pftRecord;
+ VclPtr<FixedText> m_pftHint;
+ VclPtr<PushButton> m_pbSearchAgain;
+ VclPtr<CancelButton> m_pbClose;
OUString m_sSearch;
OUString m_sCancel;
- vcl::Window* m_pPreSearchFocus;
+ VclPtr<vcl::Window> m_pPreSearchFocus;
Link m_lnkFoundHandler; ///< Handler for "found"
Link m_lnkCanceledNotFoundHdl; ///< Handler for Positioning the Cursors
@@ -111,6 +111,7 @@ public:
const Link& lnkContextSupplier);
virtual ~FmSearchDialog();
+ virtual void dispose() SAL_OVERRIDE;
/** The found-handler gets in the 'found'-case a pointer on a FmFoundRecordInformation-structure
(which is only valid in the handler; so if one needs to memorize the data, don't copy the pointer but
diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx
index a57904afd53a..a1855b1a1fdd 100644
--- a/cui/source/inc/cuigaldlg.hxx
+++ b/cui/source/inc/cuigaldlg.hxx
@@ -60,8 +60,8 @@ class SearchThread: public salhelper::Thread
{
private:
- SearchProgress* mpProgress;
- TPGalleryThemeProperties* mpBrowser;
+ VclPtr<SearchProgress> mpProgress;
+ VclPtr<TPGalleryThemeProperties> mpBrowser;
INetURLObject maStartURL;
void ImplSearch( const INetURLObject& rStartURL,
@@ -81,10 +81,10 @@ public:
class SearchProgress : public ModalDialog
{
private:
- FixedText* m_pFtSearchDir;
- FixedText* m_pFtSearchType;
- CancelButton* m_pBtnCancel;
- vcl::Window * parent_;
+ VclPtr<FixedText> m_pFtSearchDir;
+ VclPtr<FixedText> m_pFtSearchType;
+ VclPtr<CancelButton> m_pBtnCancel;
+ VclPtr<vcl::Window> parent_;
INetURLObject startUrl_;
rtl::Reference< SearchThread > maSearchThread;
@@ -93,7 +93,8 @@ private:
public:
SearchProgress( vcl::Window* pParent, const INetURLObject& rStartURL );
- virtual ~SearchProgress() {};
+ virtual ~SearchProgress();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( CleanUpHdl, void* );
@@ -107,8 +108,8 @@ class TakeThread: public salhelper::Thread
{
private:
- TakeProgress* mpProgress;
- TPGalleryThemeProperties* mpBrowser;
+ VclPtr<TakeProgress> mpProgress;
+ VclPtr<TPGalleryThemeProperties> mpBrowser;
TokenList_impl& mrTakenList;
virtual ~TakeThread();
@@ -126,9 +127,9 @@ public:
class TakeProgress : public ModalDialog
{
private:
- FixedText* m_pFtTakeFile;
- CancelButton* m_pBtnCancel;
- vcl::Window * window_;
+ VclPtr<FixedText> m_pFtTakeFile;
+ VclPtr<CancelButton> m_pBtnCancel;
+ VclPtr<vcl::Window> window_;
rtl::Reference< TakeThread > maTakeThread;
TokenList_impl maTakenList;
@@ -138,6 +139,8 @@ private:
public:
TakeProgress( vcl::Window* pWindow );
+ virtual ~TakeProgress();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( CleanUpHdl, void* );
@@ -149,8 +152,8 @@ public:
class ActualizeProgress : public ModalDialog
{
private:
- FixedText* m_pFtActualizeFile;
- CancelButton* m_pBtnCancel;
+ VclPtr<FixedText> m_pFtActualizeFile;
+ VclPtr<CancelButton> m_pBtnCancel;
Idle* pIdle;
GalleryTheme* pTheme;
GalleryProgress aStatusProgress;
@@ -161,7 +164,8 @@ private:
public:
ActualizeProgress( vcl::Window* pWindow, GalleryTheme* pThm );
- virtual ~ActualizeProgress() {};
+ virtual ~ActualizeProgress();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
};
@@ -169,23 +173,27 @@ public:
class TitleDialog : public ModalDialog
{
private:
- Edit* m_pEdit;
+ VclPtr<Edit> m_pEdit;
public:
TitleDialog(vcl::Window* pParent, const OUString& rOldText);
+ virtual ~TitleDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetTitle() const { return m_pEdit->GetText(); }
};
class GalleryIdDialog : public ModalDialog
{
private:
- OKButton* m_pBtnOk;
- ListBox* m_pLbResName;
+ VclPtr<OKButton> m_pBtnOk;
+ VclPtr<ListBox> m_pLbResName;
GalleryTheme* pThm;
DECL_LINK( ClickOkHdl, void* );
DECL_LINK( ClickResNameHdl, void* );
public:
GalleryIdDialog( vcl::Window* pParent, GalleryTheme* pThm );
+ virtual ~GalleryIdDialog();
+ virtual void dispose() SAL_OVERRIDE;
sal_uLong GetId() const { return m_pLbResName->GetSelectEntryPos(); }
};
@@ -206,12 +214,12 @@ class TPGalleryThemeGeneral : public SfxTabPage
{
private:
- FixedImage* m_pFiMSImage;
- Edit* m_pEdtMSName;
- FixedText* m_pFtMSShowType;
- FixedText* m_pFtMSShowPath;
- FixedText* m_pFtMSShowContent;
- FixedText* m_pFtMSShowChangeDate;
+ VclPtr<FixedImage> m_pFiMSImage;
+ VclPtr<Edit> m_pEdtMSName;
+ VclPtr<FixedText> m_pFtMSShowType;
+ VclPtr<FixedText> m_pFtMSShowPath;
+ VclPtr<FixedText> m_pFtMSShowContent;
+ VclPtr<FixedText> m_pFtMSShowChangeDate;
ExchangeData* pData;
virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE {}
@@ -221,12 +229,13 @@ private:
public:
TPGalleryThemeGeneral( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~TPGalleryThemeGeneral() {}
+ virtual ~TPGalleryThemeGeneral();
+ virtual void dispose() SAL_OVERRIDE;
void SetXChgData( ExchangeData* pData );
const ExchangeData* GetXChgData() const { return pData; }
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
};
typedef ::std::vector< FilterEntry* > FilterEntryList_impl;
@@ -237,13 +246,13 @@ class TPGalleryThemeProperties : public SfxTabPage
friend class TakeProgress;
friend class TakeThread;
- ComboBox* m_pCbbFileType;
- ListBox* m_pLbxFound;
- PushButton* m_pBtnSearch;
- PushButton* m_pBtnTake;
- PushButton* m_pBtnTakeAll;
- CheckBox* m_pCbxPreview;
- GalleryPreview* m_pWndPreview;
+ VclPtr<ComboBox> m_pCbbFileType;
+ VclPtr<ListBox> m_pLbxFound;
+ VclPtr<PushButton> m_pBtnSearch;
+ VclPtr<PushButton> m_pBtnTake;
+ VclPtr<PushButton> m_pBtnTakeAll;
+ VclPtr<CheckBox> m_pCbxPreview;
+ VclPtr<GalleryPreview> m_pWndPreview;
ExchangeData* pData;
StringList aFoundList;
@@ -287,13 +296,14 @@ class TPGalleryThemeProperties : public SfxTabPage
public:
TPGalleryThemeProperties( vcl::Window* pWindow, const SfxItemSet& rSet );
virtual ~TPGalleryThemeProperties();
+ virtual void dispose() SAL_OVERRIDE;
void SetXChgData( ExchangeData* pData );
const ExchangeData* GetXChgData() const { return pData; }
void StartSearchFiles( const OUString& _rFolderURL, short _nDlgResult );
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
};
#endif // INCLUDED_CUI_SOURCE_INC_CUIGALDLG_HXX
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index 1fb139375fd7..f43685d65fd2 100644
--- a/cui/source/inc/cuigrfflt.hxx
+++ b/cui/source/inc/cuigrfflt.hxx
@@ -77,7 +77,7 @@ private:
DECL_LINK( ImplModifyHdl, void* p );
protected:
- GraphicPreviewWindow* mpPreview;
+ VclPtr<GraphicPreviewWindow> mpPreview;
const Link& GetModifyHdl() const { return maModifyHdl; }
const Size& GetGraphicSizePixel() const { return maSizePixel; }
@@ -85,6 +85,8 @@ protected:
public:
GraphicFilterDialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription, const Graphic& rGraphic);
+ virtual ~GraphicFilterDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) = 0;
};
@@ -97,11 +99,13 @@ public:
class GraphicFilterSmooth : public GraphicFilterDialog
{
private:
- NumericField* mpMtrRadius;
+ VclPtr<NumericField> mpMtrRadius;
public:
GraphicFilterSmooth( vcl::Window* pParent, const Graphic& rGraphic, double nRadius);
+ virtual ~GraphicFilterSmooth();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) SAL_OVERRIDE;
double GetRadius() const { return mpMtrRadius->GetValue() / 10.0; }
@@ -114,14 +118,16 @@ public:
class GraphicFilterMosaic : public GraphicFilterDialog
{
private:
- MetricField* mpMtrWidth;
- MetricField* mpMtrHeight;
- CheckBox* mpCbxEdges;
+ VclPtr<MetricField> mpMtrWidth;
+ VclPtr<MetricField> mpMtrHeight;
+ VclPtr<CheckBox> mpCbxEdges;
public:
GraphicFilterMosaic(vcl::Window* pParent, const Graphic& rGraphic,
sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, bool bEnhanceEdges);
+ virtual ~GraphicFilterMosaic();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) SAL_OVERRIDE;
long GetTileWidth() const { return static_cast<long>(mpMtrWidth->GetValue()); }
@@ -136,13 +142,15 @@ public:
class GraphicFilterSolarize : public GraphicFilterDialog
{
private:
- MetricField* mpMtrThreshold;
- CheckBox* mpCbxInvert;
+ VclPtr<MetricField> mpMtrThreshold;
+ VclPtr<CheckBox> mpCbxInvert;
public:
GraphicFilterSolarize( vcl::Window* pParent, const Graphic& rGraphic,
sal_uInt8 nGreyThreshold, bool bInvert );
+ virtual ~GraphicFilterSolarize();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) SAL_OVERRIDE;
sal_uInt8 GetGreyThreshold() const { return( (sal_uInt8) FRound( mpMtrThreshold->GetValue() * 2.55 ) ); }
@@ -156,10 +164,12 @@ public:
class GraphicFilterSepia : public GraphicFilterDialog
{
private:
- MetricField* mpMtrSepia;
+ VclPtr<MetricField> mpMtrSepia;
public:
GraphicFilterSepia( vcl::Window* pParent, const Graphic& rGraphic,
sal_uInt16 nSepiaPercent );
+ virtual ~GraphicFilterSepia();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) SAL_OVERRIDE;
sal_uInt16 GetSepiaPercent() const
{
@@ -174,10 +184,12 @@ public:
class GraphicFilterPoster : public GraphicFilterDialog
{
private:
- NumericField* mpNumPoster;
+ VclPtr<NumericField> mpNumPoster;
public:
GraphicFilterPoster( vcl::Window* pParent, const Graphic& rGraphic,
sal_uInt16 nPosterColorCount );
+ virtual ~GraphicFilterPoster();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) SAL_OVERRIDE;
sal_uInt16 GetPosterColorCount() const { return( (sal_uInt16) mpNumPoster->GetValue() ); }
@@ -203,10 +215,12 @@ public:
class GraphicFilterEmboss : public GraphicFilterDialog
{
private:
- EmbossControl* mpCtlLight;
+ VclPtr<EmbossControl> mpCtlLight;
public:
GraphicFilterEmboss( vcl::Window* pParent, const Graphic& rGraphic,
RECT_POINT eLightSource );
+ virtual ~GraphicFilterEmboss();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) SAL_OVERRIDE;
RECT_POINT GetLightSource() const { return mpCtlLight->GetActualRP(); }
diff --git a/cui/source/inc/cuihyperdlg.hxx b/cui/source/inc/cuihyperdlg.hxx
index 8ef2930ae952..b85633738ddf 100644
--- a/cui/source/inc/cuihyperdlg.hxx
+++ b/cui/source/inc/cuihyperdlg.hxx
@@ -38,7 +38,7 @@ class SvxHpLinkDlg;
class SvxHlinkCtrl : public SfxControllerItem
{
private :
- SvxHpLinkDlg *pParent;
+ VclPtr<SvxHpLinkDlg> pParent;
SfxStatusForwarder aRdOnlyForwarder;
@@ -80,6 +80,7 @@ protected:
public:
SvxHpLinkDlg (vcl::Window* pParent, SfxBindings* pBindings );
virtual ~SvxHpLinkDlg ();
+ virtual void dispose() SAL_OVERRIDE;
virtual void PageCreated( sal_uInt16 nId, IconChoicePage& rPage ) SAL_OVERRIDE;
diff --git a/cui/source/inc/cuiimapwnd.hxx b/cui/source/inc/cuiimapwnd.hxx
index 3266a2a3449c..87c7e546cc6a 100644
--- a/cui/source/inc/cuiimapwnd.hxx
+++ b/cui/source/inc/cuiimapwnd.hxx
@@ -33,11 +33,11 @@
class URLDlg : public ModalDialog
{
- Edit* m_pEdtURL;
- ComboBox* m_pCbbTargets;
- Edit* m_pEdtName;
- Edit* m_pEdtAlternativeText;
- VclMultiLineEdit* m_pEdtDescription;
+ VclPtr<Edit> m_pEdtURL;
+ VclPtr<ComboBox> m_pCbbTargets;
+ VclPtr<Edit> m_pEdtName;
+ VclPtr<Edit> m_pEdtAlternativeText;
+ VclPtr<VclMultiLineEdit> m_pEdtDescription;
public:
@@ -45,6 +45,8 @@ public:
const OUString& rURL, const OUString& rAlternativeText, const OUString& rDescription,
const OUString& rTarget, const OUString& rName,
TargetList& rTargetList );
+ virtual ~URLDlg();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetURL() const { return m_pEdtURL->GetText(); }
OUString GetAltText() const { return m_pEdtAlternativeText->GetText(); }
diff --git a/cui/source/inc/cuioptgenrl.hxx b/cui/source/inc/cuioptgenrl.hxx
index e6906f1c3244..8e911729fe5f 100644
--- a/cui/source/inc/cuioptgenrl.hxx
+++ b/cui/source/inc/cuioptgenrl.hxx
@@ -40,7 +40,7 @@ class SvxGeneralTabPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
// the "Use data for document properties" checkbox
- CheckBox* m_pUseDataCB;
+ VclPtr<CheckBox> m_pUseDataCB;
// rows
struct Row;
std::vector<boost::shared_ptr<Row> > vRows;
@@ -64,9 +64,10 @@ protected:
public:
SvxGeneralTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxGeneralTabPage ();
+ virtual ~SvxGeneralTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<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/cui/source/inc/cuisrchdlg.hxx b/cui/source/inc/cuisrchdlg.hxx
index 3dc19f0a1c97..be75242a8238 100644
--- a/cui/source/inc/cuisrchdlg.hxx
+++ b/cui/source/inc/cuisrchdlg.hxx
@@ -36,8 +36,8 @@ class SvxJSearchOptionsPage;
class SvxJSearchOptionsDialog : public SfxSingleTabDialog
{
- sal_Int32 nInitialTlFlags;
- SvxJSearchOptionsPage *pPage;
+ sal_Int32 nInitialTlFlags;
+ VclPtr<SvxJSearchOptionsPage> pPage;
SvxJSearchOptionsDialog( const SvxJSearchOptionsDialog & ) SAL_DELETED_FUNCTION;
SvxJSearchOptionsDialog & operator == ( const SvxJSearchOptionsDialog & ) SAL_DELETED_FUNCTION;
@@ -45,6 +45,8 @@ class SvxJSearchOptionsDialog : public SfxSingleTabDialog
public:
SvxJSearchOptionsDialog(vcl::Window *pParent,
const SfxItemSet& rOptionsSet, sal_Int32 nInitialFlags);
+ virtual ~SvxJSearchOptionsDialog();
+ virtual void dispose() SAL_OVERRIDE;
// Window
virtual void Activate() SAL_OVERRIDE;
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 3fe91da9f651..baa67bc85d4c 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -76,7 +76,6 @@ protected:
public:
SvxAreaTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, bool bShadow );
- virtual ~SvxAreaTabDialog();
void SetNewColorList( XColorListRef pColTab )
{ mpNewColorList = pColTab; }
@@ -116,29 +115,29 @@ class SvxTransparenceTabPage : public SvxTabPage
sal_uInt16 nDlgType;
// main selection
- RadioButton* m_pRbtTransOff;
- RadioButton* m_pRbtTransLinear;
- RadioButton* m_pRbtTransGradient;
+ VclPtr<RadioButton> m_pRbtTransOff;
+ VclPtr<RadioButton> m_pRbtTransLinear;
+ VclPtr<RadioButton> m_pRbtTransGradient;
/// linear transparency
- MetricField* m_pMtrTransparent;
+ VclPtr<MetricField> m_pMtrTransparent;
// gradient transparency
- VclGrid* m_pGridGradient;
- ListBox* m_pLbTrgrGradientType;
- FixedText* m_pFtTrgrCenterX;
- MetricField* m_pMtrTrgrCenterX;
- FixedText* m_pFtTrgrCenterY;
- MetricField* m_pMtrTrgrCenterY;
- FixedText* m_pFtTrgrAngle;
- MetricField* m_pMtrTrgrAngle;
- MetricField* m_pMtrTrgrBorder;
- MetricField* m_pMtrTrgrStartValue;
- MetricField* m_pMtrTrgrEndValue;
+ VclPtr<VclGrid> m_pGridGradient;
+ VclPtr<ListBox> m_pLbTrgrGradientType;
+ VclPtr<FixedText> m_pFtTrgrCenterX;
+ VclPtr<MetricField> m_pMtrTrgrCenterX;
+ VclPtr<FixedText> m_pFtTrgrCenterY;
+ VclPtr<MetricField> m_pMtrTrgrCenterY;
+ VclPtr<FixedText> m_pFtTrgrAngle;
+ VclPtr<MetricField> m_pMtrTrgrAngle;
+ VclPtr<MetricField> m_pMtrTrgrBorder;
+ VclPtr<MetricField> m_pMtrTrgrStartValue;
+ VclPtr<MetricField> m_pMtrTrgrEndValue;
// preview
- SvxXRectPreview* m_pCtlBitmapPreview;
- SvxXRectPreview* m_pCtlXRectPreview;
+ VclPtr<SvxXRectPreview> m_pCtlBitmapPreview;
+ VclPtr<SvxXRectPreview> m_pCtlXRectPreview;
bool bBitmap;
XOutdevItemPool* pXPool;
@@ -161,8 +160,10 @@ class SvxTransparenceTabPage : public SvxTabPage
public:
SvxTransparenceTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs);
+ virtual ~SvxTransparenceTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window*, const SfxItemSet*);
+ static VclPtr<SfxTabPage> Create(vcl::Window*, const SfxItemSet*);
static const sal_uInt16* GetRanges() { return pTransparenceRanges; }
virtual bool FillItemSet(SfxItemSet*) SAL_OVERRIDE;
@@ -184,48 +185,48 @@ class SvxAreaTabPage : public SvxTabPage
using TabPage::DeactivatePage;
static const sal_uInt16 pAreaRanges[];
private:
- ListBox* m_pTypeLB;
-
- VclBox* m_pFillLB;
- ColorLB* m_pLbColor;
- GradientLB* m_pLbGradient;
- HatchingLB* m_pLbHatching;
- BitmapLB* m_pLbBitmap;
- SvxXRectPreview* m_pCtlBitmapPreview;
-
- TriStateBox* m_pTsbStepCount;
- VclFrame* m_pFlStepCount;
- NumericField* m_pNumFldStepCount;
-
- VclFrame* m_pFlHatchBckgrd;
- CheckBox* m_pCbxHatchBckgrd;
- ColorLB* m_pLbHatchBckgrdColor;
-
- VclBox* m_pBxBitmap;
-
- VclFrame* m_pFlSize;
- TriStateBox* m_pTsbOriginal;
- TriStateBox* m_pTsbScale;
- VclGrid* m_pGridX_Y;
- FixedText* m_pFtXSize;
- MetricField* m_pMtrFldXSize;
- FixedText* m_pFtYSize;
- MetricField* m_pMtrFldYSize;
-
- VclFrame* m_pFlPosition;
- SvxRectCtl* m_pCtlPosition;
- VclGrid* m_pGridOffset;
- MetricField* m_pMtrFldXOffset;
- MetricField* m_pMtrFldYOffset;
- VclBox* m_pBxTile;
- TriStateBox* m_pTsbTile;
- TriStateBox* m_pTsbStretch;
- VclFrame* m_pFlOffset;
- RadioButton* m_pRbtRow;
- RadioButton* m_pRbtColumn;
- MetricField* m_pMtrFldOffset;
-
- SvxXRectPreview* m_pCtlXRectPreview;
+ VclPtr<ListBox> m_pTypeLB;
+
+ VclPtr<VclBox> m_pFillLB;
+ VclPtr<ColorLB> m_pLbColor;
+ VclPtr<GradientLB> m_pLbGradient;
+ VclPtr<HatchingLB> m_pLbHatching;
+ VclPtr<BitmapLB> m_pLbBitmap;
+ VclPtr<SvxXRectPreview> m_pCtlBitmapPreview;
+
+ VclPtr<TriStateBox> m_pTsbStepCount;
+ VclPtr<VclFrame> m_pFlStepCount;
+ VclPtr<NumericField> m_pNumFldStepCount;
+
+ VclPtr<VclFrame> m_pFlHatchBckgrd;
+ VclPtr<CheckBox> m_pCbxHatchBckgrd;
+ VclPtr<ColorLB> m_pLbHatchBckgrdColor;
+
+ VclPtr<VclBox> m_pBxBitmap;
+
+ VclPtr<VclFrame> m_pFlSize;
+ VclPtr<TriStateBox> m_pTsbOriginal;
+ VclPtr<TriStateBox> m_pTsbScale;
+ VclPtr<VclGrid> m_pGridX_Y;
+ VclPtr<FixedText> m_pFtXSize;
+ VclPtr<MetricField> m_pMtrFldXSize;
+ VclPtr<FixedText> m_pFtYSize;
+ VclPtr<MetricField> m_pMtrFldYSize;
+
+ VclPtr<VclFrame> m_pFlPosition;
+ VclPtr<SvxRectCtl> m_pCtlPosition;
+ VclPtr<VclGrid> m_pGridOffset;
+ VclPtr<MetricField> m_pMtrFldXOffset;
+ VclPtr<MetricField> m_pMtrFldYOffset;
+ VclPtr<VclBox> m_pBxTile;
+ VclPtr<TriStateBox> m_pTsbTile;
+ VclPtr<TriStateBox> m_pTsbStretch;
+ VclPtr<VclFrame> m_pFlOffset;
+ VclPtr<RadioButton> m_pRbtRow;
+ VclPtr<RadioButton> m_pRbtColumn;
+ VclPtr<MetricField> m_pMtrFldOffset;
+
+ VclPtr<SvxXRectPreview> m_pCtlXRectPreview;
const SfxItemSet& rOutAttrs;
RECT_POINT eRP;
@@ -265,7 +266,7 @@ private:
bool mbDirectGraphicSet;
Graphic maDirectGraphic;
OUString maDirectName;
- PushButton* m_pBtnImport;
+ VclPtr<PushButton> m_pBtnImport;
DECL_LINK(SelectDialogTypeHdl_Impl, void *);
DECL_LINK( ModifyColorHdl_Impl, void * );
@@ -289,10 +290,12 @@ private:
public:
SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxAreaTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pAreaRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -327,13 +330,13 @@ class SvxShadowTabPage : public SvxTabPage
static const sal_uInt16 pShadowRanges[];
private:
- TriStateBox* m_pTsbShowShadow;
- VclGrid* m_pGridShadow;
- SvxRectCtl* m_pCtlPosition;
- MetricField* m_pMtrDistance;
- ColorLB* m_pLbShadowColor;
- MetricField* m_pMtrTransparent;
- SvxXShadowPreview* m_pCtlXRectPreview;
+ VclPtr<TriStateBox> m_pTsbShowShadow;
+ VclPtr<VclGrid> m_pGridShadow;
+ VclPtr<SvxRectCtl> m_pCtlPosition;
+ VclPtr<MetricField> m_pMtrDistance;
+ VclPtr<ColorLB> m_pLbShadowColor;
+ VclPtr<MetricField> m_pMtrTransparent;
+ VclPtr<SvxXShadowPreview> m_pCtlXRectPreview;
const SfxItemSet& rOutAttrs;
RECT_POINT eRP;
@@ -356,9 +359,11 @@ private:
public:
SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxShadowTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pShadowRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -384,25 +389,25 @@ class SvxGradientTabPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
- ListBox* m_pLbGradientType;
- FixedText* m_pFtCenterX;
- MetricField* m_pMtrCenterX;
- FixedText* m_pFtCenterY;
- MetricField* m_pMtrCenterY;
- FixedText* m_pFtAngle;
- MetricField* m_pMtrAngle;
- MetricField* m_pMtrBorder;
- ColorLB* m_pLbColorFrom;
- MetricField* m_pMtrColorFrom;
- ColorLB* m_pLbColorTo;
- MetricField* m_pMtrColorTo;
- GradientLB* m_pLbGradients;
- SvxXRectPreview* m_pCtlPreview;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnModify;
- PushButton* m_pBtnDelete;
- PushButton* m_pBtnLoad;
- PushButton* m_pBtnSave;
+ VclPtr<ListBox> m_pLbGradientType;
+ VclPtr<FixedText> m_pFtCenterX;
+ VclPtr<MetricField> m_pMtrCenterX;
+ VclPtr<FixedText> m_pFtCenterY;
+ VclPtr<MetricField> m_pMtrCenterY;
+ VclPtr<FixedText> m_pFtAngle;
+ VclPtr<MetricField> m_pMtrAngle;
+ VclPtr<MetricField> m_pMtrBorder;
+ VclPtr<ColorLB> m_pLbColorFrom;
+ VclPtr<MetricField> m_pMtrColorFrom;
+ VclPtr<ColorLB> m_pLbColorTo;
+ VclPtr<MetricField> m_pMtrColorTo;
+ VclPtr<GradientLB> m_pLbGradients;
+ VclPtr<SvxXRectPreview> m_pCtlPreview;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnModify;
+ VclPtr<PushButton> m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnLoad;
+ VclPtr<PushButton> m_pBtnSave;
const SfxItemSet& rOutAttrs;
@@ -435,10 +440,12 @@ private:
public:
SvxGradientTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxGradientTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
@@ -466,18 +473,18 @@ class SvxHatchTabPage : public SvxTabPage
using TabPage::DeactivatePage;
private:
- MetricField* m_pMtrDistance;
- MetricField* m_pMtrAngle;
- SvxRectCtl* m_pCtlAngle;
- ListBox* m_pLbLineType;
- ColorLB* m_pLbLineColor;
- HatchingLB* m_pLbHatchings;
- SvxXRectPreview* m_pCtlPreview;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnModify;
- PushButton* m_pBtnDelete;
- PushButton* m_pBtnLoad;
- PushButton* m_pBtnSave;
+ VclPtr<MetricField> m_pMtrDistance;
+ VclPtr<MetricField> m_pMtrAngle;
+ VclPtr<SvxRectCtl> m_pCtlAngle;
+ VclPtr<ListBox> m_pLbLineType;
+ VclPtr<ColorLB> m_pLbLineColor;
+ VclPtr<HatchingLB> m_pLbHatchings;
+ VclPtr<SvxXRectPreview> m_pCtlPreview;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnModify;
+ VclPtr<PushButton> m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnLoad;
+ VclPtr<PushButton> m_pBtnSave;
const SfxItemSet& rOutAttrs;
@@ -511,10 +518,12 @@ private:
public:
SvxHatchTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxHatchTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
@@ -546,19 +555,19 @@ class SvxBitmapTabPage : public SvxTabPage
using TabPage::DeactivatePage;
private:
- VclBox* m_pBxPixelEditor;
- SvxPixelCtl* m_pCtlPixel;
- ColorLB* m_pLbColor;
- ColorLB* m_pLbBackgroundColor;
- FixedText* m_pLbBitmapsHidden;
- BitmapLB* m_pLbBitmaps;
- SvxXRectPreview* m_pCtlPreview;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnModify;
- PushButton* m_pBtnImport;
- PushButton* m_pBtnDelete;
- PushButton* m_pBtnLoad;
- PushButton* m_pBtnSave;
+ VclPtr<VclBox> m_pBxPixelEditor;
+ VclPtr<SvxPixelCtl> m_pCtlPixel;
+ VclPtr<ColorLB> m_pLbColor;
+ VclPtr<ColorLB> m_pLbBackgroundColor;
+ VclPtr<FixedText> m_pLbBitmapsHidden;
+ VclPtr<BitmapLB> m_pLbBitmaps;
+ VclPtr<SvxXRectPreview> m_pCtlPreview;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnModify;
+ VclPtr<PushButton> m_pBtnImport;
+ VclPtr<PushButton> m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnLoad;
+ VclPtr<PushButton> m_pBtnSave;
SvxBitmapCtl* m_pBitmapCtl;
@@ -597,10 +606,11 @@ private:
public:
SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxBitmapTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
@@ -642,11 +652,11 @@ class SvxColorTabPage : public SfxTabPage
private:
XPropertyListType meType;
- Window *mpTopDlg;
- CheckBox *m_pBoxEmbed;
- PushButton *m_pBtnLoad;
- PushButton *m_pBtnSave;
- FixedText *m_pTableName;
+ VclPtr<Window> mpTopDlg;
+ VclPtr<CheckBox> m_pBoxEmbed;
+ VclPtr<PushButton> m_pBtnLoad;
+ VclPtr<PushButton> m_pBtnSave;
+ VclPtr<FixedText> m_pTableName;
DECL_LINK( EmbedToggleHdl_Impl, void * );
DECL_LINK( ClickLoadHdl_Impl, void * );
@@ -660,31 +670,31 @@ private:
void EnableSave( bool bCanSave );
SvxColorTabPageShadow *pShadow;
- Edit* m_pEdtName;
- ColorLB* m_pLbColor;
+ VclPtr<Edit> m_pEdtName;
+ VclPtr<ColorLB> m_pLbColor;
- SvxColorValueSet* m_pValSetColorList;
+ VclPtr<SvxColorValueSet> m_pValSetColorList;
- SvxXRectPreview* m_pCtlPreviewOld;
- SvxXRectPreview* m_pCtlPreviewNew;
+ VclPtr<SvxXRectPreview> m_pCtlPreviewOld;
+ VclPtr<SvxXRectPreview> m_pCtlPreviewNew;
- ListBox* m_pLbColorModel;
+ VclPtr<ListBox> m_pLbColorModel;
- VclContainer* m_pRGB;
- NumericField* m_pR;
- NumericField* m_pG;
- NumericField* m_pB;
+ VclPtr<VclContainer> m_pRGB;
+ VclPtr<NumericField> m_pR;
+ VclPtr<NumericField> m_pG;
+ VclPtr<NumericField> m_pB;
- VclContainer* m_pCMYK;
- MetricField* m_pC;
- MetricField* m_pY;
- MetricField* m_pM;
- MetricField* m_pK;
+ VclPtr<VclContainer> m_pCMYK;
+ VclPtr<MetricField> m_pC;
+ VclPtr<MetricField> m_pY;
+ VclPtr<MetricField> m_pM;
+ VclPtr<MetricField> m_pK;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnModify;
- PushButton* m_pBtnWorkOn;
- PushButton* m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnModify;
+ VclPtr<PushButton> m_pBtnWorkOn;
+ VclPtr<PushButton> m_pBtnDelete;
const SfxItemSet& rOutAttrs;
@@ -731,10 +741,11 @@ private:
public:
SvxColorTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxColorTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index 31550706538a..3bb1f2b414ea 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -64,7 +64,6 @@ public:
SvxLineTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
SdrModel* pModel, const SdrObject* pObj = NULL,
bool bHasObj = true );
- virtual ~SvxLineTabDialog();
void SetNewDashList( XDashListRef pInLst)
{ pNewDashList = pInLst; }
@@ -92,34 +91,34 @@ class SvxLineTabPage : public SvxTabPage
using TabPage::DeactivatePage;
static const sal_uInt16 pLineRanges[];
private:
- VclBox* m_pBoxColor;
- LineLB* m_pLbLineStyle;
- ColorLB* m_pLbColor;
- VclBox* m_pBoxWidth;
- MetricField* m_pMtrLineWidth;
- VclBox* m_pBoxTransparency;
- MetricField* m_pMtrTransparent;
-
- VclFrame* m_pFlLineEnds;
- VclBox* m_pBoxArrowStyles;
- LineEndLB* m_pLbStartStyle;
- VclBox* m_pBoxStart;
- MetricField* m_pMtrStartWidth;
- TriStateBox* m_pTsbCenterStart;
- VclBox* m_pBoxEnd;
- LineEndLB* m_pLbEndStyle;
- MetricField* m_pMtrEndWidth;
- TriStateBox* m_pTsbCenterEnd;
- CheckBox* m_pCbxSynchronize;
- SvxXLinePreview* m_pCtlPreview;
+ VclPtr<VclBox> m_pBoxColor;
+ VclPtr<LineLB> m_pLbLineStyle;
+ VclPtr<ColorLB> m_pLbColor;
+ VclPtr<VclBox> m_pBoxWidth;
+ VclPtr<MetricField> m_pMtrLineWidth;
+ VclPtr<VclBox> m_pBoxTransparency;
+ VclPtr<MetricField> m_pMtrTransparent;
+
+ VclPtr<VclFrame> m_pFlLineEnds;
+ VclPtr<VclBox> m_pBoxArrowStyles;
+ VclPtr<LineEndLB> m_pLbStartStyle;
+ VclPtr<VclBox> m_pBoxStart;
+ VclPtr<MetricField> m_pMtrStartWidth;
+ VclPtr<TriStateBox> m_pTsbCenterStart;
+ VclPtr<VclBox> m_pBoxEnd;
+ VclPtr<LineEndLB> m_pLbEndStyle;
+ VclPtr<MetricField> m_pMtrEndWidth;
+ VclPtr<TriStateBox> m_pTsbCenterEnd;
+ VclPtr<CheckBox> m_pCbxSynchronize;
+ VclPtr<SvxXLinePreview> m_pCtlPreview;
// #116827#
- VclFrame* m_pFLEdgeStyle;
- VclGrid* m_pGridEdgeCaps;
- ListBox* m_pLBEdgeStyle;
+ VclPtr<VclFrame> m_pFLEdgeStyle;
+ VclPtr<VclGrid> m_pGridEdgeCaps;
+ VclPtr<ListBox> m_pLBEdgeStyle;
// LineCaps
- ListBox* m_pLBCapStyle;
+ VclPtr<ListBox> m_pLBCapStyle;
//#58425# symbols on a line (e. g. StarChart) ->
/** a list of symbols to be shown in menu. Symbol at position SID_ATTR_SYMBOLTYPE is to be shown in preview.
@@ -132,12 +131,12 @@ private:
long nSymbolType;
/// attributes for the shown symbols; only necessary if not equal to line properties
SfxItemSet* pSymbolAttr;
- VclFrame* m_pFlSymbol;
- VclGrid* m_pGridIconSize;
- MenuButton* m_pSymbolMB;
- MetricField* m_pSymbolWidthMF;
- MetricField* m_pSymbolHeightMF;
- CheckBox* m_pSymbolRatioCB;
+ VclPtr<VclFrame> m_pFlSymbol;
+ VclPtr<VclGrid> m_pGridIconSize;
+ VclPtr<MenuButton> m_pSymbolMB;
+ VclPtr<MetricField> m_pSymbolWidthMF;
+ VclPtr<MetricField> m_pSymbolHeightMF;
+ VclPtr<CheckBox> m_pSymbolRatioCB;
std::vector<OUString> aGrfNames;
SvxBmpItemInfoList aGrfBrushItems;
bool bLastWidthModified;
@@ -205,10 +204,11 @@ public:
SvxLineTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxLineTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pLineRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -246,21 +246,21 @@ class SvxLineDefTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
private:
- LineLB* m_pLbLineStyles;
- ListBox* m_pLbType1;
- ListBox* m_pLbType2;
- NumericField* m_pNumFldNumber1;
- NumericField* m_pNumFldNumber2;
- MetricField* m_pMtrLength1;
- MetricField* m_pMtrLength2;
- MetricField* m_pMtrDistance;
- CheckBox* m_pCbxSynchronize;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnModify;
- PushButton* m_pBtnDelete;
- PushButton* m_pBtnLoad;
- PushButton* m_pBtnSave;
- SvxXLinePreview* m_pCtlPreview;
+ VclPtr<LineLB> m_pLbLineStyles;
+ VclPtr<ListBox> m_pLbType1;
+ VclPtr<ListBox> m_pLbType2;
+ VclPtr<NumericField> m_pNumFldNumber1;
+ VclPtr<NumericField> m_pNumFldNumber2;
+ VclPtr<MetricField> m_pMtrLength1;
+ VclPtr<MetricField> m_pMtrLength2;
+ VclPtr<MetricField> m_pMtrDistance;
+ VclPtr<CheckBox> m_pCbxSynchronize;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnModify;
+ VclPtr<PushButton> m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnLoad;
+ VclPtr<PushButton> m_pBtnSave;
+ VclPtr<SvxXLinePreview> m_pCtlPreview;
const SfxItemSet& rOutAttrs;
XDash aDash;
@@ -303,10 +303,12 @@ private:
public:
SvxLineDefTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxLineDefTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
@@ -333,14 +335,14 @@ class SvxLineEndDefTabPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
- Edit* m_pEdtName;
- LineEndLB* m_pLbLineEnds;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnModify;
- PushButton* m_pBtnDelete;
- PushButton* m_pBtnLoad;
- PushButton* m_pBtnSave;
- SvxXLinePreview* m_pCtlPreview;
+ VclPtr<Edit> m_pEdtName;
+ VclPtr<LineEndLB> m_pLbLineEnds;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnModify;
+ VclPtr<PushButton> m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnLoad;
+ VclPtr<PushButton> m_pBtnSave;
+ VclPtr<SvxXLinePreview> m_pCtlPreview;
const SfxItemSet& rOutAttrs;
const SdrObject* pPolyObj;
@@ -373,10 +375,11 @@ private:
public:
SvxLineEndDefTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxLineEndDefTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
diff --git a/cui/source/inc/cuitbxform.hxx b/cui/source/inc/cuitbxform.hxx
index 1f2b34d616db..4ee17070a5f5 100644
--- a/cui/source/inc/cuitbxform.hxx
+++ b/cui/source/inc/cuitbxform.hxx
@@ -29,10 +29,12 @@
class FmInputRecordNoDialog : public ModalDialog
{
public:
- NumericField* m_pRecordNo;
+ VclPtr<NumericField> m_pRecordNo;
public:
FmInputRecordNoDialog(vcl::Window * pParent);
+ virtual ~FmInputRecordNoDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetValue(long dNew) { m_pRecordNo->SetValue(dNew); }
long GetValue() const { return static_cast<long>(m_pRecordNo->GetValue()); }
diff --git a/cui/source/inc/dbregister.hxx b/cui/source/inc/dbregister.hxx
index f35f2adb57c8..cf0142120532 100644
--- a/cui/source/inc/dbregister.hxx
+++ b/cui/source/inc/dbregister.hxx
@@ -46,12 +46,12 @@ namespace svx
OUString aTypeText;
OUString aPathText;
- SvSimpleTableContainer* m_pPathCtrl;
- PushButton* m_pNew;
- PushButton* m_pEdit;
- PushButton* m_pDelete;
+ VclPtr<SvSimpleTableContainer> m_pPathCtrl;
+ VclPtr<PushButton> m_pNew;
+ VclPtr<PushButton> m_pEdit;
+ VclPtr<PushButton> m_pDelete;
- ::svx::OptHeaderTabListBox* pPathBox;
+ VclPtr<::svx::OptHeaderTabListBox> pPathBox;
SvTreeListEntry* m_pCurEntry;
sal_uLong m_nOldCount;
bool m_bModified;
@@ -91,8 +91,9 @@ namespace svx
public:
DbRegistrationOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~DbRegistrationOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -129,7 +130,6 @@ namespace svx
{
public:
DatabaseRegistrationDialog( vcl::Window* pParent, const SfxItemSet& rAttr );
- virtual ~DatabaseRegistrationDialog();
virtual short Execute() SAL_OVERRIDE;
};
diff --git a/cui/source/inc/dlgname.hxx b/cui/source/inc/dlgname.hxx
index e6d9ea26c9fd..8615477f6618 100644
--- a/cui/source/inc/dlgname.hxx
+++ b/cui/source/inc/dlgname.hxx
@@ -30,9 +30,9 @@
class SvxNameDialog : public ModalDialog
{
private:
- FixedText* pFtDescription;
- Edit* pEdtName;
- OKButton* pBtnOK;
+ VclPtr<FixedText> pFtDescription;
+ VclPtr<Edit> pEdtName;
+ VclPtr<OKButton> pBtnOK;
Link aCheckNameHdl;
@@ -40,6 +40,8 @@ private:
public:
SvxNameDialog( vcl::Window* pWindow, const OUString& rName, const OUString& rDesc );
+ virtual ~SvxNameDialog();
+ virtual void dispose() SAL_OVERRIDE;
void GetName( OUString& rName ){rName = pEdtName->GetText();}
@@ -75,10 +77,10 @@ class SvxObjectNameDialog : public ModalDialog
{
private:
// name
- Edit* pEdtName;
+ VclPtr<Edit> pEdtName;
// buttons
- OKButton* pBtnOK;
+ VclPtr<OKButton> pBtnOK;
// callback link for name uniqueness
Link aCheckNameHdl;
@@ -88,6 +90,8 @@ private:
public:
// constructor
SvxObjectNameDialog(vcl::Window* pWindow, const OUString& rName);
+ virtual ~SvxObjectNameDialog();
+ virtual void dispose() SAL_OVERRIDE;
// data access
void GetName(OUString& rName) {rName = pEdtName->GetText(); }
@@ -110,15 +114,16 @@ class SvxObjectTitleDescDialog : public ModalDialog
{
private:
// title
- Edit* pEdtTitle;
+ VclPtr<Edit> pEdtTitle;
// description
- VclMultiLineEdit* pEdtDescription;
+ VclPtr<VclMultiLineEdit> pEdtDescription;
public:
// constructor
SvxObjectTitleDescDialog(vcl::Window* pWindow, const OUString& rTitle, const OUString& rDesc);
-
+ virtual ~SvxObjectTitleDescDialog();
+ virtual void dispose() SAL_OVERRIDE;
// data access
void GetTitle(OUString& rTitle) {rTitle = pEdtTitle->GetText(); }
void GetDescription(OUString& rDescription) {rDescription = pEdtDescription->GetText(); }
@@ -128,10 +133,10 @@ public:
class SvxMessDialog : public ModalDialog
{
private:
- FixedText* pFtDescription;
- PushButton* pBtn1;
- PushButton* pBtn2;
- FixedImage* pFtImage;
+ VclPtr<FixedText> pFtDescription;
+ VclPtr<PushButton> pBtn1;
+ VclPtr<PushButton> pBtn2;
+ VclPtr<FixedImage> pFtImage;
Image* pImage;
DECL_LINK(Button1Hdl, void *);
@@ -140,6 +145,7 @@ private:
public:
SvxMessDialog( vcl::Window* pWindow, const OUString& rText, const OUString& rDesc, Image* pImg = NULL );
virtual ~SvxMessDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetButtonText( sal_uInt16 nBtnId, const OUString& rNewTxt );
};
diff --git a/cui/source/inc/dstribut.hxx b/cui/source/inc/dstribut.hxx
index e0be5f3dd87e..46e18129968f 100644
--- a/cui/source/inc/dstribut.hxx
+++ b/cui/source/inc/dstribut.hxx
@@ -29,23 +29,25 @@ class SvxDistributePage : public SvxTabPage
SvxDistributeHorizontal m_eDistributeHor;
SvxDistributeVertical m_eDistributeVer;
- RadioButton* m_pBtnHorNone;
- RadioButton* m_pBtnHorLeft;
- RadioButton* m_pBtnHorCenter;
- RadioButton* m_pBtnHorDistance;
- RadioButton* m_pBtnHorRight;
- RadioButton* m_pBtnVerNone;
- RadioButton* m_pBtnVerTop;
- RadioButton* m_pBtnVerCenter;
- RadioButton* m_pBtnVerDistance;
- RadioButton* m_pBtnVerBottom;
+ VclPtr<RadioButton> m_pBtnHorNone;
+ VclPtr<RadioButton> m_pBtnHorLeft;
+ VclPtr<RadioButton> m_pBtnHorCenter;
+ VclPtr<RadioButton> m_pBtnHorDistance;
+ VclPtr<RadioButton> m_pBtnHorRight;
+ VclPtr<RadioButton> m_pBtnVerNone;
+ VclPtr<RadioButton> m_pBtnVerTop;
+ VclPtr<RadioButton> m_pBtnVerCenter;
+ VclPtr<RadioButton> m_pBtnVerDistance;
+ VclPtr<RadioButton> m_pBtnVerBottom;
public:
SvxDistributePage(vcl::Window* pWindow, const SfxItemSet& rInAttrs,
SvxDistributeHorizontal eHor = SvxDistributeHorizontalNone,
SvxDistributeVertical eVer = SvxDistributeVerticalNone);
+ virtual ~SvxDistributePage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window*, const SfxItemSet&,
+ static VclPtr<SfxTabPage> Create(vcl::Window*, const SfxItemSet&,
SvxDistributeHorizontal eHor, SvxDistributeVertical eVer);
virtual bool FillItemSet(SfxItemSet*) SAL_OVERRIDE;
virtual void Reset(const SfxItemSet*) SAL_OVERRIDE;
@@ -57,12 +59,14 @@ public:
class SvxDistributeDialog : public SfxSingleTabDialog
{
- SvxDistributePage* mpPage;
+ VclPtr<SvxDistributePage> mpPage;
public:
SvxDistributeDialog(vcl::Window* pParent, const SfxItemSet& rAttr,
SvxDistributeHorizontal eHor = SvxDistributeHorizontalNone,
SvxDistributeVertical eVer = SvxDistributeVerticalNone);
+ virtual ~SvxDistributeDialog();
+ virtual void dispose() SAL_OVERRIDE;
SvxDistributeHorizontal GetDistributeHor() const { return mpPage->GetDistributeHor(); }
SvxDistributeVertical GetDistributeVer() const { return mpPage->GetDistributeVer(); }
diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx
index 18769aee67b2..4ce44f8ec257 100644
--- a/cui/source/inc/grfpage.hxx
+++ b/cui/source/inc/grfpage.hxx
@@ -56,28 +56,28 @@ class SvxGrfCropPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- VclContainer* m_pCropFrame;
- RadioButton* m_pZoomConstRB;
- RadioButton* m_pSizeConstRB;
- MetricField* m_pLeftMF;
- MetricField* m_pRightMF;
- MetricField* m_pTopMF;
- MetricField* m_pBottomMF;
-
- VclContainer* m_pScaleFrame;
- MetricField* m_pWidthZoomMF;
- MetricField* m_pHeightZoomMF;
-
- VclContainer* m_pSizeFrame;
- MetricField* m_pWidthMF;
- MetricField* m_pHeightMF;
-
- VclContainer* m_pOrigSizeGrid;
- FixedText* m_pOrigSizeFT;
- PushButton* m_pOrigSizePB;
+ VclPtr<VclContainer> m_pCropFrame;
+ VclPtr<RadioButton> m_pZoomConstRB;
+ VclPtr<RadioButton> m_pSizeConstRB;
+ VclPtr<MetricField> m_pLeftMF;
+ VclPtr<MetricField> m_pRightMF;
+ VclPtr<MetricField> m_pTopMF;
+ VclPtr<MetricField> m_pBottomMF;
+
+ VclPtr<VclContainer> m_pScaleFrame;
+ VclPtr<MetricField> m_pWidthZoomMF;
+ VclPtr<MetricField> m_pHeightZoomMF;
+
+ VclPtr<VclContainer> m_pSizeFrame;
+ VclPtr<MetricField> m_pWidthMF;
+ VclPtr<MetricField> m_pHeightMF;
+
+ VclPtr<VclContainer> m_pOrigSizeGrid;
+ VclPtr<FixedText> m_pOrigSizeFT;
+ VclPtr<PushButton> m_pOrigSizePB;
// Example
- SvxCropExample* m_pExampleWN;
+ VclPtr<SvxCropExample> m_pExampleWN;
Timer aTimer;
@@ -85,7 +85,7 @@ class SvxGrfCropPage : public SfxTabPage
Size aOrigSize;
Size aOrigPixelSize;
Size aPageSize;
- const MetricField* pLastCropField;
+ VclPtr<MetricField> pLastCropField;
long nOldWidth;
long nOldHeight;
bool bReset;
@@ -95,6 +95,7 @@ class SvxGrfCropPage : public SfxTabPage
SvxGrfCropPage( vcl::Window *pParent, const SfxItemSet &rSet );
virtual ~SvxGrfCropPage();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( ZoomHdl, MetricField * );
DECL_LINK( SizeHdl, MetricField * );
@@ -111,7 +112,7 @@ class SvxGrfCropPage : public SfxTabPage
Size GetGrfOrigSize( const Graphic& ) const;
public:
- static SfxTabPage *Create( vcl::Window *pParent, const SfxItemSet *rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window *pParent, const SfxItemSet *rSet );
virtual bool FillItemSet( SfxItemSet *rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet *rSet ) SAL_OVERRIDE;
diff --git a/cui/source/inc/hangulhanjadlg.hxx b/cui/source/inc/hangulhanjadlg.hxx
index cb228daebc1e..2aa203c85319 100644
--- a/cui/source/inc/hangulhanjadlg.hxx
+++ b/cui/source/inc/hangulhanjadlg.hxx
@@ -43,6 +43,7 @@ namespace svx
public:
SuggestionSet( vcl::Window* pParent );
virtual ~SuggestionSet();
+ virtual void dispose() SAL_OVERRIDE;
virtual void UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE;
void ClearSet();
@@ -53,6 +54,7 @@ namespace svx
public:
SuggestionDisplay( vcl::Window* pParent, WinBits nBits );
virtual ~SuggestionDisplay();
+ virtual void dispose() SAL_OVERRIDE;
void DisplayListBox( bool bDisplayListBox );
@@ -87,8 +89,8 @@ namespace svx
private:
bool m_bDisplayListBox;//otherwise ValueSet
- SuggestionSet m_aValueSet;
- ListBox m_aListBox;
+ VclPtr<SuggestionSet> m_aValueSet;
+ VclPtr<ListBox> m_aListBox;
Link m_aSelectLink;
bool m_bInSelectionUpdate;
@@ -102,27 +104,27 @@ namespace svx
{
private:
- PushButton* m_pFind;
- PushButton* m_pIgnore;
- PushButton* m_pIgnoreAll;
- PushButton* m_pReplace;
- PushButton* m_pReplaceAll;
- PushButton* m_pOptions;
- SuggestionDisplay* m_pSuggestions;
- RadioButton* m_pSimpleConversion;
- RadioButton* m_pHangulBracketed;
- RadioButton* m_pHanjaBracketed;
- Edit* m_pWordInput;
- FixedText* m_pOriginalWord;
- RubyRadioButton* m_pHanjaAbove;
- RubyRadioButton* m_pHanjaBelow;
- RubyRadioButton* m_pHangulAbove;
- RubyRadioButton* m_pHangulBelow;
- CheckBox* m_pHangulOnly;
- CheckBox* m_pHanjaOnly;
- CheckBox* m_pReplaceByChar;
-
- CheckBox* m_pIgnoreNonPrimary;
+ VclPtr<PushButton> m_pFind;
+ VclPtr<PushButton> m_pIgnore;
+ VclPtr<PushButton> m_pIgnoreAll;
+ VclPtr<PushButton> m_pReplace;
+ VclPtr<PushButton> m_pReplaceAll;
+ VclPtr<PushButton> m_pOptions;
+ VclPtr<SuggestionDisplay> m_pSuggestions;
+ VclPtr<RadioButton> m_pSimpleConversion;
+ VclPtr<RadioButton> m_pHangulBracketed;
+ VclPtr<RadioButton> m_pHanjaBracketed;
+ VclPtr<Edit> m_pWordInput;
+ VclPtr<FixedText> m_pOriginalWord;
+ VclPtr<RubyRadioButton> m_pHanjaAbove;
+ VclPtr<RubyRadioButton> m_pHanjaBelow;
+ VclPtr<RubyRadioButton> m_pHangulAbove;
+ VclPtr<RubyRadioButton> m_pHangulBelow;
+ VclPtr<CheckBox> m_pHangulOnly;
+ VclPtr<CheckBox> m_pHanjaOnly;
+ VclPtr<CheckBox> m_pReplaceByChar;
+
+ VclPtr<CheckBox> m_pIgnoreNonPrimary;
/** are we working for a document? This is normally true, but in case
the user uses the "find" functionality, we switch to working
with what the user entered, which then does not have any relation to
@@ -136,7 +138,8 @@ namespace svx
HangulHanjaConversionDialog(
vcl::Window* _pParent,
editeng::HangulHanjaConversion::ConversionDirection _ePrimaryDirection );
- virtual ~HangulHanjaConversionDialog( );
+ virtual ~HangulHanjaConversionDialog();
+ virtual void dispose() SAL_OVERRIDE;
public:
void SetOptionsChangedHdl( const Link& _rHdl );
@@ -195,14 +198,14 @@ namespace svx
class HangulHanjaOptionsDialog : public ModalDialog
{
private:
- SvxCheckListBox* m_pDictsLB;
- CheckBox* m_pIgnorepostCB;
- CheckBox* m_pShowrecentlyfirstCB;
- CheckBox* m_pAutoreplaceuniqueCB;
- PushButton* m_pNewPB;
- PushButton* m_pEditPB;
- PushButton* m_pDeletePB;
- OKButton* m_pOkPB;
+ VclPtr<SvxCheckListBox> m_pDictsLB;
+ VclPtr<CheckBox> m_pIgnorepostCB;
+ VclPtr<CheckBox> m_pShowrecentlyfirstCB;
+ VclPtr<CheckBox> m_pAutoreplaceuniqueCB;
+ VclPtr<PushButton> m_pNewPB;
+ VclPtr<PushButton> m_pEditPB;
+ VclPtr<PushButton> m_pDeletePB;
+ VclPtr<OKButton> m_pOkPB;
SvLBoxButtonData* m_pCheckButtonData;
@@ -222,6 +225,7 @@ namespace svx
public:
HangulHanjaOptionsDialog( vcl::Window* _pParent );
virtual ~HangulHanjaOptionsDialog();
+ virtual void dispose() SAL_OVERRIDE;
void AddDict( const OUString& _rName, bool _bChecked );
};
@@ -230,8 +234,8 @@ namespace svx
class HangulHanjaNewDictDialog : public ModalDialog
{
private:
- Edit* m_pDictNameED;
- OKButton* m_pOkBtn;
+ VclPtr<Edit> m_pDictNameED;
+ VclPtr<OKButton> m_pOkBtn;
bool m_bEntered;
@@ -239,6 +243,8 @@ namespace svx
DECL_LINK( ModifyHdl, void* );
public:
HangulHanjaNewDictDialog( vcl::Window* _pParent );
+ virtual ~HangulHanjaNewDictDialog();
+ virtual void dispose() SAL_OVERRIDE;
bool GetName( OUString& _rRetName ) const;
};
@@ -249,15 +255,16 @@ namespace svx
class SuggestionEdit : public Edit
{
private:
- SuggestionEdit* m_pPrev;
- SuggestionEdit* m_pNext;
- ScrollBar* m_pScrollBar;
+ VclPtr<SuggestionEdit> m_pPrev;
+ VclPtr<SuggestionEdit> m_pNext;
+ VclPtr<ScrollBar> m_pScrollBar;
bool ShouldScroll( bool _bUp ) const;
void DoJump( bool _bUp );
public:
SuggestionEdit( vcl::Window* pParent, WinBits nBits );
virtual ~SuggestionEdit();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
void init( ScrollBar* pScrollBar, SuggestionEdit* pPrev, SuggestionEdit* pNext);
};
@@ -273,15 +280,15 @@ namespace svx
OUString m_aOriginal;
SuggestionList* m_pSuggestions;
- ListBox* m_aBookLB;
- ComboBox* m_aOriginalLB;
- SuggestionEdit* m_aEdit1;
- SuggestionEdit* m_aEdit2;
- SuggestionEdit* m_aEdit3;
- SuggestionEdit* m_aEdit4;
- ScrollBar* m_aScrollSB;
- PushButton* m_aNewPB;
- PushButton* m_aDeletePB;
+ VclPtr<ListBox> m_aBookLB;
+ VclPtr<ComboBox> m_aOriginalLB;
+ VclPtr<SuggestionEdit> m_aEdit1;
+ VclPtr<SuggestionEdit> m_aEdit2;
+ VclPtr<SuggestionEdit> m_aEdit3;
+ VclPtr<SuggestionEdit> m_aEdit4;
+ VclPtr<ScrollBar> m_aScrollSB;
+ VclPtr<PushButton> m_aNewPB;
+ VclPtr<PushButton> m_aDeletePB;
sal_uInt16 m_nTopPos;
bool m_bModifiedSuggestions;
@@ -312,6 +319,7 @@ namespace svx
public:
HangulHanjaEditDictDialog( vcl::Window* _pParent, HHDictList& _rDictList, sal_uInt32 _nSelDict );
virtual ~HangulHanjaEditDictDialog();
+ virtual void dispose() SAL_OVERRIDE;
void UpdateScrollbar();
};
diff --git a/cui/source/inc/headertablistbox.hxx b/cui/source/inc/headertablistbox.hxx
index d368d4dc27c9..f63eba3c73c1 100644
--- a/cui/source/inc/headertablistbox.hxx
+++ b/cui/source/inc/headertablistbox.hxx
@@ -27,25 +27,27 @@
class MacroEventListBox : public Control
{
private:
- HeaderBar maHeaderBar;
- SvHeaderTabListBox maListBox;
+ VclPtr<HeaderBar> maHeaderBar;
+ VclPtr<SvHeaderTabListBox> maListBox;
protected:
DECL_LINK( HeaderEndDrag_Impl, HeaderBar* );
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
public:
MacroEventListBox( vcl::Window* pParent, WinBits nStyle );
+ virtual ~MacroEventListBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;
SvHeaderTabListBox& GetListBox()
{
- return maListBox;
+ return *maListBox.get();
}
HeaderBar& GetHeaderBar()
{
- return maHeaderBar;
+ return *maHeaderBar.get();
}
void ConnectElements();/**< should be called after all manipulations on elements are done
diff --git a/cui/source/inc/hldocntp.hxx b/cui/source/inc/hldocntp.hxx
index 98731d7e6172..e72b13387e0e 100644
--- a/cui/source/inc/hldocntp.hxx
+++ b/cui/source/inc/hldocntp.hxx
@@ -30,11 +30,11 @@
class SvxHyperlinkNewDocTp : public SvxHyperlinkTabPageBase
{
private:
- RadioButton *m_pRbtEditNow;
- RadioButton *m_pRbtEditLater;
- SvxHyperURLBox *m_pCbbPath;
- PushButton *m_pBtCreate;
- ListBox *m_pLbDocTypes;
+ VclPtr<RadioButton> m_pRbtEditNow;
+ VclPtr<RadioButton> m_pRbtEditLater;
+ VclPtr<SvxHyperURLBox> m_pCbbPath;
+ VclPtr<PushButton> m_pBtCreate;
+ VclPtr<ListBox> m_pLbDocTypes;
bool ImplGetURLObject( const OUString& rPath, const OUString& rBase, INetURLObject& aURLObject ) const;
void FillDocumentList ();
@@ -52,8 +52,9 @@ protected:
public:
SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet);
virtual ~SvxHyperlinkNewDocTp ();
+ virtual void dispose() SAL_OVERRIDE;
- static IconChoicePage* Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
+ static VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
virtual bool AskApply () SAL_OVERRIDE;
virtual void DoApply () SAL_OVERRIDE;
diff --git a/cui/source/inc/hldoctp.hxx b/cui/source/inc/hldoctp.hxx
index 1b7e3525840d..457cf1e0ea28 100644
--- a/cui/source/inc/hldoctp.hxx
+++ b/cui/source/inc/hldoctp.hxx
@@ -30,12 +30,12 @@
class SvxHyperlinkDocTp : public SvxHyperlinkTabPageBase
{
private:
- SvxHyperURLBox *m_pCbbPath;
- PushButton *m_pBtFileopen;
+ VclPtr<SvxHyperURLBox> m_pCbbPath;
+ VclPtr<PushButton> m_pBtFileopen;
- Edit *m_pEdTarget;
- FixedText *m_pFtFullURL;
- PushButton *m_pBtBrowse;
+ VclPtr<Edit> m_pEdTarget;
+ VclPtr<FixedText> m_pFtFullURL;
+ VclPtr<PushButton> m_pBtBrowse;
OUString maStrURL;
@@ -67,9 +67,10 @@ protected:
public:
SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet);
- virtual ~SvxHyperlinkDocTp ();
+ virtual ~SvxHyperlinkDocTp();
+ virtual void dispose() SAL_OVERRIDE;
- static IconChoicePage* Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
+ static VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
virtual void SetMarkStr ( const OUString& aStrMark ) SAL_OVERRIDE;
diff --git a/cui/source/inc/hlinettp.hxx b/cui/source/inc/hlinettp.hxx
index e11b74456b32..99f60cdca909 100644
--- a/cui/source/inc/hlinettp.hxx
+++ b/cui/source/inc/hlinettp.hxx
@@ -32,15 +32,15 @@
class SvxHyperlinkInternetTp : public SvxHyperlinkTabPageBase
{
private:
- RadioButton *m_pRbtLinktypInternet;
- RadioButton *m_pRbtLinktypFTP;
- SvxHyperURLBox *m_pCbbTarget;
- PushButton *m_pBtBrowse;
- FixedText *m_pFtLogin;
- Edit *m_pEdLogin;
- FixedText *m_pFtPassword;
- Edit *m_pEdPassword;
- CheckBox *m_pCbAnonymous;
+ VclPtr<RadioButton > m_pRbtLinktypInternet;
+ VclPtr<RadioButton> m_pRbtLinktypFTP;
+ VclPtr<SvxHyperURLBox> m_pCbbTarget;
+ VclPtr<PushButton> m_pBtBrowse;
+ VclPtr<FixedText> m_pFtLogin;
+ VclPtr<Edit> m_pEdLogin;
+ VclPtr<FixedText> m_pFtPassword;
+ VclPtr<Edit> m_pEdPassword;
+ VclPtr<CheckBox> m_pCbAnonymous;
OUString maStrOldUser;
OUString maStrOldPassword;
@@ -78,9 +78,10 @@ protected:
public:
SvxHyperlinkInternetTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet);
- virtual ~SvxHyperlinkInternetTp ();
+ virtual ~SvxHyperlinkInternetTp();
+ virtual void dispose() SAL_OVERRIDE;
- static IconChoicePage* Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
+ static VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
virtual void SetMarkStr ( const OUString& aStrMark ) SAL_OVERRIDE;
diff --git a/cui/source/inc/hlmailtp.hxx b/cui/source/inc/hlmailtp.hxx
index 6f847976e16b..705a9a3a8fda 100644
--- a/cui/source/inc/hlmailtp.hxx
+++ b/cui/source/inc/hlmailtp.hxx
@@ -30,10 +30,10 @@
class SvxHyperlinkMailTp : public SvxHyperlinkTabPageBase
{
private:
- SvxHyperURLBox *m_pCbbReceiver;
- PushButton *m_pBtAdrBook;
- FixedText *m_pFtSubject;
- Edit *m_pEdSubject;
+ VclPtr<SvxHyperURLBox> m_pCbbReceiver;
+ VclPtr<PushButton> m_pBtAdrBook;
+ VclPtr<FixedText> m_pFtSubject;
+ VclPtr<Edit> m_pEdSubject;
DECL_LINK (ClickAdrBookHdl_Impl , void * ); ///< Button : Address book
DECL_LINK (ModifiedReceiverHdl_Impl, void * ); ///< Combobox "receiver" modified
@@ -51,9 +51,10 @@ protected:
public:
SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet);
- virtual ~SvxHyperlinkMailTp ();
+ virtual ~SvxHyperlinkMailTp();
+ virtual void dispose() SAL_OVERRIDE;
- static IconChoicePage* Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
+ static VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
virtual void SetInitFocus() SAL_OVERRIDE;
};
diff --git a/cui/source/inc/hlmarkwn.hxx b/cui/source/inc/hlmarkwn.hxx
index 2108beb587b4..9591a2a0f640 100644
--- a/cui/source/inc/hlmarkwn.hxx
+++ b/cui/source/inc/hlmarkwn.hxx
@@ -39,10 +39,12 @@ class SvxHlinkDlgMarkWnd;
class SvxHlmarkTreeLBox : public SvTreeListBox
{
private:
- SvxHlinkDlgMarkWnd* mpParentWnd;
+ VclPtr<SvxHlinkDlgMarkWnd> mpParentWnd;
public:
SvxHlmarkTreeLBox(vcl::Window* pParent, WinBits nStyle);
+ virtual ~SvxHlmarkTreeLBox();
+ virtual void dispose() SAL_OVERRIDE;
void SetParentWnd(SvxHlinkDlgMarkWnd* pParent)
{
@@ -62,13 +64,13 @@ class SvxHlinkDlgMarkWnd : public ModalDialog //FloatingWindow
private:
friend class SvxHlmarkTreeLBox;
- PushButton* mpBtApply;
- PushButton* mpBtClose;
- SvxHlmarkTreeLBox* mpLbTree;
+ VclPtr<PushButton> mpBtApply;
+ VclPtr<PushButton> mpBtClose;
+ VclPtr<SvxHlmarkTreeLBox> mpLbTree;
bool mbUserMoved;
- SvxHyperlinkTabPageBase* mpParent;
+ VclPtr<SvxHyperlinkTabPageBase> mpParent;
OUString maStrLastURL;
@@ -90,6 +92,7 @@ protected:
public:
SvxHlinkDlgMarkWnd (SvxHyperlinkTabPageBase *pParent);
virtual ~SvxHlinkDlgMarkWnd();
+ virtual void dispose() SAL_OVERRIDE;
bool MoveTo ( Point aNewPos );
void RefreshTree(const OUString& aStrURL);
diff --git a/cui/source/inc/hltpbase.hxx b/cui/source/inc/hltpbase.hxx
index f1df0e407056..d155d6e42de7 100644
--- a/cui/source/inc/hltpbase.hxx
+++ b/cui/source/inc/hltpbase.hxx
@@ -67,11 +67,11 @@ public:
class SvxHyperlinkTabPageBase : public IconChoicePage
{
private:
- ComboBox *mpCbbFrame;
- ListBox *mpLbForm;
- Edit *mpEdIndication;
- Edit *mpEdText;
- PushButton *mpBtScript;
+ VclPtr<ComboBox> mpCbbFrame;
+ VclPtr<ListBox> mpLbForm;
+ VclPtr<Edit> mpEdIndication;
+ VclPtr<Edit> mpEdText;
+ VclPtr<PushButton> mpBtScript;
bool mbIsCloseDisabled;
@@ -79,7 +79,7 @@ private:
mxDocumentFrame;
protected:
- vcl::Window* mpDialog;
+ VclPtr<vcl::Window> mpDialog;
bool mbStdControlsInit;
@@ -87,7 +87,7 @@ protected:
Timer maTimer;
- SvxHlinkDlgMarkWnd* mpMarkWnd;
+ VclPtr<SvxHlinkDlgMarkWnd> mpMarkWnd;
void InitStdControls ();
void FillStandardDlgFields ( const SvxHyperlinkItem* pHyperlinkItem );
@@ -118,6 +118,7 @@ public:
const SfxItemSet& rItemSet
);
virtual ~SvxHyperlinkTabPageBase ();
+ virtual void dispose() SAL_OVERRIDE;
void SetDocumentFrame(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame )
diff --git a/cui/source/inc/hyphen.hxx b/cui/source/inc/hyphen.hxx
index 4d0b7ba7c489..3bf97672b99b 100644
--- a/cui/source/inc/hyphen.hxx
+++ b/cui/source/inc/hyphen.hxx
@@ -42,14 +42,14 @@ protected:
class SvxHyphenWordDialog : public SfxModalDialog
{
- HyphenEdit* m_pWordEdit;
- PushButton* m_pLeftBtn;
- PushButton* m_pRightBtn;
- PushButton* m_pOkBtn;
- PushButton* m_pContBtn;
- PushButton* m_pDelBtn;
- PushButton* m_pHyphAll;
- CloseButton* m_pCloseBtn;
+ VclPtr<HyphenEdit> m_pWordEdit;
+ VclPtr<PushButton> m_pLeftBtn;
+ VclPtr<PushButton> m_pRightBtn;
+ VclPtr<PushButton> m_pOkBtn;
+ VclPtr<PushButton> m_pContBtn;
+ VclPtr<PushButton> m_pDelBtn;
+ VclPtr<PushButton> m_pHyphAll;
+ VclPtr<CloseButton> m_pCloseBtn;
OUString aLabel;
SvxSpellWrapper* pHyphWrapper;
css::uno::Reference< css::linguistic2::XHyphenator > xHyphenator;
@@ -86,6 +86,7 @@ public:
css::uno::Reference< css::linguistic2::XHyphenator > &xHyphen,
SvxSpellWrapper* pWrapper );
virtual ~SvxHyphenWordDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetWindowTitle( LanguageType nLang );
void SelLeft();
diff --git a/cui/source/inc/iconcdlg.hxx b/cui/source/inc/iconcdlg.hxx
index 8831eb65f3d0..74b686d17ca5 100644
--- a/cui/source/inc/iconcdlg.hxx
+++ b/cui/source/inc/iconcdlg.hxx
@@ -40,8 +40,8 @@ class IconChoiceDialog;
class IconChoicePage;
// Create-Function
-typedef IconChoicePage* (*CreatePage)(vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet &rAttrSet);
-typedef const sal_uInt16* (*GetPageRanges)(); // gives international Which-value
+typedef VclPtr<IconChoicePage> (*CreatePage)(vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet &rAttrSet);
+typedef const sal_uInt16* (*GetPageRanges)(); // gives international Which-value
/// Data-structure for pages in dialog
struct IconChoicePageData
@@ -49,7 +49,7 @@ struct IconChoicePageData
sal_uInt16 nId;
CreatePage fnCreatePage; ///< pointer to the factory
GetPageRanges fnGetRanges; ///< pointer to the ranges-function
- IconChoicePage* pPage; ///< the TabPage itself
+ VclPtr<IconChoicePage> pPage; ///< the TabPage itself
bool bOnDemand; ///< Flag: ItemSet onDemand
bool bRefresh; ///< Flag: page has to be newly initialized
@@ -73,7 +73,7 @@ private :
const SfxItemSet* pSet;
OUString aUserString;
bool bHasExchangeSupport;
- IconChoiceDialog* pDialog;
+ VclPtr<IconChoiceDialog> pDialog;
void SetDialog( IconChoiceDialog* pNew ) { pDialog = pNew; }
IconChoiceDialog* GetDialog() const { return pDialog; }
@@ -85,11 +85,12 @@ private :
protected :
IconChoicePage( vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet &rAttrSet );
- sal_uInt16 GetSlot( sal_uInt16 nWhich ) const { return pSet->GetPool()->GetSlotId( nWhich ); }
- sal_uInt16 GetWhich( sal_uInt16 nSlot ) const { return pSet->GetPool()->GetWhich( nSlot ); }
+ sal_uInt16 GetSlot( sal_uInt16 nWhich ) const { return pSet->GetPool()->GetSlotId( nWhich ); }
+ sal_uInt16 GetWhich( sal_uInt16 nSlot ) const { return pSet->GetPool()->GetWhich( nSlot ); }
public :
- virtual ~IconChoicePage();
+ virtual ~IconChoicePage();
+ virtual void dispose() SAL_OVERRIDE;
const SfxItemSet& GetItemSet() const { return *pSet; }
@@ -125,18 +126,18 @@ private :
::std::vector< IconChoicePageData* > maPageList;
- SvtIconChoiceCtrl *m_pIconCtrl;
+ VclPtr<SvtIconChoiceCtrl> m_pIconCtrl;
sal_uInt16 mnCurrentPageId;
// Buttons
- OKButton *m_pOKBtn;
- PushButton *m_pApplyBtn;
- CancelButton *m_pCancelBtn;
- HelpButton *m_pHelpBtn;
- PushButton *m_pResetBtn;
+ VclPtr<OKButton> m_pOKBtn;
+ VclPtr<PushButton> m_pApplyBtn;
+ VclPtr<CancelButton> m_pCancelBtn;
+ VclPtr<HelpButton> m_pHelpBtn;
+ VclPtr<PushButton> m_pResetBtn;
- VclVBox *m_pTabContainer;
+ VclPtr<VclVBox> m_pTabContainer;
const SfxItemSet* pSet;
SfxItemSet* pOutSet;
SfxItemSet* pExampleSet;
@@ -167,7 +168,7 @@ protected :
SfxItemSet* CreateInputItemSet( sal_uInt16 nId );
inline SfxItemSet* GetInputSetImpl() { return const_cast<SfxItemSet*>(pSet); }
inline IconChoicePage* GetTabPage( sal_uInt16 nPageId )
- { return ( GetPageData (nPageId)->pPage?GetPageData (nPageId)->pPage:NULL); }
+ { return ( GetPageData (nPageId)->pPage?GetPageData (nPageId)->pPage.get():NULL); }
void RefreshInputSet();
void ActivatePageImpl ();
@@ -182,6 +183,7 @@ public :
IconChoiceDialog ( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription,
const SfxItemSet * pItemSet = 0 );
virtual ~IconChoiceDialog ();
+ virtual void dispose() SAL_OVERRIDE;
// interface
SvxIconChoiceCtrlEntry* AddTabPage(
diff --git a/cui/source/inc/insdlg.hxx b/cui/source/inc/insdlg.hxx
index 5807c240b826..eda64bad3349 100644
--- a/cui/source/inc/insdlg.hxx
+++ b/cui/source/inc/insdlg.hxx
@@ -56,14 +56,14 @@ public:
class SvInsertOleDlg : public InsertObjectDialog_Impl
{
- RadioButton* m_pRbNewObject;
- RadioButton* m_pRbObjectFromfile;
- VclFrame* m_pObjectTypeFrame;
- ListBox* m_pLbObjecttype;
- VclFrame* m_pFileFrame;
- Edit* m_pEdFilepath;
- PushButton* m_pBtnFilepath;
- CheckBox* m_pCbFilelink;
+ VclPtr<RadioButton> m_pRbNewObject;
+ VclPtr<RadioButton> m_pRbObjectFromfile;
+ VclPtr<VclFrame> m_pObjectTypeFrame;
+ VclPtr<ListBox> m_pLbObjecttype;
+ VclPtr<VclFrame> m_pFileFrame;
+ VclPtr<Edit> m_pEdFilepath;
+ VclPtr<PushButton> m_pBtnFilepath;
+ VclPtr<CheckBox> m_pCbFilelink;
const SvObjectServerList* m_pServers;
::com::sun::star::uno::Sequence< sal_Int8 > m_aIconMetaFile;
@@ -86,6 +86,8 @@ public:
SvInsertOleDlg( vcl::Window* pParent,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage,
const SvObjectServerList* pServers = NULL );
+ virtual ~SvInsertOleDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
/// get replacement for the iconified embedded object and the mediatype of the replacement
@@ -95,9 +97,9 @@ public:
class SvInsertPlugInDialog : public InsertObjectDialog_Impl
{
private:
- Edit* m_pEdFileurl;
- PushButton* m_pBtnFileurl;
- VclMultiLineEdit* m_pEdPluginsOptions;
+ VclPtr<Edit> m_pEdFileurl;
+ VclPtr<PushButton> m_pBtnFileurl;
+ VclPtr<VclMultiLineEdit> m_pEdPluginsOptions;
INetURLObject* m_pURL;
OUString m_aCommands;
@@ -109,29 +111,30 @@ public:
SvInsertPlugInDialog(vcl::Window* pParent,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage);
virtual ~SvInsertPlugInDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
};
class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl
{
private:
- Edit* m_pEDName;
- Edit* m_pEDURL;
- PushButton* m_pBTOpen;
+ VclPtr<Edit> m_pEDName;
+ VclPtr<Edit> m_pEDURL;
+ VclPtr<PushButton> m_pBTOpen;
- RadioButton* m_pRBScrollingOn;
- RadioButton* m_pRBScrollingOff;
- RadioButton* m_pRBScrollingAuto;
+ VclPtr<RadioButton> m_pRBScrollingOn;
+ VclPtr<RadioButton> m_pRBScrollingOff;
+ VclPtr<RadioButton> m_pRBScrollingAuto;
- RadioButton* m_pRBFrameBorderOn;
- RadioButton* m_pRBFrameBorderOff;
+ VclPtr<RadioButton> m_pRBFrameBorderOn;
+ VclPtr<RadioButton> m_pRBFrameBorderOff;
- FixedText* m_pFTMarginWidth;
- NumericField* m_pNMMarginWidth;
- CheckBox* m_pCBMarginWidthDefault;
- FixedText* m_pFTMarginHeight;
- NumericField* m_pNMMarginHeight;
- CheckBox* m_pCBMarginHeightDefault;
+ VclPtr<FixedText> m_pFTMarginWidth;
+ VclPtr<NumericField> m_pNMMarginWidth;
+ VclPtr<CheckBox> m_pCBMarginWidthDefault;
+ VclPtr<FixedText> m_pFTMarginHeight;
+ VclPtr<NumericField> m_pNMMarginHeight;
+ VclPtr<CheckBox> m_pCBMarginHeightDefault;
DECL_STATIC_LINK(SfxInsertFloatingFrameDialog, OpenHdl, PushButton* );
DECL_STATIC_LINK(SfxInsertFloatingFrameDialog, CheckHdl, CheckBox* );
@@ -143,6 +146,8 @@ public:
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
SfxInsertFloatingFrameDialog( vcl::Window* pParent,
const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj );
+ virtual ~SfxInsertFloatingFrameDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
};
diff --git a/cui/source/inc/insrc.hxx b/cui/source/inc/insrc.hxx
index a6e215e2ee49..0e66966be946 100644
--- a/cui/source/inc/insrc.hxx
+++ b/cui/source/inc/insrc.hxx
@@ -29,20 +29,22 @@
#include <vcl/group.hxx>
#include <vcl/button.hxx>
-class SvxInsRowColDlg : public SvxAbstractInsRowColDlg, public ModalDialog
+class SvxInsRowColDlg : public SvxAbstractInsRowColDlg
{
- NumericField* m_pCountEdit;
+ VclPtr<ModalDialog> m_pDialog;
+ VclPtr<NumericField> m_pCountEdit;
- RadioButton* m_pBeforeBtn;
- RadioButton* m_pAfterBtn;
+ VclPtr<RadioButton> m_pBeforeBtn;
+ VclPtr<RadioButton> m_pAfterBtn;
OUString aRow;
OUString aCol;
- bool bColumn;
+ bool bColumn;
public:
SvxInsRowColDlg( vcl::Window* pParent, bool bCol, const OString& sHelpId );
+ virtual ~SvxInsRowColDlg();
virtual short Execute() SAL_OVERRIDE;
diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx
index 446499f28887..610c63b2f2f9 100644
--- a/cui/source/inc/labdlg.hxx
+++ b/cui/source/inc/labdlg.hxx
@@ -34,16 +34,16 @@ class SvxCaptionTabPage : public SfxTabPage
{
private:
static const sal_uInt16 pCaptionRanges[];
- ValueSet* m_pCT_CAPTTYPE;
- MetricField* m_pMF_ABSTAND;
- ListBox* m_pLB_ANSATZ;
- FixedText* m_pFT_UM;
- MetricField* m_pMF_ANSATZ;
- FixedText* m_pFT_ANSATZ_REL;
- ListBox* m_pLB_ANSATZ_REL;
- FixedText* m_pFT_LAENGE;
- MetricField* m_pMF_LAENGE;
- CheckBox* m_pCB_LAENGE;
+ VclPtr<ValueSet> m_pCT_CAPTTYPE;
+ VclPtr<MetricField> m_pMF_ABSTAND;
+ VclPtr<ListBox> m_pLB_ANSATZ;
+ VclPtr<FixedText> m_pFT_UM;
+ VclPtr<MetricField> m_pMF_ANSATZ;
+ VclPtr<FixedText> m_pFT_ANSATZ_REL;
+ VclPtr<ListBox> m_pLB_ANSATZ_REL;
+ VclPtr<FixedText> m_pFT_LAENGE;
+ VclPtr<MetricField> m_pMF_LAENGE;
+ VclPtr<CheckBox> m_pCB_LAENGE;
Image m_aBmpCapTypes[CAPTYPE_BITMAPS_COUNT];
@@ -75,8 +75,10 @@ private:
public:
SvxCaptionTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxCaptionTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pCaptionRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
diff --git a/cui/source/inc/linkdlg.hxx b/cui/source/inc/linkdlg.hxx
index 89491007d919..7e953fcd747e 100644
--- a/cui/source/inc/linkdlg.hxx
+++ b/cui/source/inc/linkdlg.hxx
@@ -44,16 +44,16 @@ class SvBaseLinksDlg : public ModalDialog
{
using Window::SetType;
- SvTabListBox *m_pTbLinks;
- FixedText *m_pFtFullFileName;
- FixedText *m_pFtFullSourceName;
- FixedText *m_pFtFullTypeName;
- RadioButton *m_pRbAutomatic;
- RadioButton *m_pRbManual;
- PushButton *m_pPbUpdateNow;
- PushButton *m_pPbOpenSource;
- PushButton *m_pPbChangeSource;
- PushButton *m_pPbBreakLink;
+ VclPtr<SvTabListBox> m_pTbLinks;
+ VclPtr<FixedText> m_pFtFullFileName;
+ VclPtr<FixedText> m_pFtFullSourceName;
+ VclPtr<FixedText> m_pFtFullTypeName;
+ VclPtr<RadioButton> m_pRbAutomatic;
+ VclPtr<RadioButton> m_pRbManual;
+ VclPtr<PushButton> m_pPbUpdateNow;
+ VclPtr<PushButton> m_pPbOpenSource;
+ VclPtr<PushButton> m_pPbChangeSource;
+ VclPtr<PushButton> m_pPbBreakLink;
OUString aStrAutolink;
OUString aStrManuallink;
OUString aStrBrokenlink;
@@ -96,6 +96,7 @@ class SvBaseLinksDlg : public ModalDialog
public:
SvBaseLinksDlg( vcl::Window * pParent, sfx2::LinkManager*, bool bHtml = false );
virtual ~SvBaseLinksDlg();
+ virtual void dispose() SAL_OVERRIDE;
void SetActLink( sfx2::SvBaseLink * pLink );
};
diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx
index c0e4fd66492b..696c8bf55711 100644
--- a/cui/source/inc/macroass.hxx
+++ b/cui/source/inc/macroass.hxx
@@ -57,6 +57,7 @@ protected:
public:
virtual ~_SfxMacroTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void AddEvent( const OUString & rEventName, sal_uInt16 nEventId );
@@ -96,7 +97,7 @@ public:
);
// --------- inherit from the base -------------
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
};
class SfxMacroAssignDlg : public SfxSingleTabDialog
diff --git a/cui/source/inc/macropg.hxx b/cui/source/inc/macropg.hxx
index c1cded175f5e..befe9e3607f9 100644
--- a/cui/source/inc/macropg.hxx
+++ b/cui/source/inc/macropg.hxx
@@ -82,6 +82,7 @@ protected:
public:
virtual ~_SvxMacroTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void InitResources();
void InitAndSetHandler( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > xAppEvents, ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > xDocEvents, ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifiable > xModifiable );
diff --git a/cui/source/inc/measure.hxx b/cui/source/inc/measure.hxx
index aadc276d3641..28dbdfdc7c28 100644
--- a/cui/source/inc/measure.hxx
+++ b/cui/source/inc/measure.hxx
@@ -33,23 +33,23 @@ class SvxMeasurePage : public SvxTabPage
private:
static const sal_uInt16 pRanges[];
- MetricField* m_pMtrFldLineDist;
- MetricField* m_pMtrFldHelplineOverhang;
- MetricField* m_pMtrFldHelplineDist;
- MetricField* m_pMtrFldHelpline1Len;
- MetricField* m_pMtrFldHelpline2Len;
- TriStateBox* m_pTsbBelowRefEdge;
- MetricField* m_pMtrFldDecimalPlaces;
-
- SvxRectCtl* m_pCtlPosition;
- TriStateBox* m_pTsbAutoPosV;
- TriStateBox* m_pTsbAutoPosH;
- TriStateBox* m_pTsbShowUnit;
- ListBox* m_pLbUnit;
- TriStateBox* m_pTsbParallel;
- FixedText* m_pFtAutomatic;
-
- SvxXMeasurePreview* m_pCtlPreview;
+ VclPtr<MetricField> m_pMtrFldLineDist;
+ VclPtr<MetricField> m_pMtrFldHelplineOverhang;
+ VclPtr<MetricField> m_pMtrFldHelplineDist;
+ VclPtr<MetricField> m_pMtrFldHelpline1Len;
+ VclPtr<MetricField> m_pMtrFldHelpline2Len;
+ VclPtr<TriStateBox> m_pTsbBelowRefEdge;
+ VclPtr<MetricField> m_pMtrFldDecimalPlaces;
+
+ VclPtr<SvxRectCtl> m_pCtlPosition;
+ VclPtr<TriStateBox> m_pTsbAutoPosV;
+ VclPtr<TriStateBox> m_pTsbAutoPosH;
+ VclPtr<TriStateBox> m_pTsbShowUnit;
+ VclPtr<ListBox> m_pLbUnit;
+ VclPtr<TriStateBox> m_pTsbParallel;
+ VclPtr<FixedText> m_pFtAutomatic;
+
+ VclPtr<SvxXMeasurePreview> m_pCtlPreview;
const SfxItemSet& rOutAttrs;
SfxItemSet aAttrSet;
@@ -67,8 +67,9 @@ public:
SvxMeasurePage( vcl::Window* pWindow, const SfxItemSet& rInAttrs );
virtual ~SvxMeasurePage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
diff --git a/cui/source/inc/multipat.hxx b/cui/source/inc/multipat.hxx
index 0508ff40aba1..ecc1395f6cad 100644
--- a/cui/source/inc/multipat.hxx
+++ b/cui/source/inc/multipat.hxx
@@ -39,9 +39,9 @@
class SvxMultiPathDialog : public ModalDialog
{
private:
- svx::SvxRadioButtonListBox* m_pRadioLB;
- PushButton* m_pAddBtn;
- PushButton* m_pDelBtn;
+ VclPtr<svx::SvxRadioButtonListBox> m_pRadioLB;
+ VclPtr<PushButton> m_pAddBtn;
+ VclPtr<PushButton> m_pDelBtn;
DECL_LINK(AddHdl_Impl, void *);
DECL_LINK(DelHdl_Impl, void *);
@@ -51,6 +51,7 @@ private:
public:
SvxMultiPathDialog(vcl::Window* pParent);
virtual ~SvxMultiPathDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetPath() const;
void SetPath( const OUString& rPath );
@@ -59,9 +60,9 @@ public:
class SvxPathSelectDialog : public ModalDialog
{
private:
- ListBox* m_pPathLB;
- PushButton* m_pAddBtn;
- PushButton* m_pDelBtn;
+ VclPtr<ListBox> m_pPathLB;
+ VclPtr<PushButton> m_pAddBtn;
+ VclPtr<PushButton> m_pDelBtn;
DECL_LINK(AddHdl_Impl, void *);
DECL_LINK(DelHdl_Impl, void *);
@@ -70,6 +71,7 @@ private:
public:
SvxPathSelectDialog(vcl::Window* pParent);
virtual ~SvxPathSelectDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetPath() const;
void SetPath( const OUString& rPath );
diff --git a/cui/source/inc/newtabledlg.hxx b/cui/source/inc/newtabledlg.hxx
index 109d62f1509e..394d04265344 100644
--- a/cui/source/inc/newtabledlg.hxx
+++ b/cui/source/inc/newtabledlg.hxx
@@ -26,14 +26,16 @@
#include <svx/stddlg.hxx>
#include <svx/svxdlg.hxx>
-class SvxNewTableDialog : public SvxAbstractNewTableDialog, public ModalDialog
+class SvxNewTableDialog : public SvxAbstractNewTableDialog
{
private:
- NumericField* mpNumColumns;
- NumericField* mpNumRows;
+ VclPtr<ModalDialog> m_pDialog;
+ VclPtr<NumericField> mpNumColumns;
+ VclPtr<NumericField> mpNumRows;
public:
SvxNewTableDialog( vcl::Window* pWindow );
+ virtual ~SvxNewTableDialog();
virtual short Execute() SAL_OVERRIDE;
diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx
index 9a6172a5a753..e2fa378794a2 100644
--- a/cui/source/inc/numfmt.hxx
+++ b/cui/source/inc/numfmt.hxx
@@ -70,8 +70,9 @@ class SvxNumberFormatTabPage : public SfxTabPage
public:
virtual ~SvxNumberFormatTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
// Returns area information.
static const sal_uInt16* GetRanges() { return pRanges; }
@@ -91,31 +92,31 @@ public:
private:
SvxNumberFormatTabPage( vcl::Window* pParent,
const SfxItemSet& rCoreAttrs );
- FixedText* m_pFtCategory;
- ListBox* m_pLbCategory;
- FixedText* m_pFtFormat;
- ListBox* m_pLbCurrency;
- SvxFontListBox* m_pLbFormat;
- FixedText* m_pFtLanguage;
- SvxLanguageBox* m_pLbLanguage;
- CheckBox* m_pCbSourceFormat;
- SvxNumberPreview* m_pWndPreview;
- FixedText* m_pFtOptions;
- FixedText* m_pFtDecimals;
- NumericField* m_pEdDecimals;
- CheckBox* m_pBtnNegRed;
- FixedText* m_pFtLeadZeroes;
- NumericField* m_pEdLeadZeroes;
- CheckBox* m_pBtnThousand;
-
- VclContainer* m_pFormatCodeFrame;
- Edit* m_pEdFormat;
- PushButton* m_pIbAdd;
- PushButton* m_pIbInfo;
- PushButton* m_pIbRemove;
-
- FixedText* m_pFtComment;
- Edit* m_pEdComment;
+ VclPtr<FixedText> m_pFtCategory;
+ VclPtr<ListBox> m_pLbCategory;
+ VclPtr<FixedText> m_pFtFormat;
+ VclPtr<ListBox> m_pLbCurrency;
+ VclPtr<SvxFontListBox> m_pLbFormat;
+ VclPtr<FixedText> m_pFtLanguage;
+ VclPtr<SvxLanguageBox> m_pLbLanguage;
+ VclPtr<CheckBox> m_pCbSourceFormat;
+ VclPtr<SvxNumberPreview> m_pWndPreview;
+ VclPtr<FixedText> m_pFtOptions;
+ VclPtr<FixedText> m_pFtDecimals;
+ VclPtr<NumericField> m_pEdDecimals;
+ VclPtr<CheckBox> m_pBtnNegRed;
+ VclPtr<FixedText> m_pFtLeadZeroes;
+ VclPtr<NumericField> m_pEdLeadZeroes;
+ VclPtr<CheckBox> m_pBtnThousand;
+
+ VclPtr<VclContainer> m_pFormatCodeFrame;
+ VclPtr<Edit> m_pEdFormat;
+ VclPtr<PushButton> m_pIbAdd;
+ VclPtr<PushButton> m_pIbInfo;
+ VclPtr<PushButton> m_pIbRemove;
+
+ VclPtr<FixedText> m_pFtComment;
+ VclPtr<Edit> m_pEdComment;
Timer aResetWinTimer;
@@ -130,7 +131,7 @@ private:
OUString sAutomaticEntry;
- vcl::Window* pLastActivWindow;
+ VclPtr<vcl::Window> pLastActivWindow;
void Init_Impl();
void FillCurrencyBox();
@@ -145,11 +146,11 @@ private:
void ChangePreviewText( sal_uInt16 nPos );
void AddAutomaticLanguage_Impl(LanguageType eAutoLang, bool bSelect);
// Handler
- DECL_LINK( LostFocusHdl_Impl, Edit* pEd );
- DECL_LINK( DoubleClickHdl_Impl, SvxFontListBox* pLb );
+ DECL_LINK( LostFocusHdl_Impl, Edit* );
+ DECL_LINK( DoubleClickHdl_Impl, SvxFontListBox* );
DECL_LINK( SelFormatHdl_Impl, void * );
- DECL_LINK( ClickHdl_Impl, PushButton* pIB );
- DECL_LINK( EditHdl_Impl, Edit* pEdFormat );
+ DECL_LINK( ClickHdl_Impl, PushButton* );
+ DECL_LINK( EditHdl_Impl, Edit* );
DECL_LINK( OptHdl_Impl, void * );
DECL_LINK(TimeHdl_Impl, void *);
};
diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx
index 739249fbde20..108f9e3bea39 100644
--- a/cui/source/inc/numpages.hxx
+++ b/cui/source/inc/numpages.hxx
@@ -90,7 +90,7 @@ class SvxSingleNumPickTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- SvxNumValueSet* m_pExamplesVS;
+ VclPtr<SvxNumValueSet> m_pExamplesVS;
SvxNumSettingsArr_Impl aNumSettingsArr;
SvxNumRule* pActNum;
SvxNumRule* pSaveNum;
@@ -101,16 +101,17 @@ class SvxSingleNumPickTabPage : public SfxTabPage
OUString sNumCharFmtName;
sal_uInt16 nNumItemId;
- protected:
+protected:
DECL_LINK(NumSelectHdl_Impl, void *);
DECL_LINK(DoubleClickHdl_Impl, void *);
- public:
+public:
SvxSingleNumPickTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
- virtual ~SvxSingleNumPickTabPage();
+ virtual ~SvxSingleNumPickTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
@@ -129,7 +130,7 @@ class SvxBulletPickTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- SvxNumValueSet* m_pExamplesVS;
+ VclPtr<SvxNumValueSet> m_pExamplesVS;
SvxNumRule* pActNum;
SvxNumRule* pSaveNum;
sal_uInt16 nActNumLvl;
@@ -138,15 +139,16 @@ class SvxBulletPickTabPage : public SfxTabPage
sal_uInt16 nNumItemId;
OUString sBulletCharFmtName;
- protected:
+protected:
DECL_LINK(NumSelectHdl_Impl, void *);
DECL_LINK(DoubleClickHdl_Impl, void *);
- public:
+public:
SvxBulletPickTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
- virtual ~SvxBulletPickTabPage();
+ virtual ~SvxBulletPickTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
@@ -166,7 +168,7 @@ class SvxNumPickTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- SvxNumValueSet* m_pExamplesVS;
+ VclPtr<SvxNumValueSet> m_pExamplesVS;
OUString sNumCharFmtName;
OUString sBulletCharFmtName;
@@ -180,16 +182,17 @@ class SvxNumPickTabPage : public SfxTabPage
bool bPreset : 1;
- protected:
+protected:
DECL_LINK(NumSelectHdl_Impl, void *);
DECL_LINK(DoubleClickHdl_Impl, void *);
- public:
- SvxNumPickTabPage(vcl::Window* pParent,
+public:
+ SvxNumPickTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
- virtual ~SvxNumPickTabPage();
+ virtual ~SvxNumPickTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
@@ -210,8 +213,8 @@ class SvxBitmapPickTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- FixedText* m_pErrorText;
- SvxBmpNumValueSet* m_pExamplesVS;
+ VclPtr<FixedText> m_pErrorText;
+ VclPtr<SvxBmpNumValueSet> m_pExamplesVS;
std::vector<OUString> aGrfNames;
OUString sNumCharFmtName;
@@ -224,17 +227,18 @@ class SvxBitmapPickTabPage : public SfxTabPage
bool bModified : 1;
bool bPreset : 1;
- protected:
+protected:
DECL_LINK(NumSelectHdl_Impl, void *);
DECL_LINK(DoubleClickHdl_Impl, void *);
DECL_LINK(LinkBmpHdl_Impl, void *);
- public:
+public:
SvxBitmapPickTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
virtual ~SvxBitmapPickTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
@@ -251,44 +255,44 @@ class SvxNumOptionsTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- ListBox* m_pLevelLB;
-
- ListBox* m_pFmtLB;
-
- FixedText* m_pSeparatorFT;
- FixedText* m_pPrefixFT;
- Edit* m_pPrefixED;
- FixedText* m_pSuffixFT;
- Edit* m_pSuffixED;
- FixedText* m_pCharFmtFT;
- ListBox* m_pCharFmtLB;
- FixedText* m_pBulColorFT;
- ColorListBox* m_pBulColLB;
- FixedText* m_pBulRelSizeFT;
- MetricField* m_pBulRelSizeMF;
- FixedText* m_pAllLevelFT;
- NumericField* m_pAllLevelNF;
- FixedText* m_pStartFT;
- NumericField* m_pStartED;
- FixedText* m_pBulletFT;
- PushButton* m_pBulletPB;
- FixedText* m_pAlignFT;
- ListBox* m_pAlignLB;
- FixedText* m_pBitmapFT;
- MenuButton* m_pBitmapMB;
+ VclPtr<ListBox> m_pLevelLB;
+
+ VclPtr<ListBox> m_pFmtLB;
+
+ VclPtr<FixedText> m_pSeparatorFT;
+ VclPtr<FixedText> m_pPrefixFT;
+ VclPtr<Edit> m_pPrefixED;
+ VclPtr<FixedText> m_pSuffixFT;
+ VclPtr<Edit> m_pSuffixED;
+ VclPtr<FixedText> m_pCharFmtFT;
+ VclPtr<ListBox> m_pCharFmtLB;
+ VclPtr<FixedText> m_pBulColorFT;
+ VclPtr<ColorListBox> m_pBulColLB;
+ VclPtr<FixedText> m_pBulRelSizeFT;
+ VclPtr<MetricField> m_pBulRelSizeMF;
+ VclPtr<FixedText> m_pAllLevelFT;
+ VclPtr<NumericField> m_pAllLevelNF;
+ VclPtr<FixedText> m_pStartFT;
+ VclPtr<NumericField> m_pStartED;
+ VclPtr<FixedText> m_pBulletFT;
+ VclPtr<PushButton> m_pBulletPB;
+ VclPtr<FixedText> m_pAlignFT;
+ VclPtr<ListBox> m_pAlignLB;
+ VclPtr<FixedText> m_pBitmapFT;
+ VclPtr<MenuButton> m_pBitmapMB;
sal_uInt16 m_nGalleryId;
- FixedText* m_pWidthFT;
- MetricField* m_pWidthMF;
- FixedText* m_pHeightFT;
- MetricField* m_pHeightMF;
- CheckBox* m_pRatioCB;
- FixedText* m_pOrientFT;
- ListBox* m_pOrientLB;
+ VclPtr<FixedText> m_pWidthFT;
+ VclPtr<MetricField> m_pWidthMF;
+ VclPtr<FixedText> m_pHeightFT;
+ VclPtr<MetricField> m_pHeightMF;
+ VclPtr<CheckBox> m_pRatioCB;
+ VclPtr<FixedText> m_pOrientFT;
+ VclPtr<ListBox> m_pOrientLB;
- VclContainer* m_pAllLevelsFrame;
- CheckBox* m_pSameLevelCB;
+ VclPtr<VclContainer> m_pAllLevelsFrame;
+ VclPtr<CheckBox> m_pSameLevelCB;
- SvxNumberingPreview* m_pPreviewWIN;
+ VclPtr<SvxNumberingPreview> m_pPreviewWIN;
OUString m_sNumCharFmtName;
OUString m_sBulletCharFmtName;
@@ -341,12 +345,13 @@ class SvxNumOptionsTabPage : public SfxTabPage
DECL_STATIC_LINK( SvxNumOptionsTabPage, GraphicArrivedHdl_Impl, SvxBrushItem* );
- public:
+public:
SvxNumOptionsTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
virtual ~SvxNumOptionsTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
@@ -385,36 +390,36 @@ class SvxNumPositionTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- ListBox* m_pLevelLB;
+ VclPtr<ListBox> m_pLevelLB;
// 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;
- SvxNumberingPreview* m_pPreviewWIN;
+ VclPtr<SvxNumberingPreview> m_pPreviewWIN;
SvxNumRule* pActNum;
SvxNumRule* pSaveNum;
@@ -448,13 +453,14 @@ public:
SvxNumPositionTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
virtual ~SvxNumPositionTabPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
virtual sfxpg DeactivatePage(SfxItemSet *pSet) SAL_OVERRIDE;
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
void SetMetric(FieldUnit eSet);
diff --git a/cui/source/inc/optasian.hxx b/cui/source/inc/optasian.hxx
index d2d182420783..39d18ef48976 100644
--- a/cui/source/inc/optasian.hxx
+++ b/cui/source/inc/optasian.hxx
@@ -29,22 +29,22 @@
struct SvxAsianLayoutPage_Impl;
class SvxAsianLayoutPage : public SfxTabPage
{
- RadioButton* m_pCharKerningRB;
- RadioButton* m_pCharPunctKerningRB;
+ VclPtr<RadioButton> m_pCharKerningRB;
+ VclPtr<RadioButton> m_pCharPunctKerningRB;
- RadioButton* m_pNoCompressionRB;
- RadioButton* m_pPunctCompressionRB;
- RadioButton* m_pPunctKanaCompressionRB;
+ VclPtr<RadioButton> m_pNoCompressionRB;
+ VclPtr<RadioButton> m_pPunctCompressionRB;
+ VclPtr<RadioButton> m_pPunctKanaCompressionRB;
- FixedText* m_pLanguageFT;
- SvxLanguageBox* m_pLanguageLB;
- CheckBox* m_pStandardCB;
+ VclPtr<FixedText> m_pLanguageFT;
+ VclPtr<SvxLanguageBox> m_pLanguageLB;
+ VclPtr<CheckBox> m_pStandardCB;
- FixedText* m_pStartFT;
- Edit* m_pStartED;
- FixedText* m_pEndFT;
- Edit* m_pEndED;
- FixedText* m_pHintFT;
+ VclPtr<FixedText> m_pStartFT;
+ VclPtr<Edit> m_pStartED;
+ VclPtr<FixedText> m_pEndFT;
+ VclPtr<Edit> m_pEndED;
+ VclPtr<FixedText> m_pHintFT;
SvxAsianLayoutPage_Impl* pImpl;
@@ -52,12 +52,12 @@ class SvxAsianLayoutPage : public SfxTabPage
DECL_LINK(ChangeStandardHdl, CheckBox*);
DECL_LINK(ModifyHdl, Edit*);
- SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet& rSet );
public:
-
+ SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxAsianLayoutPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
static const sal_uInt16* GetRanges();
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx
index e26a4b37f253..3bdffc3f0edd 100644
--- a/cui/source/inc/optdict.hxx
+++ b/cui/source/inc/optdict.hxx
@@ -50,10 +50,10 @@ namespace linguistic2{
class SvxNewDictionaryDialog : public ModalDialog
{
private:
- Edit* pNameEdit;
- SvxLanguageBox* pLanguageLB;
- CheckBox* pExceptBtn;
- OKButton* pOKBtn;
+ VclPtr<Edit> pNameEdit;
+ VclPtr<SvxLanguageBox> pLanguageLB;
+ VclPtr<CheckBox> pExceptBtn;
+ VclPtr<OKButton> pOKBtn;
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
::com::sun::star::uno::Reference<
@@ -66,6 +66,8 @@ public:
SvxNewDictionaryDialog( vcl::Window* pParent,
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XSpellChecker1 > &xSpl );
+ virtual ~SvxNewDictionaryDialog();
+ virtual void dispose() SAL_OVERRIDE;
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XDictionary >
@@ -100,16 +102,16 @@ class SvxEditDictionaryDialog : public ModalDialog
{
private:
- ListBox* pAllDictsLB;
- FixedText* pLangFT;
- SvxLanguageBox* pLangLB;
+ VclPtr<ListBox> pAllDictsLB;
+ VclPtr<FixedText> pLangFT;
+ VclPtr<SvxLanguageBox> pLangLB;
- SvxDictEdit* pWordED;
- FixedText* pReplaceFT;
- SvxDictEdit* pReplaceED;
- SvTabListBox* pWordsLB;
- PushButton* pNewReplacePB;
- PushButton* pDeletePB;
+ VclPtr<SvxDictEdit> pWordED;
+ VclPtr<FixedText> pReplaceFT;
+ VclPtr<SvxDictEdit> pReplaceED;
+ VclPtr<SvTabListBox> pWordsLB;
+ VclPtr<PushButton> pNewReplacePB;
+ VclPtr<PushButton> pDeletePB;
OUString sModify;
OUString sNew;
@@ -153,6 +155,7 @@ public:
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XSpellChecker1> &xSpl );
virtual ~SvxEditDictionaryDialog();
+ virtual void dispose() SAL_OVERRIDE;
sal_uInt16 GetSelectedDict() {return pAllDictsLB->GetSelectEntryPos();}
};
diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index 8529393a14a0..f99e3bb7ba46 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -52,15 +52,15 @@ class SvxLinguData_Impl;
class SvxEditModulesDlg : public ModalDialog
{
- SvxLanguageBox* m_pLanguageLB;
+ VclPtr<SvxLanguageBox> m_pLanguageLB;
- SvxCheckListBox* m_pModulesCLB;
- PushButton* m_pPrioUpPB;
- PushButton* m_pPrioDownPB;
- PushButton* m_pBackPB;
- FixedHyperlink* m_pMoreDictsLink;
+ VclPtr<SvxCheckListBox> m_pModulesCLB;
+ VclPtr<PushButton> m_pPrioUpPB;
+ VclPtr<PushButton> m_pPrioDownPB;
+ VclPtr<PushButton> m_pBackPB;
+ VclPtr<FixedHyperlink> m_pMoreDictsLink;
- CloseButton* m_pClosePB;
+ VclPtr<CloseButton> m_pClosePB;
OUString sSpell;
OUString sHyph;
@@ -86,6 +86,7 @@ class SvxEditModulesDlg : public ModalDialog
public:
SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rData);
virtual ~SvxEditModulesDlg();
+ virtual void dispose() SAL_OVERRIDE;
};
// class SvxLinguTabPage -------------------------------------------------
@@ -93,17 +94,17 @@ public:
class SvxLinguTabPage : public SfxTabPage
{
private:
- FixedText* m_pLinguModulesFT;
- SvxCheckListBox* m_pLinguModulesCLB;
- PushButton* m_pLinguModulesEditPB;
- FixedText* m_pLinguDicsFT;
- SvxCheckListBox* m_pLinguDicsCLB;
- PushButton* m_pLinguDicsNewPB;
- PushButton* m_pLinguDicsEditPB;
- PushButton* m_pLinguDicsDelPB;
- SvxCheckListBox* m_pLinguOptionsCLB;
- PushButton* m_pLinguOptionsEditPB;
- FixedHyperlink* m_pMoreDictsLink;
+ VclPtr<FixedText> m_pLinguModulesFT;
+ VclPtr<SvxCheckListBox> m_pLinguModulesCLB;
+ VclPtr<PushButton> m_pLinguModulesEditPB;
+ VclPtr<FixedText> m_pLinguDicsFT;
+ VclPtr<SvxCheckListBox> m_pLinguDicsCLB;
+ VclPtr<PushButton> m_pLinguDicsNewPB;
+ VclPtr<PushButton> m_pLinguDicsEditPB;
+ VclPtr<PushButton> m_pLinguDicsDelPB;
+ VclPtr<SvxCheckListBox> m_pLinguOptionsCLB;
+ VclPtr<PushButton> m_pLinguOptionsEditPB;
+ VclPtr<FixedHyperlink> m_pMoreDictsLink;
OUString sCapitalWords;
OUString sWordsWithDigits;
@@ -147,7 +148,8 @@ private:
public:
virtual ~SvxLinguTabPage();
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/inc/optpath.hxx b/cui/source/inc/optpath.hxx
index 8db65294ce6d..df078cec88b8 100644
--- a/cui/source/inc/optpath.hxx
+++ b/cui/source/inc/optpath.hxx
@@ -42,11 +42,11 @@ class SvxPathTabPage;
class SvxPathTabPage : public SfxTabPage
{
private:
- SvSimpleTableContainer* m_pPathCtrl;
- PushButton* m_pStandardBtn;
- PushButton* m_pPathBtn;
+ VclPtr<SvSimpleTableContainer> m_pPathCtrl;
+ VclPtr<PushButton> m_pStandardBtn;
+ VclPtr<PushButton> m_pPathBtn;
- ::svx::OptHeaderTabListBox* pPathBox;
+ VclPtr<::svx::OptHeaderTabListBox> pPathBox;
OptPath_Impl* pImpl;
::com::sun::star::uno::Reference< ::svt::DialogClosedListener > xDialogListener;
@@ -71,8 +71,9 @@ private:
public:
SvxPathTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxPathTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx
index 90dadaea13e8..f68bf339bab7 100644
--- a/cui/source/inc/page.hxx
+++ b/cui/source/inc/page.hxx
@@ -75,53 +75,53 @@ class SvxPageDescPage : public SfxTabPage
static const sal_uInt16 pRanges[];
private:
// paper format
- ListBox* m_pPaperSizeBox;
+ VclPtr<ListBox> m_pPaperSizeBox;
- MetricField* m_pPaperWidthEdit;
- MetricField* m_pPaperHeightEdit;
+ VclPtr<MetricField> m_pPaperWidthEdit;
+ VclPtr<MetricField> m_pPaperHeightEdit;
- FixedText* m_pOrientationFT;
- RadioButton* m_pPortraitBtn;
- RadioButton* m_pLandscapeBtn;
+ VclPtr<FixedText> m_pOrientationFT;
+ VclPtr<RadioButton> m_pPortraitBtn;
+ VclPtr<RadioButton> m_pLandscapeBtn;
- SvxPageWindow* m_pBspWin;
+ VclPtr<SvxPageWindow> m_pBspWin;
- FixedText* m_pTextFlowLbl;
- svx::FrameDirectionListBox* m_pTextFlowBox;
+ VclPtr<FixedText> m_pTextFlowLbl;
+ VclPtr<svx::FrameDirectionListBox> m_pTextFlowBox;
- ListBox* m_pPaperTrayBox;
+ VclPtr<ListBox> m_pPaperTrayBox;
// Margins
- FixedText* m_pLeftMarginLbl;
- MetricField* m_pLeftMarginEdit;
- FixedText* m_pRightMarginLbl;
- MetricField* m_pRightMarginEdit;
- MetricField* m_pTopMarginEdit;
- MetricField* m_pBottomMarginEdit;
+ VclPtr<FixedText> m_pLeftMarginLbl;
+ VclPtr<MetricField> m_pLeftMarginEdit;
+ VclPtr<FixedText> m_pRightMarginLbl;
+ VclPtr<MetricField> m_pRightMarginEdit;
+ VclPtr<MetricField> m_pTopMarginEdit;
+ VclPtr<MetricField> m_pBottomMarginEdit;
// layout settings
- FixedText* m_pPageText;
- ListBox* m_pLayoutBox;
- ListBox* m_pNumberFormatBox;
+ VclPtr<FixedText> m_pPageText;
+ VclPtr<ListBox> m_pLayoutBox;
+ VclPtr<ListBox> m_pNumberFormatBox;
//Extras Calc
- FixedText* m_pTblAlignFT;
- CheckBox* m_pHorzBox;
- CheckBox* m_pVertBox;
+ VclPtr<FixedText> m_pTblAlignFT;
+ VclPtr<CheckBox> m_pHorzBox;
+ VclPtr<CheckBox> m_pVertBox;
// Impress and Draw
- CheckBox* m_pAdaptBox;
+ VclPtr<CheckBox> m_pAdaptBox;
//Register Writer
- CheckBox* m_pRegisterCB;
- FixedText* m_pRegisterFT;
- ListBox* m_pRegisterLB;
+ VclPtr<CheckBox> m_pRegisterCB;
+ VclPtr<FixedText> m_pRegisterFT;
+ VclPtr<ListBox> m_pRegisterLB;
OUString sStandardRegister;
- FixedText* m_pInsideLbl;
- FixedText* m_pOutsideLbl;
- FixedText* m_pPrintRangeQueryText;
+ VclPtr<FixedText> m_pInsideLbl;
+ VclPtr<FixedText> m_pOutsideLbl;
+ VclPtr<FixedText> m_pPrintRangeQueryText;
long nFirstLeftMargin;
long nFirstRightMargin;
@@ -140,7 +140,7 @@ private:
//UUUU SvxPage_Impl* pImpl;
MarginPosition m_nPos;
- Printer* mpDefPrinter;
+ VclPtr<Printer> mpDefPrinter;
bool mbDelPrinter : 1;
@@ -188,7 +188,7 @@ protected:
virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
// returns the range of the Which values
static const sal_uInt16* GetRanges() { return pRanges; }
@@ -197,6 +197,7 @@ public:
virtual void FillUserData() SAL_OVERRIDE;
virtual ~SvxPageDescPage();
+ virtual void dispose() SAL_OVERRIDE;
void SetMode( SvxModeType eMType ) { eMode = eMType; }
void SetPaperFormatRanges( Paper eStart, Paper eEnd )
diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx
index e0ca89f29da9..80b2536aed21 100644
--- a/cui/source/inc/paragrph.hxx
+++ b/cui/source/inc/paragrph.hxx
@@ -52,32 +52,32 @@ private:
SvxStdParagraphTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
// indention
- SvxRelativeField* m_pLeftIndent;
+ VclPtr<SvxRelativeField> m_pLeftIndent;
- FixedText* m_pRightLabel;
- SvxRelativeField* m_pRightIndent;
+ VclPtr<FixedText> m_pRightLabel;
+ VclPtr<SvxRelativeField> m_pRightIndent;
- FixedText* m_pFLineLabel;
- SvxRelativeField* m_pFLineIndent;
- CheckBox* m_pAutoCB;
+ VclPtr<FixedText> m_pFLineLabel;
+ VclPtr<SvxRelativeField> m_pFLineIndent;
+ VclPtr<CheckBox> m_pAutoCB;
// distance
- SvxRelativeField* m_pTopDist;
- SvxRelativeField* m_pBottomDist;
- CheckBox* m_pContextualCB;
+ VclPtr<SvxRelativeField> m_pTopDist;
+ VclPtr<SvxRelativeField> m_pBottomDist;
+ VclPtr<CheckBox> m_pContextualCB;
// line spacing
- ListBox* m_pLineDist;
- FixedText* m_pLineDistAtLabel;
- MetricField* m_pLineDistAtPercentBox;
- MetricField* m_pLineDistAtMetricBox;
- FixedText* m_pAbsDist;
+ VclPtr<ListBox> m_pLineDist;
+ VclPtr<FixedText> m_pLineDistAtLabel;
+ VclPtr<MetricField> m_pLineDistAtPercentBox;
+ VclPtr<MetricField> m_pLineDistAtMetricBox;
+ VclPtr<FixedText> m_pAbsDist;
OUString sAbsDist;
- SvxParaPrevWindow* m_pExampleWin;
+ VclPtr<SvxParaPrevWindow> m_pExampleWin;
// only writer
- VclFrame* m_pRegisterFL;
- CheckBox* m_pRegisterCB;
+ VclPtr<VclFrame> m_pRegisterFL;
+ VclPtr<CheckBox> m_pRegisterCB;
long nAbst;
long nWidth;
@@ -98,9 +98,12 @@ protected:
public:
+ virtual ~SvxStdParagraphTabPage();
+ virtual void dispose() SAL_OVERRIDE;
+
DECL_LINK(ELRLoseFocusHdl, void *);
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pStdRanges; }
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -115,8 +118,6 @@ public:
void EnableAbsLineDist(long nMinTwip);
void EnableNegativeMode();
virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
-
- virtual ~SvxStdParagraphTabPage();
};
// class SvxParaAlignTabPage ------------------------------------------------
@@ -127,27 +128,27 @@ class SvxParaAlignTabPage : public SfxTabPage
static const sal_uInt16 pAlignRanges[];
// alignment
- RadioButton* m_pLeft;
- RadioButton* m_pRight;
- RadioButton* m_pCenter;
- RadioButton* m_pJustify;
- FixedText* m_pLeftBottom;
- FixedText* m_pRightTop;
+ VclPtr<RadioButton> m_pLeft;
+ VclPtr<RadioButton> m_pRight;
+ VclPtr<RadioButton> m_pCenter;
+ VclPtr<RadioButton> m_pJustify;
+ VclPtr<FixedText> m_pLeftBottom;
+ VclPtr<FixedText> m_pRightTop;
- FixedText* m_pLastLineFT;
- ListBox* m_pLastLineLB;
- CheckBox* m_pExpandCB;
+ VclPtr<FixedText> m_pLastLineFT;
+ VclPtr<ListBox> m_pLastLineLB;
+ VclPtr<CheckBox> m_pExpandCB;
- CheckBox* m_pSnapToGridCB;
+ VclPtr<CheckBox> m_pSnapToGridCB;
//preview
- SvxParaPrevWindow* m_pExampleWin;
+ VclPtr<SvxParaPrevWindow> m_pExampleWin;
//vertical alignment
- VclFrame* m_pVertAlignFL;
- ListBox* m_pVertAlignLB;
+ VclPtr<VclFrame> m_pVertAlignFL;
+ VclPtr<ListBox> m_pVertAlignLB;
- VclFrame* m_pPropertiesFL;
- svx::FrameDirectionListBox* m_pTextDirectionLB;
+ VclPtr<VclFrame> m_pPropertiesFL;
+ VclPtr<svx::FrameDirectionListBox> m_pTextDirectionLB;
DECL_LINK(AlignHdl_Impl, void *);
DECL_LINK(LastLineHdl_Impl, void *);
@@ -156,13 +157,15 @@ class SvxParaAlignTabPage : public SfxTabPage
void UpdateExample_Impl( bool bAll = false );
SvxParaAlignTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxParaAlignTabPage();
protected:
virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ virtual ~SvxParaAlignTabPage();
+ virtual void dispose() SAL_OVERRIDE;
+
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pAlignRanges; }
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -192,9 +195,10 @@ class SvxExtParagraphTabPage: public SfxTabPage
static const sal_uInt16 pExtRanges[];
public:
- virtual ~SvxExtParagraphTabPage();
+ virtual ~SvxExtParagraphTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pExtRanges; }
@@ -210,37 +214,37 @@ private:
SvxExtParagraphTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
// hyphenation
- TriStateBox* m_pHyphenBox;
- FixedText* m_pBeforeText;
- NumericField* m_pExtHyphenBeforeBox;
- FixedText* m_pAfterText;
- NumericField* m_pExtHyphenAfterBox;
- FixedText* m_pMaxHyphenLabel;
- NumericField* m_pMaxHyphenEdit;
+ VclPtr<TriStateBox> m_pHyphenBox;
+ VclPtr<FixedText> m_pBeforeText;
+ VclPtr<NumericField> m_pExtHyphenBeforeBox;
+ VclPtr<FixedText> m_pAfterText;
+ VclPtr<NumericField> m_pExtHyphenAfterBox;
+ VclPtr<FixedText> m_pMaxHyphenLabel;
+ VclPtr<NumericField> m_pMaxHyphenEdit;
// pagebreak
- TriStateBox* m_pPageBreakBox;
- FixedText* m_pBreakTypeFT;
- ListBox* m_pBreakTypeLB;
- FixedText* m_pBreakPositionFT;
- ListBox* m_pBreakPositionLB;
- TriStateBox* m_pApplyCollBtn;
- ListBox* m_pApplyCollBox;
- FixedText* m_pPagenumText;
- NumericField* m_pPagenumEdit;
+ VclPtr<TriStateBox> m_pPageBreakBox;
+ VclPtr<FixedText> m_pBreakTypeFT;
+ VclPtr<ListBox> m_pBreakTypeLB;
+ VclPtr<FixedText> m_pBreakPositionFT;
+ VclPtr<ListBox> m_pBreakPositionLB;
+ VclPtr<TriStateBox> m_pApplyCollBtn;
+ VclPtr<ListBox> m_pApplyCollBox;
+ VclPtr<FixedText> m_pPagenumText;
+ VclPtr<NumericField> m_pPagenumEdit;
// paragraph division
- TriStateBox* m_pKeepTogetherBox;
- TriStateBox* m_pKeepParaBox;
+ VclPtr<TriStateBox> m_pKeepTogetherBox;
+ VclPtr<TriStateBox> m_pKeepParaBox;
// orphan/widow
- TriStateBox* m_pOrphanBox;
- NumericField* m_pOrphanRowNo;
- FixedText* m_pOrphanRowLabel;
+ VclPtr<TriStateBox> m_pOrphanBox;
+ VclPtr<NumericField> m_pOrphanRowNo;
+ VclPtr<FixedText> m_pOrphanRowLabel;
- TriStateBox* m_pWidowBox;
- NumericField* m_pWidowRowNo;
- FixedText* m_pWidowRowLabel;
+ VclPtr<TriStateBox> m_pWidowBox;
+ VclPtr<NumericField> m_pWidowRowNo;
+ VclPtr<FixedText> m_pWidowRowLabel;
bool bPageBreak;
bool bHtmlMode;
@@ -262,9 +266,9 @@ private:
class SvxAsianTabPage : public SfxTabPage
{
- CheckBox* m_pForbiddenRulesCB;
- CheckBox* m_pHangingPunctCB;
- CheckBox* m_pScriptSpaceCB;
+ VclPtr<CheckBox> m_pForbiddenRulesCB;
+ VclPtr<CheckBox> m_pHangingPunctCB;
+ VclPtr<CheckBox> m_pScriptSpaceCB;
SvxAsianTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
@@ -272,9 +276,9 @@ class SvxAsianTabPage : public SfxTabPage
public:
virtual ~SvxAsianTabPage();
+ virtual void dispose() SAL_OVERRIDE;
-
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
diff --git a/cui/source/inc/passwdomdlg.hxx b/cui/source/inc/passwdomdlg.hxx
index 9dd7aca1e11b..59fd9e479a78 100644
--- a/cui/source/inc/passwdomdlg.hxx
+++ b/cui/source/inc/passwdomdlg.hxx
@@ -40,6 +40,7 @@ public:
sal_uInt16 nMaxPasswdLen /* 0 -> no max len enforced */,
bool bIsPasswordToModify );
virtual ~PasswordToOpenModifyDialog();
+ virtual void dispose() SAL_OVERRIDE;
// AbstractPasswordToOpenModifyDialog
OUString GetPasswordToOpen() const;
diff --git a/cui/source/inc/pastedlg.hxx b/cui/source/inc/pastedlg.hxx
index 52332ac398ed..c634dc715a6b 100644
--- a/cui/source/inc/pastedlg.hxx
+++ b/cui/source/inc/pastedlg.hxx
@@ -39,9 +39,9 @@ class TransferableDataHelper;
class SvPasteObjectDialog : public ModalDialog
{
- FixedText* m_pFtObjectSource;
- ListBox* m_pLbInsertList;
- OKButton* m_pOKButton;
+ VclPtr<FixedText> m_pFtObjectSource;
+ VclPtr<ListBox> m_pLbInsertList;
+ VclPtr<OKButton> m_pOKButton;
::std::map< SotClipboardFormatId, OUString > aSupplementMap;
SvGlobalName aObjClassName;
OUString aObjName;
@@ -55,7 +55,8 @@ class SvPasteObjectDialog : public ModalDialog
public:
SvPasteObjectDialog( vcl::Window* pParent );
- virtual ~SvPasteObjectDialog();
+ virtual ~SvPasteObjectDialog();
+ virtual void dispose() SAL_OVERRIDE;
void Insert( SotClipboardFormatId nFormat, const OUString & rFormatName );
void SetObjName( const SvGlobalName & rClass, const OUString & rObjName );
diff --git a/cui/source/inc/postdlg.hxx b/cui/source/inc/postdlg.hxx
index 624649689e6a..170e00692379 100644
--- a/cui/source/inc/postdlg.hxx
+++ b/cui/source/inc/postdlg.hxx
@@ -46,6 +46,7 @@ public:
SvxPostItDialog(vcl::Window* pParent, const SfxItemSet& rCoreSet,
bool bPrevNext = false);
virtual ~SvxPostItDialog();
+ virtual void dispose() SAL_OVERRIDE;
static const sal_uInt16* GetRanges();
const SfxItemSet* GetOutputItemSet() const { return pOutSet; }
@@ -87,17 +88,17 @@ public:
}
private:
- FixedText* m_pLastEditFT;
+ VclPtr<FixedText> m_pLastEditFT;
- VclMultiLineEdit* m_pEditED;
+ VclPtr<VclMultiLineEdit> m_pEditED;
- VclContainer* m_pInsertAuthor;
- PushButton* m_pAuthorBtn;
+ VclPtr<VclContainer> m_pInsertAuthor;
+ VclPtr<PushButton> m_pAuthorBtn;
- OKButton* m_pOKBtn;
+ VclPtr<OKButton> m_pOKBtn;
- PushButton* m_pPrevBtn;
- PushButton* m_pNextBtn;
+ VclPtr<PushButton> m_pPrevBtn;
+ VclPtr<PushButton> m_pNextBtn;
const SfxItemSet& rSet;
SfxItemSet* pOutSet;
diff --git a/cui/source/inc/radiobtnbox.hxx b/cui/source/inc/radiobtnbox.hxx
index 1688bcd43905..7c31f340be54 100644
--- a/cui/source/inc/radiobtnbox.hxx
+++ b/cui/source/inc/radiobtnbox.hxx
@@ -39,7 +39,6 @@ protected:
public:
SvxRadioButtonListBox(SvSimpleTableContainer& rParent, WinBits nBits);
- virtual ~SvxRadioButtonListBox();
void HandleEntryChecked( SvTreeListEntry* _pEntry );
diff --git a/cui/source/inc/scriptdlg.hxx b/cui/source/inc/scriptdlg.hxx
index 8778123ed582..d3847dc6de62 100644
--- a/cui/source/inc/scriptdlg.hxx
+++ b/cui/source/inc/scriptdlg.hxx
@@ -77,6 +77,7 @@ public:
::com::sun::star::uno::Reference< com::sun::star::frame::XModel>& model );
SFTreeListBox(vcl::Window* pParent);
virtual ~SFTreeListBox();
+ virtual void dispose() SAL_OVERRIDE;
SvTreeListEntry * insertEntry(OUString const & rText, sal_uInt16 nBitmap,
SvTreeListEntry * pParent,
@@ -94,9 +95,11 @@ public:
class CuiInputDialog : public ModalDialog
{
private:
- Edit* m_pEdit;
+ VclPtr<Edit> m_pEdit;
public:
CuiInputDialog(vcl::Window * pParent, sal_uInt16 nMode);
+ virtual ~CuiInputDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetObjectName() const { return m_pEdit->GetText(); }
void SetObjectName(const OUString& rName)
@@ -131,14 +134,14 @@ public:
class SvxScriptOrgDialog : public SfxModalDialog
{
protected:
- SFTreeListBox* m_pScriptsBox;
+ VclPtr<SFTreeListBox> m_pScriptsBox;
- PushButton* m_pRunButton;
- CloseButton* m_pCloseButton;
- PushButton* m_pCreateButton;
- PushButton* m_pEditButton;
- PushButton* m_pRenameButton;
- PushButton* m_pDelButton;
+ VclPtr<PushButton> m_pRunButton;
+ VclPtr<CloseButton> m_pCloseButton;
+ VclPtr<PushButton> m_pCreateButton;
+ VclPtr<PushButton> m_pEditButton;
+ VclPtr<PushButton> m_pRenameButton;
+ VclPtr<PushButton> m_pDelButton;
OUString m_sLanguage;
static Selection_hash m_lastSelection;
@@ -175,6 +178,7 @@ public:
// to specify the language or provider
SvxScriptOrgDialog( vcl::Window* pParent, const OUString& language );
virtual ~SvxScriptOrgDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
diff --git a/cui/source/inc/selector.hxx b/cui/source/inc/selector.hxx
index b22b85e30f30..c1ac1e3f6b62 100644
--- a/cui/source/inc/selector.hxx
+++ b/cui/source/inc/selector.hxx
@@ -102,6 +102,7 @@ friend class SvxConfigGroupListBox;
public:
SvxConfigFunctionListBox(vcl::Window* pParent, WinBits nStyle);
virtual ~SvxConfigFunctionListBox();
+ virtual void dispose() SAL_OVERRIDE;
void ClearAll();
OUString GetHelpText( SvTreeListEntry *pEntry );
using Window::GetHelpText;
@@ -122,7 +123,7 @@ class SvxConfigGroupListBox : public SvTreeListBox
SvxGroupInfoArr_Impl aArr;
bool m_bShowSlots;
- SvxConfigFunctionListBox* pFunctionListBox;
+ VclPtr<SvxConfigFunctionListBox> pFunctionListBox;
ImageProvider* m_pImageProvider;
::com::sun::star::uno::Reference
@@ -162,6 +163,7 @@ protected:
public:
SvxConfigGroupListBox(vcl::Window* pParent, WinBits nStyle);
virtual ~SvxConfigGroupListBox();
+ virtual void dispose() SAL_OVERRIDE;
void Init(bool bShowSlots, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame >& xFrame);
@@ -179,12 +181,12 @@ public:
class SvxScriptSelectorDialog : public ModelessDialog
{
- FixedText* m_pDialogDescription;
- SvxConfigGroupListBox* m_pCategories;
- SvxConfigFunctionListBox* m_pCommands;
- PushButton* m_pOKButton;
- PushButton* m_pCancelButton;
- VclMultiLineEdit* m_pDescriptionText;
+ VclPtr<FixedText> m_pDialogDescription;
+ VclPtr<SvxConfigGroupListBox> m_pCategories;
+ VclPtr<SvxConfigFunctionListBox> m_pCommands;
+ VclPtr<PushButton> m_pOKButton;
+ VclPtr<PushButton> m_pCancelButton;
+ VclPtr<VclMultiLineEdit> m_pDescriptionText;
OUString m_sDefaultDesc;
bool m_bShowSlots;
Link m_aAddHdl;
@@ -203,8 +205,8 @@ public:
const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame >& xFrame = 0
);
-
- virtual ~SvxScriptSelectorDialog ( );
+ virtual ~SvxScriptSelectorDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetAddHdl( const Link& rLink ) { m_aAddHdl = rLink; }
const Link& GetAddHdl() const { return m_aAddHdl; }
diff --git a/cui/source/inc/showcols.hxx b/cui/source/inc/showcols.hxx
index dceddb7e3a00..d7494d72896b 100644
--- a/cui/source/inc/showcols.hxx
+++ b/cui/source/inc/showcols.hxx
@@ -35,13 +35,15 @@
class FmShowColsDialog : public ModalDialog
{
- ListBox* m_pList;
- OKButton* m_pOK;
+ VclPtr<ListBox> m_pList;
+ VclPtr<OKButton> m_pOK;
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > m_xColumns;
public:
FmShowColsDialog(vcl::Window* pParent);
+ virtual ~FmShowColsDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetColumns(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>& xCols);
diff --git a/cui/source/inc/splitcelldlg.hxx b/cui/source/inc/splitcelldlg.hxx
index 212559f32968..9d727d1583f1 100644
--- a/cui/source/inc/splitcelldlg.hxx
+++ b/cui/source/inc/splitcelldlg.hxx
@@ -26,17 +26,16 @@
#include <svx/stddlg.hxx>
#include <svx/svxdlg.hxx>
-class SvxSplitTableDlg : public SvxAbstractSplittTableDialog, public SvxStandardDialog
+class SvxSplitTableDlg : public SvxAbstractSplittTableDialog
{
- NumericField* m_pCountEdit;
- RadioButton* m_pHorzBox;
- RadioButton* m_pVertBox;
- CheckBox* m_pPropCB;
+ VclPtr<SvxStandardDialog> m_pDialog;
+ VclPtr<NumericField> m_pCountEdit;
+ VclPtr<RadioButton> m_pHorzBox;
+ VclPtr<RadioButton> m_pVertBox;
+ VclPtr<CheckBox> m_pPropCB;
long mnMaxVertical;
long mnMaxHorizontal;
-protected:
- virtual void Apply() SAL_OVERRIDE;
public:
SvxSplitTableDlg(vcl::Window *pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal );
diff --git a/cui/source/inc/srchxtra.hxx b/cui/source/inc/srchxtra.hxx
index 0965484c9c45..f1c6aefde1a9 100644
--- a/cui/source/inc/srchxtra.hxx
+++ b/cui/source/inc/srchxtra.hxx
@@ -31,6 +31,7 @@ class SvxSearchFormatDialog : public SfxTabDialog
public:
SvxSearchFormatDialog( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxSearchFormatDialog();
+ virtual void dispose() SAL_OVERRIDE;
protected:
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) SAL_OVERRIDE;
@@ -50,10 +51,12 @@ class SvxSearchAttributeDialog : public ModalDialog
public:
SvxSearchAttributeDialog( vcl::Window* pParent, SearchAttrItemList& rLst,
const sal_uInt16* pWhRanges );
+ virtual ~SvxSearchAttributeDialog();
+ virtual void dispose() SAL_OVERRIDE;
private:
- SvxCheckListBox* m_pAttrLB;
- OKButton* m_pOKBtn;
+ VclPtr<SvxCheckListBox> m_pAttrLB;
+ VclPtr<OKButton> m_pOKBtn;
SearchAttrItemList& rList;
@@ -65,10 +68,10 @@ private:
class SvxSearchSimilarityDialog : public ModalDialog
{
private:
- NumericField* m_pOtherFld;
- NumericField* m_pLongerFld;
- NumericField* m_pShorterFld;
- CheckBox* m_pRelaxBox;
+ VclPtr<NumericField> m_pOtherFld;
+ VclPtr<NumericField> m_pLongerFld;
+ VclPtr<NumericField> m_pShorterFld;
+ VclPtr<CheckBox> m_pRelaxBox;
public:
SvxSearchSimilarityDialog( vcl::Window* pParent,
@@ -76,6 +79,8 @@ public:
sal_uInt16 nOther,
sal_uInt16 nShorter,
sal_uInt16 nLonger );
+ virtual ~SvxSearchSimilarityDialog();
+ virtual void dispose() SAL_OVERRIDE;
sal_uInt16 GetOther() { return (sal_uInt16)m_pOtherFld->GetValue(); }
sal_uInt16 GetShorter() { return (sal_uInt16)m_pShorterFld->GetValue(); }
diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx
index d293468214e7..e1db4048acc7 100644
--- a/cui/source/inc/swpossizetabpage.hxx
+++ b/cui/source/inc/swpossizetabpage.hxx
@@ -34,39 +34,39 @@ class SvxSwPosSizeTabPage : public SfxTabPage
{
using TabPage::DeactivatePage;
- MetricField* m_pWidthMF;
- MetricField* m_pHeightMF;
- CheckBox* m_pKeepRatioCB;
+ VclPtr<MetricField> m_pWidthMF;
+ VclPtr<MetricField> m_pHeightMF;
+ VclPtr<CheckBox> m_pKeepRatioCB;
- RadioButton* m_pToPageRB;
- RadioButton* m_pToParaRB;
- RadioButton* m_pToCharRB;
- RadioButton* m_pAsCharRB;
- RadioButton* m_pToFrameRB;
+ VclPtr<RadioButton> m_pToPageRB;
+ VclPtr<RadioButton> m_pToParaRB;
+ VclPtr<RadioButton> m_pToCharRB;
+ VclPtr<RadioButton> m_pAsCharRB;
+ VclPtr<RadioButton> m_pToFrameRB;
- TriStateBox* m_pPositionCB;
- TriStateBox* m_pSizeCB;
+ VclPtr<TriStateBox> m_pPositionCB;
+ VclPtr<TriStateBox> m_pSizeCB;
- VclContainer* m_pPosFrame;
- FixedText* m_pHoriFT;
- ListBox* m_pHoriLB;
- FixedText* m_pHoriByFT;
- MetricField* m_pHoriByMF;
- FixedText* m_pHoriToFT;
- ListBox* m_pHoriToLB;
+ VclPtr<VclContainer> m_pPosFrame;
+ VclPtr<FixedText> m_pHoriFT;
+ VclPtr<ListBox> m_pHoriLB;
+ VclPtr<FixedText> m_pHoriByFT;
+ VclPtr<MetricField> m_pHoriByMF;
+ VclPtr<FixedText> m_pHoriToFT;
+ VclPtr<ListBox> m_pHoriToLB;
- CheckBox* m_pHoriMirrorCB;
+ VclPtr<CheckBox> m_pHoriMirrorCB;
- FixedText* m_pVertFT;
- ListBox* m_pVertLB;
- FixedText* m_pVertByFT;
- MetricField* m_pVertByMF;
- FixedText* m_pVertToFT;
- ListBox* m_pVertToLB;
+ VclPtr<FixedText> m_pVertFT;
+ VclPtr<ListBox> m_pVertLB;
+ VclPtr<FixedText> m_pVertByFT;
+ VclPtr<MetricField> m_pVertByMF;
+ VclPtr<FixedText> m_pVertToFT;
+ VclPtr<ListBox> m_pVertToLB;
- CheckBox* m_pFollowCB;
+ VclPtr<CheckBox> m_pFollowCB;
- SvxSwFrameExample* m_pExampleWN;
+ VclPtr<SvxSwFrameExample> m_pExampleWN;
Link m_aValidateLink;
@@ -124,8 +124,9 @@ class SvxSwPosSizeTabPage : public SfxTabPage
public:
SvxSwPosSizeTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxSwPosSizeTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges();
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
diff --git a/cui/source/inc/tabstpge.hxx b/cui/source/inc/tabstpge.hxx
index 39c761a5b15e..05903afd03a4 100644
--- a/cui/source/inc/tabstpge.hxx
+++ b/cui/source/inc/tabstpge.hxx
@@ -50,8 +50,8 @@ class SvxTabulatorTabPage : public SfxTabPage
public:
virtual ~SvxTabulatorTabPage();
-
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pRanges; }
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -66,34 +66,34 @@ private:
SvxTabulatorTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
// tabulators and positions
- MetricBox* m_pTabBox;
+ VclPtr<MetricBox> m_pTabBox;
// TabType
- RadioButton* m_pLeftTab;
- RadioButton* m_pRightTab;
- RadioButton* m_pCenterTab;
- RadioButton* m_pDezTab;
-
- TabWin_Impl* m_pLeftWin;
- TabWin_Impl* m_pRightWin;
- TabWin_Impl* m_pCenterWin;
- TabWin_Impl* m_pDezWin;
-
- FixedText* m_pDezCharLabel;
- Edit* m_pDezChar;
-
- RadioButton* m_pNoFillChar;
- RadioButton* m_pFillPoints;
- RadioButton* m_pFillDashLine ;
- RadioButton* m_pFillSolidLine;
- RadioButton* m_pFillSpecial;
- Edit* m_pFillChar;
-
- PushButton* m_pNewBtn;
- PushButton* m_pDelAllBtn;
- PushButton* m_pDelBtn;
-
- VclContainer* m_pTypeFrame;
- VclContainer* m_pFillFrame;
+ VclPtr<RadioButton> m_pLeftTab;
+ VclPtr<RadioButton> m_pRightTab;
+ VclPtr<RadioButton> m_pCenterTab;
+ VclPtr<RadioButton> m_pDezTab;
+
+ VclPtr<TabWin_Impl> m_pLeftWin;
+ VclPtr<TabWin_Impl> m_pRightWin;
+ VclPtr<TabWin_Impl> m_pCenterWin;
+ VclPtr<TabWin_Impl> m_pDezWin;
+
+ VclPtr<FixedText> m_pDezCharLabel;
+ VclPtr<Edit> m_pDezChar;
+
+ VclPtr<RadioButton> m_pNoFillChar;
+ VclPtr<RadioButton> m_pFillPoints;
+ VclPtr<RadioButton> m_pFillDashLine ;
+ VclPtr<RadioButton> m_pFillSolidLine;
+ VclPtr<RadioButton> m_pFillSpecial;
+ VclPtr<Edit> m_pFillChar;
+
+ VclPtr<PushButton> m_pNewBtn;
+ VclPtr<PushButton> m_pDelAllBtn;
+ VclPtr<PushButton> m_pDelBtn;
+
+ VclPtr<VclContainer> m_pTypeFrame;
+ VclPtr<VclContainer> m_pFillFrame;
// local variables, internal functions
SvxTabStop aAktTab;
diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx
index 2f1031d3d572..875b4d2a087f 100644
--- a/cui/source/inc/textanim.hxx
+++ b/cui/source/inc/textanim.hxx
@@ -37,27 +37,28 @@ class SdrView;
class SvxTextAnimationPage : public SfxTabPage
{
private:
- static const sal_uInt16 pRanges[];
- ListBox* m_pLbEffect;
- VclBox* m_pBoxDirection;
- PushButton* m_pBtnUp;
- PushButton* m_pBtnLeft;
- PushButton* m_pBtnRight;
- PushButton* m_pBtnDown;
+ static const sal_uInt16 pRanges[];
- VclFrame* m_pFlProperties;
- TriStateBox* m_pTsbStartInside;
- TriStateBox* m_pTsbStopInside;
+ VclPtr<ListBox> m_pLbEffect;
+ VclPtr<VclBox> m_pBoxDirection;
+ VclPtr<PushButton> m_pBtnUp;
+ VclPtr<PushButton> m_pBtnLeft;
+ VclPtr<PushButton> m_pBtnRight;
+ VclPtr<PushButton> m_pBtnDown;
- VclBox* m_pBoxCount;
- TriStateBox* m_pTsbEndless;
- NumericField* m_pNumFldCount;
+ VclPtr<VclFrame> m_pFlProperties;
+ VclPtr<TriStateBox> m_pTsbStartInside;
+ VclPtr<TriStateBox> m_pTsbStopInside;
- TriStateBox* m_pTsbPixel;
- MetricField* m_pMtrFldAmount;
+ VclPtr<VclBox> m_pBoxCount;
+ VclPtr<TriStateBox> m_pTsbEndless;
+ VclPtr<NumericField> m_pNumFldCount;
- TriStateBox* m_pTsbAuto;
- MetricField* m_pMtrFldDelay;
+ VclPtr<TriStateBox> m_pTsbPixel;
+ VclPtr<MetricField> m_pMtrFldAmount;
+
+ VclPtr<TriStateBox> m_pTsbAuto;
+ VclPtr<MetricField> m_pMtrFldDelay;
const SfxItemSet& rOutAttrs;
SdrTextAniKind eAniKind;
@@ -76,8 +77,9 @@ private:
public:
SvxTextAnimationPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs );
virtual ~SvxTextAnimationPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -104,7 +106,6 @@ public:
SvxTextTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
const SdrView* pView );
- virtual ~SvxTextTabDialog() {};
};
diff --git a/cui/source/inc/textattr.hxx b/cui/source/inc/textattr.hxx
index 6c309a329b92..881f3fd4837c 100644
--- a/cui/source/inc/textattr.hxx
+++ b/cui/source/inc/textattr.hxx
@@ -38,22 +38,23 @@ class SvxTextAttrPage : public SvxTabPage
{
private:
static const sal_uInt16 pRanges[];
- TriStateBox* m_pTsbAutoGrowWidth;
- TriStateBox* m_pTsbAutoGrowHeight;
- TriStateBox* m_pTsbFitToSize;
- TriStateBox* m_pTsbContour;
- TriStateBox* m_pTsbWordWrapText;
- TriStateBox* m_pTsbAutoGrowSize;
-
- VclFrame* m_pFlDistance;
- MetricField* m_pMtrFldLeft;
- MetricField* m_pMtrFldRight;
- MetricField* m_pMtrFldTop;
- MetricField* m_pMtrFldBottom;
-
- VclFrame* m_pFlPosition;
- SvxRectCtl* m_pCtlPosition;
- TriStateBox* m_pTsbFullWidth;
+
+ VclPtr<TriStateBox> m_pTsbAutoGrowWidth;
+ VclPtr<TriStateBox> m_pTsbAutoGrowHeight;
+ VclPtr<TriStateBox> m_pTsbFitToSize;
+ VclPtr<TriStateBox> m_pTsbContour;
+ VclPtr<TriStateBox> m_pTsbWordWrapText;
+ VclPtr<TriStateBox> m_pTsbAutoGrowSize;
+
+ VclPtr<VclFrame> m_pFlDistance;
+ VclPtr<MetricField> m_pMtrFldLeft;
+ VclPtr<MetricField> m_pMtrFldRight;
+ VclPtr<MetricField> m_pMtrFldTop;
+ VclPtr<MetricField> m_pMtrFldBottom;
+
+ VclPtr<VclFrame> m_pFlPosition;
+ VclPtr<SvxRectCtl> m_pCtlPosition;
+ VclPtr<TriStateBox> m_pTsbFullWidth;
const SfxItemSet& rOutAttrs;
const SdrView* pView;
@@ -77,8 +78,9 @@ public:
SvxTextAttrPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs );
virtual ~SvxTextAttrPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
diff --git a/cui/source/inc/thesdlg.hxx b/cui/source/inc/thesdlg.hxx
index a2dcc8580118..661788124c3f 100644
--- a/cui/source/inc/thesdlg.hxx
+++ b/cui/source/inc/thesdlg.hxx
@@ -35,7 +35,7 @@ class SvxThesaurusDialog;
class LookUpComboBox : public ComboBox
{
Idle m_aModifyIdle;
- SvxThesaurusDialog* m_pDialog;
+ VclPtr<SvxThesaurusDialog> m_pDialog;
LookUpComboBox( const LookUpComboBox & ) SAL_DELETED_FUNCTION;
LookUpComboBox& operator = ( const LookUpComboBox & ) SAL_DELETED_FUNCTION;
@@ -43,6 +43,7 @@ class LookUpComboBox : public ComboBox
public:
LookUpComboBox(vcl::Window *pParent);
virtual ~LookUpComboBox();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( ModifyTimer_Hdl, Timer * );
@@ -72,7 +73,7 @@ public:
class ThesaurusAlternativesCtrl
: public SvxCheckListBox
{
- SvxThesaurusDialog* m_pDialog;
+ VclPtr<SvxThesaurusDialog> m_pDialog;
typedef std::map< const SvTreeListEntry *, AlternativesExtraData > UserDataMap_t;
UserDataMap_t m_aUserData;
@@ -85,7 +86,7 @@ public:
void init(SvxThesaurusDialog *pDialog);
virtual ~ThesaurusAlternativesCtrl();
-
+ virtual void dispose() SAL_OVERRIDE;
SvTreeListEntry * AddEntry( sal_Int32 nVal, const OUString &rText, bool bIsHeader );
@@ -99,7 +100,7 @@ public:
class ReplaceEdit : public Edit
{
- Button * m_pBtn;
+ VclPtr<Button> m_pBtn;
ReplaceEdit( const ReplaceEdit & ) SAL_DELETED_FUNCTION;
ReplaceEdit & operator = ( const ReplaceEdit & ) SAL_DELETED_FUNCTION;
@@ -107,6 +108,7 @@ class ReplaceEdit : public Edit
public:
ReplaceEdit(vcl::Window *pParent);
virtual ~ReplaceEdit();
+ virtual void dispose() SAL_OVERRIDE;
void init(Button *pBtn) { m_pBtn = pBtn; }
@@ -118,11 +120,11 @@ public:
class SvxThesaurusDialog : public SvxStandardDialog
{
- PushButton* m_pLeftBtn;
- LookUpComboBox* m_pWordCB;
- ThesaurusAlternativesCtrl* m_pAlternativesCT;
- ReplaceEdit* m_pReplaceEdit;
- ListBox* m_pLangLB;
+ VclPtr<PushButton> m_pLeftBtn;
+ VclPtr<LookUpComboBox> m_pWordCB;
+ VclPtr<ThesaurusAlternativesCtrl> m_pAlternativesCT;
+ VclPtr<ReplaceEdit> m_pReplaceEdit;
+ VclPtr<ListBox> m_pLangLB;
OUString m_aErrStr;
@@ -133,6 +135,9 @@ class SvxThesaurusDialog : public SvxStandardDialog
bool m_bWordFound;
public:
+ virtual ~SvxThesaurusDialog();
+ virtual void dispose() SAL_OVERRIDE;
+
bool WordFound() const { return m_bWordFound; }
OUString getErrStr() const { return m_aErrStr; }
@@ -159,7 +164,6 @@ public:
SvxThesaurusDialog( vcl::Window* pParent,
css::uno::Reference< css::linguistic2::XThesaurus > xThesaurus,
const OUString &rWord, LanguageType nLanguage );
- virtual ~SvxThesaurusDialog();
void SetWindowTitle( LanguageType nLanguage );
OUString GetWord();
diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx
index ccc70d1b349b..52489521102e 100644
--- a/cui/source/inc/transfrm.hxx
+++ b/cui/source/inc/transfrm.hxx
@@ -62,7 +62,6 @@ public:
SvxTransformTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
const SdrView* pView,
sal_uInt16 nAnchorTypes = 0);
- virtual ~SvxTransformTabDialog();
//link for the Writer to validate positions
void SetValidateFramePosLink( const Link& rLink );
@@ -82,29 +81,29 @@ class SvxPositionSizeTabPage : public SvxTabPage
private:
// position
- VclFrame* m_pFlPosition;
- MetricField* m_pMtrPosX;
- MetricField* m_pMtrPosY;
- SvxRectCtl* m_pCtlPos;
+ VclPtr<VclFrame> m_pFlPosition;
+ VclPtr<MetricField> m_pMtrPosX;
+ VclPtr<MetricField> m_pMtrPosY;
+ VclPtr<SvxRectCtl> m_pCtlPos;
// size
- VclFrame* m_pFlSize;
- FixedText* m_pFtWidth;
- MetricField* m_pMtrWidth;
- FixedText* m_pFtHeight;
- MetricField* m_pMtrHeight;
- CheckBox* m_pCbxScale;
- SvxRectCtl* m_pCtlSize;
+ VclPtr<VclFrame> m_pFlSize;
+ VclPtr<FixedText> m_pFtWidth;
+ VclPtr<MetricField> m_pMtrWidth;
+ VclPtr<FixedText> m_pFtHeight;
+ VclPtr<MetricField> m_pMtrHeight;
+ VclPtr<CheckBox> m_pCbxScale;
+ VclPtr<SvxRectCtl> m_pCtlSize;
// protect
- VclFrame* m_pFlProtect;
- TriStateBox* m_pTsbPosProtect;
- TriStateBox* m_pTsbSizeProtect;
+ VclPtr<VclFrame> m_pFlProtect;
+ VclPtr<TriStateBox> m_pTsbPosProtect;
+ VclPtr<TriStateBox> m_pTsbSizeProtect;
// adjust
- VclFrame* m_pFlAdjust;
- TriStateBox* m_pTsbAutoGrowWidth;
- TriStateBox* m_pTsbAutoGrowHeight;
+ VclPtr<VclFrame> m_pFlAdjust;
+ VclPtr<TriStateBox> m_pTsbAutoGrowWidth;
+ VclPtr<TriStateBox> m_pTsbAutoGrowHeight;
private:
const SfxItemSet& mrOutAttrs;
@@ -147,8 +146,10 @@ private:
public:
SvxPositionSizeTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxPositionSizeTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pPosSizeRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -182,14 +183,14 @@ class SvxAngleTabPage : public SvxTabPage
static const sal_uInt16 pAngleRanges[];
private:
- VclFrame* m_pFlPosition;
- MetricField* m_pMtrPosX;
- MetricField* m_pMtrPosY;
- SvxRectCtl* m_pCtlRect;
+ VclPtr<VclFrame> m_pFlPosition;
+ VclPtr<MetricField> m_pMtrPosX;
+ VclPtr<MetricField> m_pMtrPosY;
+ VclPtr<SvxRectCtl> m_pCtlRect;
- VclFrame* m_pFlAngle;
- NumericField* m_pNfAngle;
- svx::DialControl* m_pCtlAngle;
+ VclPtr<VclFrame> m_pFlAngle;
+ VclPtr<NumericField> m_pNfAngle;
+ VclPtr<svx::DialControl> m_pCtlAngle;
const SfxItemSet& rOutAttrs;
const SdrView* pView;
@@ -203,8 +204,10 @@ private:
public:
SvxAngleTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxAngleTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pAngleRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -231,10 +234,10 @@ class SvxSlantTabPage : public SvxTabPage
static const sal_uInt16 pSlantRanges[];
private:
- VclFrame* m_pFlRadius;
- MetricField* m_pMtrRadius;
- VclFrame* m_pFlAngle;
- MetricField* m_pMtrAngle;
+ VclPtr<VclFrame> m_pFlRadius;
+ VclPtr<MetricField> m_pMtrRadius;
+ VclPtr<VclFrame> m_pFlAngle;
+ VclPtr<MetricField> m_pMtrAngle;
const SfxItemSet& rOutAttrs;
@@ -248,8 +251,10 @@ private:
public:
SvxSlantTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxSlantTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pSlantRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index 2fa0d064ef9c..78b63bd68761 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -146,18 +146,18 @@ private:
SvTreeListEntry* pCurrentPageEntry;
bool hasTreePendingLayout() const;
- OKButton* pOkPB;
- PushButton* pBackPB;
+ VclPtr<OKButton> pOkPB;
+ VclPtr<PushButton> pBackPB;
- SvTreeListBox* pTreeLB;
- VclBox* pTabBox;
+ VclPtr<SvTreeListBox> pTreeLB;
+ VclPtr<VclBox> pTabBox;
OUString sTitle;
OUString sNotLoadedError;
// for the ColorTabPage
SfxItemSet* pColorPageItemSet;
- SvxColorTabPage *mpColorPage;
+ VclPtr<SvxColorTabPage> mpColorPage;
bool bForgetSelection;
bool bIsFromExtensionManager;
@@ -200,6 +200,7 @@ public:
bool bActivateLastSelection = true );
OfaTreeOptionsDialog( vcl::Window* pParent, const OUString& rExtensionId );
virtual ~OfaTreeOptionsDialog();
+ virtual void dispose() SAL_OVERRIDE;
OptionsPageInfo* AddTabPage( sal_uInt16 nId, const OUString& rPageName, sal_uInt16 nGroup );
sal_uInt16 AddGroup( const OUString& rGroupName, SfxShell* pCreateShell,
@@ -277,6 +278,7 @@ public:
com::sun::star::awt::XContainerWindowProvider >& rProvider );
virtual ~ExtensionsTabPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual void ActivatePage() SAL_OVERRIDE;
virtual void DeactivatePage() SAL_OVERRIDE;
diff --git a/cui/source/inc/zoom.hxx b/cui/source/inc/zoom.hxx
index 3cccaceb49e8..882be467f95d 100644
--- a/cui/source/inc/zoom.hxx
+++ b/cui/source/inc/zoom.hxx
@@ -27,21 +27,21 @@
class SvxZoomDialog : public SfxModalDialog
{
private:
- RadioButton* m_pOptimalBtn;
- RadioButton* m_pWholePageBtn;
- RadioButton* m_pPageWidthBtn;
- RadioButton* m_p100Btn;
- RadioButton* m_pUserBtn;
- MetricField* m_pUserEdit;
+ VclPtr<RadioButton> m_pOptimalBtn;
+ VclPtr<RadioButton> m_pWholePageBtn;
+ VclPtr<RadioButton> m_pPageWidthBtn;
+ VclPtr<RadioButton> m_p100Btn;
+ VclPtr<RadioButton> m_pUserBtn;
+ VclPtr<MetricField> m_pUserEdit;
- VclContainer* m_pViewFrame;
- RadioButton* m_pAutomaticBtn;
- RadioButton* m_pSingleBtn;
- RadioButton* m_pColumnsBtn;
- NumericField* m_pColumnsEdit;
- CheckBox* m_pBookModeChk;
+ VclPtr<VclContainer> m_pViewFrame;
+ VclPtr<RadioButton> m_pAutomaticBtn;
+ VclPtr<RadioButton> m_pSingleBtn;
+ VclPtr<RadioButton> m_pColumnsBtn;
+ VclPtr<NumericField> m_pColumnsEdit;
+ VclPtr<CheckBox> m_pBookModeChk;
- OKButton* m_pOKBtn;
+ VclPtr<OKButton> m_pOKBtn;
const SfxItemSet& mrSet;
std::unique_ptr<SfxItemSet> mpOutSet;
@@ -57,6 +57,7 @@ private:
public:
SvxZoomDialog(vcl::Window* pParent, const SfxItemSet& rCoreSet);
virtual ~SvxZoomDialog();
+ virtual void dispose() SAL_OVERRIDE;
const SfxItemSet* GetOutputItemSet() const;
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index bfe416952d7d..10c2ebc1bf90 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -35,7 +35,7 @@ CertPathDialog::CertPathDialog(vcl::Window* pParent)
m_pCertPathListContainer->set_width_request(aSize.Width());
m_pCertPathListContainer->set_height_request(aSize.Height());
m_pCertPathList =
- new svx::SvxRadioButtonListBox(*m_pCertPathListContainer, 0);
+ VclPtr<svx::SvxRadioButtonListBox>::Create(*m_pCertPathListContainer, 0);
m_sAddDialogText = get<FixedText>("certdir")->GetText();
m_sManual = get<FixedText>("manual")->GetText();
@@ -144,6 +144,11 @@ OUString CertPathDialog::getDirectory() const
CertPathDialog::~CertPathDialog()
{
+ disposeOnce();
+}
+
+void CertPathDialog::dispose()
+{
SvTreeListEntry* pEntry = m_pCertPathList->First();
while (pEntry)
{
@@ -151,7 +156,11 @@ CertPathDialog::~CertPathDialog()
delete pCertPath;
pEntry = m_pCertPathList->Next( pEntry );
}
- delete m_pCertPathList;
+ m_pCertPathList.disposeAndClear();
+ m_pCertPathListContainer.clear();
+ m_pAddBtn.clear();
+ m_pOKBtn.clear();
+ ModalDialog::dispose();
}
IMPL_LINK( CertPathDialog, CheckHdl_Impl, SvSimpleTable *, pList )
diff --git a/cui/source/options/certpath.hxx b/cui/source/options/certpath.hxx
index bdc083c987d8..29a3e1aa45fb 100644
--- a/cui/source/options/certpath.hxx
+++ b/cui/source/options/certpath.hxx
@@ -19,10 +19,10 @@
class CertPathDialog : public ModalDialog
{
private:
- SvSimpleTableContainer* m_pCertPathListContainer;
- svx::SvxRadioButtonListBox* m_pCertPathList;
- PushButton* m_pAddBtn;
- OKButton* m_pOKBtn;
+ VclPtr<SvSimpleTableContainer> m_pCertPathListContainer;
+ VclPtr<svx::SvxRadioButtonListBox> m_pCertPathList;
+ VclPtr<PushButton> m_pAddBtn;
+ VclPtr<OKButton> m_pOKBtn;
OUString m_sAddDialogText;
OUString m_sManual;
@@ -35,6 +35,7 @@ private:
public:
CertPathDialog(vcl::Window* pParent);
virtual ~CertPathDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString getDirectory() const;
};
diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx
index 058f9a69c917..b162898bc97c 100644
--- a/cui/source/options/connpooloptions.cxx
+++ b/cui/source/options/connpooloptions.cxx
@@ -326,12 +326,28 @@ namespace offapp
m_pDriverList->SetRowChangeHandler( LINK(this, ConnectionPoolOptionsPage, OnDriverRowChanged) );
}
+ ConnectionPoolOptionsPage::~ConnectionPoolOptionsPage()
+ {
+ disposeOnce();
+ }
- SfxTabPage* ConnectionPoolOptionsPage::Create(vcl::Window* _pParent, const SfxItemSet* _rAttrSet)
+ void ConnectionPoolOptionsPage::dispose()
{
- return new ConnectionPoolOptionsPage(_pParent, *_rAttrSet);
+ m_pEnablePooling.clear();
+ m_pDriversLabel.clear();
+ m_pDriverList.clear();
+ m_pDriverLabel.clear();
+ m_pDriver.clear();
+ m_pDriverPoolingEnabled.clear();
+ m_pTimeoutLabel.clear();
+ m_pTimeout.clear();
+ SfxTabPage::dispose();
}
+ VclPtr<SfxTabPage> ConnectionPoolOptionsPage::Create(vcl::Window* _pParent, const SfxItemSet* _rAttrSet)
+ {
+ return VclPtr<ConnectionPoolOptionsPage>::Create(_pParent, *_rAttrSet);
+ }
void ConnectionPoolOptionsPage::implInitControls(const SfxItemSet& _rSet, bool /*_bFromReset*/)
{
diff --git a/cui/source/options/connpooloptions.hxx b/cui/source/options/connpooloptions.hxx
index 868c42702a16..d8e4c2556df8 100644
--- a/cui/source/options/connpooloptions.hxx
+++ b/cui/source/options/connpooloptions.hxx
@@ -38,20 +38,20 @@ namespace offapp
using TabPage::ActivatePage;
protected:
- CheckBox* m_pEnablePooling;
- FixedText* m_pDriversLabel;
- DriverListControl* m_pDriverList;
- FixedText* m_pDriverLabel;
- FixedText* m_pDriver;
- CheckBox* m_pDriverPoolingEnabled;
- FixedText* m_pTimeoutLabel;
- NumericField* m_pTimeout;
-
- protected:
- ConnectionPoolOptionsPage(vcl::Window* _pParent, const SfxItemSet& _rAttrSet);
+ VclPtr<CheckBox> m_pEnablePooling;
+ VclPtr<FixedText> m_pDriversLabel;
+ VclPtr<DriverListControl> m_pDriverList;
+ VclPtr<FixedText> m_pDriverLabel;
+ VclPtr<FixedText> m_pDriver;
+ VclPtr<CheckBox> m_pDriverPoolingEnabled;
+ VclPtr<FixedText> m_pTimeoutLabel;
+ VclPtr<NumericField> m_pTimeout;
public:
- static SfxTabPage* Create(vcl::Window* _pParent, const SfxItemSet* _rAttrSet);
+ ConnectionPoolOptionsPage(vcl::Window* _pParent, const SfxItemSet& _rAttrSet);
+ virtual ~ConnectionPoolOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create(vcl::Window* _pParent, const SfxItemSet* _rAttrSet);
protected:
virtual bool Notify( NotifyEvent& _rNEvt ) SAL_OVERRIDE;
diff --git a/cui/source/options/cuisrchdlg.cxx b/cui/source/options/cuisrchdlg.cxx
index a7041604683b..bff4d1a74c8e 100644
--- a/cui/source/options/cuisrchdlg.cxx
+++ b/cui/source/options/cuisrchdlg.cxx
@@ -54,12 +54,24 @@ SvxJSearchOptionsDialog::SvxJSearchOptionsDialog(vcl::Window *pParent,
{
// pPage will be implicitly destroyed by the
// SfxSingleTabDialog destructor
- pPage = static_cast<SvxJSearchOptionsPage *>(
- SvxJSearchOptionsPage::Create(get_content_area(), &rOptionsSet ));
+ pPage.reset( static_cast<SvxJSearchOptionsPage *>(
+ SvxJSearchOptionsPage::Create(
+ get_content_area(), &rOptionsSet ).get() ) );
SetTabPage( pPage ); //! implicitly calls pPage->Reset(...)!
pPage->EnableSaveOptions(false);
}
+SvxJSearchOptionsDialog::~SvxJSearchOptionsDialog()
+{
+ disposeOnce();
+}
+
+void SvxJSearchOptionsDialog::dispose()
+{
+ pPage.clear();
+ SfxSingleTabDialog::dispose();
+}
+
void SvxJSearchOptionsDialog::Activate()
{
pPage->SetTransliterationFlags( nInitialTlFlags );
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index c99defce27d0..5d834e297cdf 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -78,15 +78,11 @@ DatabaseRegistrationDialog::DatabaseRegistrationDialog( vcl::Window* pParent, co
: RegistrationItemSetHolder(rInAttrs)
, SfxSingleTabDialog(pParent, getRegistrationItems())
{
- SfxTabPage* page = DbRegistrationOptionsPage::Create(get_content_area(), &getRegistrationItems());
+ VclPtr<SfxTabPage> page = DbRegistrationOptionsPage::Create(get_content_area(), &getRegistrationItems());
SetTabPage(page);
SetText(page->get<VclFrame>("frame1")->get_label());
}
-DatabaseRegistrationDialog::~DatabaseRegistrationDialog()
-{
-}
-
short DatabaseRegistrationDialog::Execute()
{
short result = SfxSingleTabDialog::Execute();
@@ -167,17 +163,27 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( vcl::Window* pParent, cons
DbRegistrationOptionsPage::~DbRegistrationOptionsPage()
{
+ disposeOnce();
+}
+
+void DbRegistrationOptionsPage::dispose()
+{
for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i )
delete static_cast< DatabaseRegistration* >( pPathBox->GetEntry(i)->GetUserData() );
- delete pPathBox;
+ pPathBox.disposeAndClear();
+ m_pPathCtrl.clear();
+ m_pNew.clear();
+ m_pEdit.clear();
+ m_pDelete.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* DbRegistrationOptionsPage::Create( vcl::Window* pParent,
+VclPtr<SfxTabPage> DbRegistrationOptionsPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet )
{
- return ( new DbRegistrationOptionsPage( pParent, *rAttrSet ) );
+ return VclPtr<DbRegistrationOptionsPage>::Create( pParent, *rAttrSet );
}
@@ -272,8 +278,8 @@ IMPL_LINK_NOARG(DbRegistrationOptionsPage, DeleteHdl)
SvTreeListEntry* pEntry = pPathBox->FirstSelected();
if ( pEntry )
{
- MessageDialog aQuery(this, CUI_RES(RID_SVXSTR_QUERY_DELETE_CONFIRM), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( aQuery.Execute() == RET_YES )
+ ScopedVclPtrInstance< MessageDialog > aQuery(this, CUI_RES(RID_SVXSTR_QUERY_DELETE_CONFIRM), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ if ( aQuery->Execute() == RET_YES )
pPathBox->GetModel()->Remove(pEntry);
}
return 0;
@@ -408,15 +414,15 @@ void DbRegistrationOptionsPage::insertNewEntry( const OUString& _sName,const OUS
void DbRegistrationOptionsPage::openLinkDialog(const OUString& _sOldName,const OUString& _sOldLocation,SvTreeListEntry* _pEntry)
{
- ODocumentLinkDialog aDlg(this,_pEntry == NULL);
+ ScopedVclPtrInstance< ODocumentLinkDialog > aDlg(this,_pEntry == nullptr);
- aDlg.setLink(_sOldName,_sOldLocation);
- aDlg.setNameValidator(LINK( this, DbRegistrationOptionsPage, NameValidator ) );
+ aDlg->setLink(_sOldName,_sOldLocation);
+ aDlg->setNameValidator(LINK( this, DbRegistrationOptionsPage, NameValidator ) );
- if ( aDlg.Execute() == RET_OK )
+ if ( aDlg->Execute() == RET_OK )
{
OUString sNewName,sNewLocation;
- aDlg.getLink(sNewName,sNewLocation);
+ aDlg->getLink(sNewName,sNewLocation);
if ( _pEntry == NULL || sNewName != _sOldName || sNewLocation != _sOldLocation )
{
if ( _pEntry )
diff --git a/cui/source/options/doclinkdialog.cxx b/cui/source/options/doclinkdialog.cxx
index ffeeb84e33a3..52e03509b068 100644
--- a/cui/source/options/doclinkdialog.cxx
+++ b/cui/source/options/doclinkdialog.cxx
@@ -70,6 +70,20 @@ namespace svx
m_pURL->SetDropDownLineCount( 5 );
}
+ ODocumentLinkDialog::~ODocumentLinkDialog()
+ {
+ disposeOnce();
+ }
+
+ void ODocumentLinkDialog::dispose()
+ {
+ m_pURL.clear();
+ m_pBrowseFile.clear();
+ m_pName.clear();
+ m_pOK.clear();
+ ModalDialog::dispose();
+ }
+
void ODocumentLinkDialog::setLink( const OUString& _rName, const OUString& _rURL )
{
@@ -116,8 +130,8 @@ namespace svx
{
OUString sMsg = CUI_RES(STR_LINKEDDOC_DOESNOTEXIST);
sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText());
- MessageDialog aError(this, sMsg);
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMsg);
+ aError->Execute();
return 0L;
} // if (!bFileExists)
INetURLObject aURL( sURL );
@@ -125,8 +139,8 @@ namespace svx
{
OUString sMsg = CUI_RES(STR_LINKEDDOC_NO_SYSTEM_FILE);
sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText());
- MessageDialog aError(this, sMsg);
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMsg);
+ aError->Execute();
return 0L;
}
@@ -137,8 +151,8 @@ namespace svx
{
OUString sMsg = CUI_RES(STR_NAME_CONFLICT);
sMsg = sMsg.replaceFirst("$file$", sCurrentText);
- MessageDialog aError(this, sMsg, VCL_MESSAGE_INFO);
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMsg, VCL_MESSAGE_INFO);
+ aError->Execute();
m_pName->SetSelection(Selection(0,sCurrentText.getLength()));
m_pName->GrabFocus();
diff --git a/cui/source/options/doclinkdialog.hxx b/cui/source/options/doclinkdialog.hxx
index 0584734b761d..55493e9e9974 100644
--- a/cui/source/options/doclinkdialog.hxx
+++ b/cui/source/options/doclinkdialog.hxx
@@ -40,10 +40,10 @@ namespace svx
class ODocumentLinkDialog : public ModalDialog
{
protected:
- ::svt::OFileURLControl* m_pURL;
- PushButton* m_pBrowseFile;
- Edit* m_pName;
- OKButton* m_pOK;
+ VclPtr<::svt::OFileURLControl> m_pURL;
+ VclPtr<PushButton> m_pBrowseFile;
+ VclPtr<Edit> m_pName;
+ VclPtr<OKButton> m_pOK;
bool m_bCreatingNew;
@@ -51,6 +51,8 @@ namespace svx
public:
ODocumentLinkDialog( vcl::Window* _pParent, bool _bCreateNew );
+ virtual ~ODocumentLinkDialog();
+ virtual void dispose() SAL_OVERRIDE;
// name validation has to be done by an external instance
// the validator link gets a pointer to a String, and should return 0 if the string is not
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index 955cac735640..4276de7311b7 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -62,7 +62,7 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( vcl::Window* pParent,
pCheckLBContainer->set_width_request(aControlSize.Width());
pCheckLBContainer->set_height_request(aControlSize.Height());
- m_pCheckLB = new SvxFontSubstCheckListBox(*pCheckLBContainer, 0);
+ m_pCheckLB = VclPtr<SvxFontSubstCheckListBox>::Create(*pCheckLBContainer, 0);
m_pCheckLB->SetHelpId(HID_OFA_FONT_SUBST_CLB);
m_pCheckLB->SetStyle(m_pCheckLB->GetStyle()|WB_HSCROLL|WB_VSCROLL);
@@ -138,15 +138,32 @@ SvTreeListEntry* SvxFontSubstTabPage::CreateEntry(OUString& rFont1, OUString& rF
SvxFontSubstTabPage::~SvxFontSubstTabPage()
{
+ disposeOnce();
+}
+
+void SvxFontSubstTabPage::dispose()
+{
delete pCheckButtonData;
+ pCheckButtonData = NULL;
delete pConfig;
- delete m_pCheckLB;
+ pConfig = NULL;
+ m_pCheckLB.disposeAndClear();
+ m_pUseTableCB.clear();
+ m_pReplacements.clear();
+ m_pFont1CB.clear();
+ m_pFont2CB.clear();
+ m_pApply.clear();
+ m_pDelete.clear();
+ m_pFontNameLB.clear();
+ m_pNonPropFontsOnlyCB.clear();
+ m_pFontHeightLB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxFontSubstTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxFontSubstTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxFontSubstTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxFontSubstTabPage>::Create(pParent, *rAttrSet);
}
bool SvxFontSubstTabPage::FillItemSet( SfxItemSet* )
diff --git a/cui/source/options/fontsubs.hxx b/cui/source/options/fontsubs.hxx
index d73e2b0f9926..27847da31464 100644
--- a/cui/source/options/fontsubs.hxx
+++ b/cui/source/options/fontsubs.hxx
@@ -63,18 +63,18 @@ class SvxFontSubstCheckListBox : public SvSimpleTable
class SvtFontSubstConfig;
class SvxFontSubstTabPage : public SfxTabPage
{
- CheckBox* m_pUseTableCB;
- VclContainer* m_pReplacements;
- FontNameBox* m_pFont1CB;
- FontNameBox* m_pFont2CB;
- PushButton* m_pApply;
- PushButton* m_pDelete;
+ VclPtr<CheckBox> m_pUseTableCB;
+ VclPtr<VclContainer> m_pReplacements;
+ VclPtr<FontNameBox> m_pFont1CB;
+ VclPtr<FontNameBox> m_pFont2CB;
+ VclPtr<PushButton> m_pApply;
+ VclPtr<PushButton> m_pDelete;
- SvxFontSubstCheckListBox* m_pCheckLB;
+ VclPtr<SvxFontSubstCheckListBox> m_pCheckLB;
- ListBox* m_pFontNameLB;
- CheckBox* m_pNonPropFontsOnlyCB;
- ListBox* m_pFontHeightLB;
+ VclPtr<ListBox> m_pFontNameLB;
+ VclPtr<CheckBox> m_pNonPropFontsOnlyCB;
+ VclPtr<ListBox> m_pFontHeightLB;
OUString m_sAutomatic;
@@ -91,11 +91,12 @@ class SvxFontSubstTabPage : public SfxTabPage
void CheckEnable();
- SvxFontSubstTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxFontSubstTabPage();
+ virtual void dispose() SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet);
+ SvxFontSubstTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ static VclPtr<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/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index c5ef749ec20f..851753d932c8 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -130,7 +130,7 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxI
m_pSearchBtn( get<PushButton>("searchButton") ),
m_pSearchEdit( get<Edit>("searchEntry") ),
m_vectorOfModified(),
- m_pPrefBox( new SvSimpleTable(*m_pPrefCtrl, WB_SCROLL | WB_HSCROLL | WB_VSCROLL ) )
+ m_pPrefBox( VclPtr<SvSimpleTable>::Create(*m_pPrefCtrl, WB_SCROLL | WB_HSCROLL | WB_VSCROLL ) )
{
Size aControlSize(LogicToPixel(Size(385, 230), MAP_APPFONT));
m_pPrefCtrl->set_width_request(aControlSize.Width());
@@ -164,6 +164,21 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxI
m_pPrefBox->SetAlternatingRowColors( true );
}
+CuiAboutConfigTabPage::~CuiAboutConfigTabPage()
+{
+ disposeOnce();
+}
+
+void CuiAboutConfigTabPage::dispose()
+{
+ m_pPrefCtrl.clear();
+ m_pResetBtn.clear();
+ m_pEditBtn.clear();
+ m_pSearchBtn.clear();
+ m_pSearchEdit.clear();
+ ModelessDialog::dispose();
+}
+
void CuiAboutConfigTabPage::InsertEntry(const OUString& rProp, const OUString& rStatus, const OUString& rType, const OUString& rValue)
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
@@ -477,6 +492,17 @@ CuiAboutConfigValueDialog::CuiAboutConfigValueDialog( vcl::Window* pWindow,
}
+CuiAboutConfigValueDialog::~CuiAboutConfigValueDialog()
+{
+ disposeOnce();
+}
+
+void CuiAboutConfigValueDialog::dispose()
+{
+ m_pEDValue.clear();
+ ModalDialog::dispose();
+}
+
IMPL_LINK_NOARG( CuiAboutConfigTabPage, ResetBtnHdl_Impl )
{
Reset();
@@ -538,7 +564,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl )
else if( sPropertyType == "hyper" )
limit = HYPER_LEN_LIMIT;
- CuiAboutConfigValueDialog* pValueDialog = new CuiAboutConfigValueDialog(0, sDialogValue, limit);
+ VclPtrInstance<CuiAboutConfigValueDialog> pValueDialog(nullptr, sDialogValue, limit);
if( pValueDialog->Execute() == RET_OK )
{
diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx
index dc19e4ae6539..b9ead63ef7e5 100644
--- a/cui/source/options/optaboutconfig.hxx
+++ b/cui/source/options/optaboutconfig.hxx
@@ -43,14 +43,14 @@ public:
class CuiAboutConfigTabPage : public ModelessDialog
{
private:
- SvSimpleTableContainer* m_pPrefCtrl;
- PushButton* m_pResetBtn;
- PushButton* m_pEditBtn;
- PushButton* m_pSearchBtn;
- Edit* m_pSearchEdit;
+ VclPtr<SvSimpleTableContainer> m_pPrefCtrl;
+ VclPtr<PushButton> m_pResetBtn;
+ VclPtr<PushButton> m_pEditBtn;
+ VclPtr<PushButton> m_pSearchBtn;
+ VclPtr<Edit> m_pSearchEdit;
std::vector< boost::shared_ptr< Prop_Impl > > m_vectorOfModified;
- boost::scoped_ptr< SvSimpleTable > m_pPrefBox;
+ VclPtr< SvSimpleTable > m_pPrefBox;
//for search
::com::sun::star::util::SearchOptions m_options;
@@ -65,6 +65,8 @@ private:
public:
CuiAboutConfigTabPage(vcl::Window* pParent);
+ virtual ~CuiAboutConfigTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void InsertEntry(const OUString& rProp, const OUString& rStatus, const OUString& rType, const OUString& rValue);
void Reset();
void FillItems(const com::sun::star::uno::Reference<com::sun::star::container::XNameAccess>& xNameAccess);
@@ -75,10 +77,12 @@ public:
class CuiAboutConfigValueDialog : public ModalDialog
{
private:
- CuiCustomMultilineEdit* m_pEDValue;
+ VclPtr<CuiCustomMultilineEdit> m_pEDValue;
public:
CuiAboutConfigValueDialog( vcl::Window* pWindow, const OUString& rValue , int limit = 0);
+ virtual ~CuiAboutConfigValueDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString getValue()
{
diff --git a/cui/source/options/optaccessibility.cxx b/cui/source/options/optaccessibility.cxx
index cccc1b428087..d781ed26dd54 100644
--- a/cui/source/options/optaccessibility.cxx
+++ b/cui/source/options/optaccessibility.cxx
@@ -58,12 +58,28 @@ SvxAccessibilityOptionsTabPage::SvxAccessibilityOptionsTabPage(vcl::Window* pPar
SvxAccessibilityOptionsTabPage::~SvxAccessibilityOptionsTabPage()
{
+ disposeOnce();
+}
+
+void SvxAccessibilityOptionsTabPage::dispose()
+{
delete m_pImpl;
+ m_pImpl = NULL;
+ m_pAccessibilityTool.clear();
+ m_pTextSelectionInReadonly.clear();
+ m_pAnimatedGraphics.clear();
+ m_pAnimatedTexts.clear();
+ m_pTipHelpCB.clear();
+ m_pTipHelpNF.clear();
+ m_pAutoDetectHC.clear();
+ m_pAutomaticFontColor.clear();
+ m_pPagePreviews.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxAccessibilityOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxAccessibilityOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new SvxAccessibilityOptionsTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxAccessibilityOptionsTabPage>::Create(pParent, *rAttrSet);
}
bool SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet* )
diff --git a/cui/source/options/optaccessibility.hxx b/cui/source/options/optaccessibility.hxx
index c63c37dac682..16e4c3a97bd3 100644
--- a/cui/source/options/optaccessibility.hxx
+++ b/cui/source/options/optaccessibility.hxx
@@ -25,27 +25,27 @@
struct SvxAccessibilityOptionsTabPage_Impl;
class SvxAccessibilityOptionsTabPage : public SfxTabPage
{
- CheckBox* m_pAccessibilityTool;
- CheckBox* m_pTextSelectionInReadonly;
- CheckBox* m_pAnimatedGraphics;
- CheckBox* m_pAnimatedTexts;
- CheckBox* m_pTipHelpCB;
- NumericField* m_pTipHelpNF;
- CheckBox* m_pAutoDetectHC;
- CheckBox* m_pAutomaticFontColor;
- CheckBox* m_pPagePreviews;
+ VclPtr<CheckBox> m_pAccessibilityTool;
+ VclPtr<CheckBox> m_pTextSelectionInReadonly;
+ VclPtr<CheckBox> m_pAnimatedGraphics;
+ VclPtr<CheckBox> m_pAnimatedTexts;
+ VclPtr<CheckBox> m_pTipHelpCB;
+ VclPtr<NumericField> m_pTipHelpNF;
+ VclPtr<CheckBox> m_pAutoDetectHC;
+ VclPtr<CheckBox> m_pAutomaticFontColor;
+ VclPtr<CheckBox> m_pPagePreviews;
DECL_LINK(TipHelpHdl, CheckBox*);
void EnableTipHelp(bool bCheck);
SvxAccessibilityOptionsTabPage_Impl* m_pImpl;
- SvxAccessibilityOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
public:
-
+ SvxAccessibilityOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxAccessibilityOptionsTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<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/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx
index d944b5f891e3..c16711f621a4 100644
--- a/cui/source/options/optasian.cxx
+++ b/cui/source/options/optasian.cxx
@@ -151,12 +151,32 @@ SvxAsianLayoutPage::SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet&
SvxAsianLayoutPage::~SvxAsianLayoutPage()
{
+ disposeOnce();
+}
+
+void SvxAsianLayoutPage::dispose()
+{
delete pImpl;
+ pImpl = NULL;
+ m_pCharKerningRB.clear();
+ m_pCharPunctKerningRB.clear();
+ m_pNoCompressionRB.clear();
+ m_pPunctCompressionRB.clear();
+ m_pPunctKanaCompressionRB.clear();
+ m_pLanguageFT.clear();
+ m_pLanguageLB.clear();
+ m_pStandardCB.clear();
+ m_pStartFT.clear();
+ m_pStartED.clear();
+ m_pEndFT.clear();
+ m_pEndED.clear();
+ m_pHintFT.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxAsianLayoutPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxAsianLayoutPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new SvxAsianLayoutPage(pParent, *rAttrSet);
+ return VclPtr<SvxAsianLayoutPage>::Create(pParent, *rAttrSet);
}
bool SvxAsianLayoutPage::FillItemSet( SfxItemSet* )
diff --git a/cui/source/options/optbasic.cxx b/cui/source/options/optbasic.cxx
index 2c5498e97934..913b8a230f0f 100644
--- a/cui/source/options/optbasic.cxx
+++ b/cui/source/options/optbasic.cxx
@@ -47,6 +47,18 @@ SvxBasicIDEOptionsPage::SvxBasicIDEOptionsPage( vcl::Window* pParent, const SfxI
SvxBasicIDEOptionsPage::~SvxBasicIDEOptionsPage()
{
+ disposeOnce();
+}
+
+void SvxBasicIDEOptionsPage::dispose()
+{
+ pCodeCompleteChk.clear();
+ pAutocloseProcChk.clear();
+ pAutocloseParenChk.clear();
+ pAutocloseQuotesChk.clear();
+ pAutoCorrectChk.clear();
+ pUseExtendedTypesChk.clear();
+ SfxTabPage::dispose();
}
void SvxBasicIDEOptionsPage::LoadConfig()
@@ -136,9 +148,9 @@ void SvxBasicIDEOptionsPage::Reset( const SfxItemSet* /*rSet*/ )
pUseExtendedTypesChk->SaveValue();
}
-SfxTabPage* SvxBasicIDEOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxBasicIDEOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return ( new SvxBasicIDEOptionsPage( pParent, *rAttrSet ) );
+ return VclPtr<SvxBasicIDEOptionsPage>::Create( pParent, *rAttrSet );
}
void SvxBasicIDEOptionsPage::FillUserData()
diff --git a/cui/source/options/optbasic.hxx b/cui/source/options/optbasic.hxx
index 5b1959d9f5a6..dc617b1fea3a 100644
--- a/cui/source/options/optbasic.hxx
+++ b/cui/source/options/optbasic.hxx
@@ -27,20 +27,21 @@
class SvxBasicIDEOptionsPage: public SfxTabPage
{
private:
- CheckBox* pCodeCompleteChk;
- CheckBox* pAutocloseProcChk;
- CheckBox* pAutocloseParenChk;
- CheckBox* pAutocloseQuotesChk;
- CheckBox* pAutoCorrectChk;
- CheckBox* pUseExtendedTypesChk;
+ VclPtr<CheckBox> pCodeCompleteChk;
+ VclPtr<CheckBox> pAutocloseProcChk;
+ VclPtr<CheckBox> pAutocloseParenChk;
+ VclPtr<CheckBox> pAutocloseQuotesChk;
+ VclPtr<CheckBox> pAutoCorrectChk;
+ VclPtr<CheckBox> pUseExtendedTypesChk;
void LoadConfig();
public:
SvxBasicIDEOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxBasicIDEOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void FillUserData() SAL_OVERRIDE;
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx
index 55d002d70e51..f9e3c0e22d40 100644
--- a/cui/source/options/optchart.cxx
+++ b/cui/source/options/optchart.cxx
@@ -83,12 +83,28 @@ SvxDefaultColorOptPage::SvxDefaultColorOptPage(vcl::Window* pParent, const SfxIt
SvxDefaultColorOptPage::~SvxDefaultColorOptPage()
{
+ disposeOnce();
+}
+
+void SvxDefaultColorOptPage::dispose()
+{
// save changes
- pChartOptions->SetDefaultColors( pColorConfig->GetColorList() );
- pChartOptions->Commit();
+ if (pChartOptions)
+ {
+ pChartOptions->SetDefaultColors( pColorConfig->GetColorList() );
+ pChartOptions->Commit();
- delete pColorConfig;
- delete pChartOptions;
+ delete pColorConfig;
+ pColorConfig = NULL;
+ delete pChartOptions;
+ pChartOptions = NULL;
+ }
+ m_pLbChartColors.clear();
+ m_pValSetColorBox.clear();
+ m_pPBDefault.clear();
+ m_pPBAdd.clear();
+ m_pPBRemove.clear();
+ SfxTabPage::dispose();
}
void SvxDefaultColorOptPage::Construct()
@@ -103,9 +119,9 @@ void SvxDefaultColorOptPage::Construct()
}
-SfxTabPage* SvxDefaultColorOptPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxDefaultColorOptPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrs )
{
- return new SvxDefaultColorOptPage( pParent, *rAttrs );
+ return VclPtr<SvxDefaultColorOptPage>::Create( pParent, *rAttrs );
}
bool SvxDefaultColorOptPage::FillItemSet( SfxItemSet* rOutAttrs )
@@ -215,9 +231,9 @@ IMPL_LINK( SvxDefaultColorOptPage, RemoveChartColor, PushButton*, pButton )
{
OSL_ENSURE(pColorConfig->GetColorList().size() > 1, "don't delete the last chart color");
- MessageDialog aQuery(pButton, "QueryDeleteChartColorDialog",
- "cui/ui/querydeletechartcolordialog.ui");
- if (RET_YES == aQuery.Execute())
+ ScopedVclPtrInstance<MessageDialog> aQuery(pButton, "QueryDeleteChartColorDialog",
+ "cui/ui/querydeletechartcolordialog.ui");
+ if (RET_YES == aQuery->Execute())
{
pColorConfig->GetColorList().remove( nIndex );
diff --git a/cui/source/options/optchart.hxx b/cui/source/options/optchart.hxx
index 0f210e1ccd15..506b9c87f1a0 100644
--- a/cui/source/options/optchart.hxx
+++ b/cui/source/options/optchart.hxx
@@ -33,11 +33,11 @@ class SvxDefaultColorOptPage : public SfxTabPage
{
private:
- ColorLB* m_pLbChartColors;
- ValueSet* m_pValSetColorBox;
- PushButton* m_pPBDefault;
- PushButton* m_pPBAdd;
- PushButton* m_pPBRemove;
+ VclPtr<ColorLB> m_pLbChartColors;
+ VclPtr<ValueSet> m_pValSetColorBox;
+ VclPtr<PushButton> m_pPBDefault;
+ VclPtr<PushButton> m_pPBAdd;
+ VclPtr<PushButton> m_pPBRemove;
SvxChartOptions* pChartOptions;
SvxChartColorTableItem* pColorConfig;
@@ -55,10 +55,11 @@ private:
public:
SvxDefaultColorOptPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxDefaultColorOptPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
virtual bool FillItemSet( SfxItemSet* rOutAttrs ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rInAttrs ) SAL_OVERRIDE;
};
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index e71e31b02df2..a8e8c8e9bed8 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -174,7 +174,8 @@ class ColorConfigWindow_Impl
{
public:
ColorConfigWindow_Impl(vcl::Window* pParent);
- virtual ~ColorConfigWindow_Impl();
+ virtual ~ColorConfigWindow_Impl() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
public:
void SetLinks (Link const&, Link const&, Link const&);
@@ -192,8 +193,7 @@ private:
class Chapter
{
// text
- bool m_bOwnsWidget;
- FixedText *m_pText;
+ VclPtr<FixedText> m_pText;
public:
Chapter(FixedText *pText, bool bShow);
Chapter(vcl::Window *pGrid, unsigned nYPos, const OUString& sDisplayName);
@@ -234,11 +234,11 @@ private:
private:
bool m_bOwnsWidgets;
// checkbox (CheckBox) or simple text (FixedText)
- Control* m_pText;
+ VclPtr<Control> m_pText;
// color list box
- ColorListBox* m_pColorList;
+ VclPtr<ColorListBox> m_pColorList;
// color preview box
- vcl::Window* m_pPreview;
+ VclPtr<vcl::Window> m_pPreview;
// default color
Color m_aDefaultColor;
private:
@@ -255,9 +255,9 @@ private:
private:
- VclGrid *m_pGrid;
- ScrollBar *m_pVScroll;
- HeaderBar *m_pHeaderHB;
+ VclPtr<VclGrid> m_pGrid;
+ VclPtr<ScrollBar> m_pVScroll;
+ VclPtr<HeaderBar> m_pHeaderHB;
// initialization
void CreateEntries();
@@ -282,8 +282,7 @@ private:
// eGroup: which group is this?
// rResMgr: resource manager
ColorConfigWindow_Impl::Chapter::Chapter(FixedText* pText, bool bShow)
- : m_bOwnsWidget(false)
- , m_pText(pText)
+ : m_pText(pText)
{
if (!bShow)
Hide();
@@ -292,9 +291,8 @@ ColorConfigWindow_Impl::Chapter::Chapter(FixedText* pText, bool bShow)
// ctor for extended groups
ColorConfigWindow_Impl::Chapter::Chapter(vcl::Window *pGrid,
unsigned nYPos, const OUString& rDisplayName)
- : m_bOwnsWidget(true)
{
- m_pText = new FixedText(pGrid, WB_LEFT|WB_VCENTER|WB_3DLOOK);
+ m_pText = VclPtr<FixedText>::Create(pGrid, WB_LEFT|WB_VCENTER|WB_3DLOOK);
m_pText->set_font_attribute("weight", "bold");
m_pText->set_grid_width(3);
m_pText->set_grid_left_attach(0);
@@ -304,8 +302,8 @@ ColorConfigWindow_Impl::Chapter::Chapter(vcl::Window *pGrid,
ColorConfigWindow_Impl::Chapter::~Chapter()
{
- if (m_bOwnsWidget)
- delete m_pText;
+ // FIXME: we had an horrible m_bOwnsWidget const
+ m_pText.disposeAndClear();
}
void ColorConfigWindow_Impl::Chapter::Show(Wallpaper const& rBackWall)
@@ -348,19 +346,19 @@ ColorConfigWindow_Impl::Entry::Entry( vcl::Window *pGrid, unsigned nYPos,
: m_bOwnsWidgets(true)
, m_aDefaultColor(rColorEntry.getDefaultColor())
{
- m_pText = new FixedText(pGrid, WB_LEFT|WB_VCENTER|WB_3DLOOK);
+ m_pText = VclPtr<FixedText>::Create(pGrid, WB_LEFT|WB_VCENTER|WB_3DLOOK);
m_pText->set_grid_left_attach(0);
m_pText->set_grid_top_attach(nYPos);
m_pText->set_margin_left(6 + nCheckBoxLabelOffset);
m_pText->SetText(rColorEntry.getDisplayName());
WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP|WB_DROPDOWN;
- m_pColorList = new ColorListBox(pGrid, nWinBits);
+ m_pColorList = VclPtr<ColorListBox>::Create(pGrid, nWinBits);
m_pColorList->EnableAutoSize(true);
m_pColorList->set_grid_left_attach(1);
m_pColorList->set_grid_top_attach(nYPos);
- m_pPreview = new vcl::Window(pGrid, WB_BORDER);
+ m_pPreview = VclPtr<vcl::Window>::Create(pGrid, WB_BORDER);
m_pPreview->set_grid_left_attach(2);
m_pPreview->set_grid_top_attach(nYPos);
m_pPreview->set_margin_right(6);
@@ -372,9 +370,9 @@ ColorConfigWindow_Impl::Entry::~Entry()
{
if (m_bOwnsWidgets)
{
- delete m_pText;
- delete m_pColorList;
- delete m_pPreview;
+ m_pText.disposeAndClear();
+ m_pColorList.disposeAndClear();
+ m_pPreview.disposeAndClear();
}
}
@@ -416,7 +414,7 @@ void ColorConfigWindow_Impl::Entry::SetLinks(
{
m_pColorList->SetSelectHdl(aColorLink);
m_pColorList->SetGetFocusHdl(aGetFocusLink);
- if (CheckBox* pCheckBox = dynamic_cast<CheckBox*>(m_pText))
+ if (CheckBox* pCheckBox = dynamic_cast<CheckBox*>(m_pText.get()))
{
pCheckBox->SetClickHdl(aCheckLink);
pCheckBox->SetGetFocusHdl(aGetFocusLink);
@@ -439,7 +437,7 @@ void ColorConfigWindow_Impl::Entry::Update (
m_pColorList->SelectEntry(aColor);
}
m_pPreview->SetBackground(Wallpaper(aColor));
- if (CheckBox* pCheckBox = dynamic_cast<CheckBox*>(m_pText))
+ if (CheckBox* pCheckBox = dynamic_cast<CheckBox*>(m_pText.get()))
pCheckBox->Check(rValue.bIsVisible);
}
@@ -509,6 +507,15 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(vcl::Window* pParent)
SetAppearance();
}
+void ColorConfigWindow_Impl::dispose()
+{
+ disposeBuilder();
+ m_pGrid.clear();
+ m_pVScroll.clear();
+ m_pHeaderHB.clear();
+ VclContainer::dispose();
+}
+
Size ColorConfigWindow_Impl::calculateRequisition() const
{
return getLayoutRequisition(*m_pGrid);
@@ -546,12 +553,12 @@ void ColorConfigWindow_Impl::CreateEntries()
long nCheckBoxLabelOffset = 0;
{
OUString sSampleText("X");
- CheckBox aCheckBox(this);
- FixedText aFixedText(this);
- aCheckBox.SetText(sSampleText);
- aFixedText.SetText(sSampleText);
- Size aCheckSize(aCheckBox.CalcMinimumSize(0x7fffffff));
- Size aFixedSize(aFixedText.CalcMinimumSize(0x7fffffff));
+ ScopedVclPtrInstance< CheckBox > aCheckBox(this);
+ ScopedVclPtrInstance< FixedText > aFixedText(this);
+ aCheckBox->SetText(sSampleText);
+ aFixedText->SetText(sSampleText);
+ Size aCheckSize(aCheckBox->CalcMinimumSize(0x7fffffff));
+ Size aFixedSize(aFixedText->CalcMinimumSize(0x7fffffff));
nCheckBoxLabelOffset = aCheckSize.Width() - aFixedSize.Width();
}
@@ -621,13 +628,13 @@ void ColorConfigWindow_Impl::SetAppearance ()
OSL_ENSURE( vEntries.size() >= sizeof vEntryInfo / sizeof vEntryInfo[0], "wrong number of helpIDs for color listboxes" );
// creating a sample color listbox with the color entries
- ColorListBox aSampleColorList(this);
+ ScopedVclPtrInstance< ColorListBox > aSampleColorList(this);
{
XColorListRef const xColorTable = XColorList::CreateStdColorList();
for (sal_Int32 i = 0; i != xColorTable->Count(); ++i)
{
XColorEntry& rEntry = *xColorTable->GetColor(i);
- aSampleColorList.InsertEntry(rEntry.GetColor(), rEntry.GetName());
+ aSampleColorList->InsertEntry(rEntry.GetColor(), rEntry.GetName());
}
}
@@ -635,13 +642,10 @@ void ColorConfigWindow_Impl::SetAppearance ()
for (size_t i = 0; i != vEntries.size(); ++i)
{
// appearance
- vEntries[i]->SetAppearance(aTransparentWall, aSampleColorList);
+ vEntries[i]->SetAppearance(aTransparentWall, *aSampleColorList.get());
}
}
-ColorConfigWindow_Impl::~ColorConfigWindow_Impl ()
-{ }
-
void ColorConfigWindow_Impl::AdjustHeaderBar()
{
// horizontal positions
@@ -823,10 +827,10 @@ void ColorConfigWindow_Impl::Command( const CommandEvent& rCEvt )
class ColorConfigCtrl_Impl : public VclVBox
{
- HeaderBar* m_pHeaderHB;
- VclHBox* m_pBody;
- ColorConfigWindow_Impl* m_pScrollWindow;
- ScrollBar* m_pVScroll;
+ VclPtr<HeaderBar> m_pHeaderHB;
+ VclPtr<VclHBox> m_pBody;
+ VclPtr<ColorConfigWindow_Impl> m_pScrollWindow;
+ VclPtr<ScrollBar> m_pVScroll;
EditableColorConfig* pColorConfig;
EditableExtendedColorConfig* pExtColorConfig;
@@ -842,6 +846,7 @@ class ColorConfigCtrl_Impl : public VclVBox
public:
ColorConfigCtrl_Impl(vcl::Window* pParent);
virtual ~ColorConfigCtrl_Impl();
+ virtual void dispose() SAL_OVERRIDE;
void InitHeaderBar(const OUString &rOn, const OUString &rUIElems,
const OUString &rColorSetting, const OUString &rPreview);
@@ -864,11 +869,11 @@ ColorConfigCtrl_Impl::ColorConfigCtrl_Impl(vcl::Window* pParent)
, pColorConfig(0)
, pExtColorConfig(0)
{
- m_pHeaderHB = new HeaderBar(this, WB_BUTTONSTYLE | WB_BOTTOMBORDER);
+ m_pHeaderHB = VclPtr<HeaderBar>::Create(this, WB_BUTTONSTYLE | WB_BOTTOMBORDER);
- m_pBody = new VclHBox(this);
- m_pScrollWindow = new ColorConfigWindow_Impl(m_pBody);
- m_pVScroll = new ScrollBar(m_pBody, WB_VERT);
+ m_pBody = VclPtr<VclHBox>::Create(this);
+ m_pScrollWindow = VclPtr<ColorConfigWindow_Impl>::Create(m_pBody);
+ m_pVScroll = VclPtr<ScrollBar>::Create(m_pBody, WB_VERT);
m_pScrollWindow->Init(m_pVScroll, m_pHeaderHB);
m_pBody->set_hexpand(true);
@@ -910,10 +915,16 @@ void ColorConfigCtrl_Impl::InitHeaderBar(const OUString &rOn, const OUString &rU
ColorConfigCtrl_Impl::~ColorConfigCtrl_Impl()
{
- delete m_pVScroll;
- delete m_pScrollWindow;
- delete m_pBody;
- delete m_pHeaderHB;
+ disposeOnce();
+}
+
+void ColorConfigCtrl_Impl::dispose()
+{
+ m_pVScroll.disposeAndClear();
+ m_pScrollWindow.disposeAndClear();
+ m_pBody.disposeAndClear();
+ m_pHeaderHB.disposeAndClear();
+ VclVBox::dispose();
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeColorConfigCtrl(vcl::Window *pParent, VclBuilder::stringmap &)
@@ -1056,28 +1067,44 @@ SvxColorOptionsTabPage::SvxColorOptionsTabPage(
SvxColorOptionsTabPage::~SvxColorOptionsTabPage()
{
- //when the dialog is cancelled but the color scheme ListBox has been changed these
- //changes need to be undone
- if(!bFillItemSetCalled && m_pColorSchemeLB->IsValueChangedFromSaved())
+ disposeOnce();
+}
+
+void SvxColorOptionsTabPage::dispose()
+{
+ if (pColorConfig)
{
- OUString sOldScheme = m_pColorSchemeLB->GetEntry(m_pColorSchemeLB->GetSavedValue());
- if(!sOldScheme.isEmpty())
+ //when the dialog is cancelled but the color scheme ListBox has been changed these
+ //changes need to be undone
+ if(!bFillItemSetCalled && m_pColorSchemeLB->IsValueChangedFromSaved())
{
- pColorConfig->SetCurrentSchemeName(sOldScheme);
- pExtColorConfig->SetCurrentSchemeName(sOldScheme);
+ OUString sOldScheme = m_pColorSchemeLB->GetEntry(m_pColorSchemeLB->GetSavedValue());
+ if(!sOldScheme.isEmpty())
+ {
+ pColorConfig->SetCurrentSchemeName(sOldScheme);
+ pExtColorConfig->SetCurrentSchemeName(sOldScheme);
+ }
}
+ pColorConfig->ClearModified();
+ pColorConfig->EnableBroadcast();
+ delete pColorConfig;
+ pColorConfig = NULL;
+
+ pExtColorConfig->ClearModified();
+ pExtColorConfig->EnableBroadcast();
+ delete pExtColorConfig;
+ pExtColorConfig = NULL;
}
- pColorConfig->ClearModified();
- pColorConfig->EnableBroadcast();
- delete pColorConfig;
- pExtColorConfig->ClearModified();
- pExtColorConfig->EnableBroadcast();
- delete pExtColorConfig;
+ m_pColorSchemeLB.clear();
+ m_pSaveSchemePB.clear();
+ m_pDeleteSchemePB.clear();
+ m_pColorConfigCT.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxColorOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxColorOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return ( new SvxColorOptionsTabPage( pParent, *rAttrSet ) );
+ return VclPtr<SvxColorOptionsTabPage>::Create( pParent, *rAttrSet );
}
bool SvxColorOptionsTabPage::FillItemSet( SfxItemSet* )
@@ -1178,9 +1205,9 @@ IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, PushButton*, pButton )
else
{
DBG_ASSERT(m_pColorSchemeLB->GetEntryCount() > 1, "don't delete the last scheme");
- MessageDialog aQuery(pButton, CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- aQuery.SetText(CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE_TITLE));
- if(RET_YES == aQuery.Execute())
+ ScopedVclPtrInstance< MessageDialog > aQuery(pButton, CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ aQuery->SetText(CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE_TITLE));
+ if(RET_YES == aQuery->Execute())
{
OUString sDeleteScheme(m_pColorSchemeLB->GetSelectEntry());
m_pColorSchemeLB->RemoveEntry(m_pColorSchemeLB->GetSelectEntryPos());
diff --git a/cui/source/options/optcolor.hxx b/cui/source/options/optcolor.hxx
index 494874831f6c..c16c2973ee0f 100644
--- a/cui/source/options/optcolor.hxx
+++ b/cui/source/options/optcolor.hxx
@@ -31,10 +31,10 @@ class SvxColorOptionsTabPage : public SfxTabPage
{
using SfxTabPage::DeactivatePage;
- ListBox* m_pColorSchemeLB;
- PushButton* m_pSaveSchemePB;
- PushButton* m_pDeleteSchemePB;
- ColorConfigCtrl_Impl* m_pColorConfigCT;
+ VclPtr<ListBox> m_pColorSchemeLB;
+ VclPtr<PushButton> m_pSaveSchemePB;
+ VclPtr<PushButton> m_pDeleteSchemePB;
+ VclPtr<ColorConfigCtrl_Impl> m_pColorConfigCT;
bool bFillItemSetCalled;
@@ -49,8 +49,9 @@ class SvxColorOptionsTabPage : public SfxTabPage
public:
SvxColorOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxColorOptionsTabPage( );
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<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/cui/source/options/optctl.cxx b/cui/source/options/optctl.cxx
index 45430195bc94..652bba938bf9 100644
--- a/cui/source/options/optctl.cxx
+++ b/cui/source/options/optctl.cxx
@@ -59,11 +59,23 @@ SvxCTLOptionsPage::SvxCTLOptionsPage( vcl::Window* pParent, const SfxItemSet& rS
SvxCTLOptionsPage::~SvxCTLOptionsPage()
{
+ disposeOnce();
}
-SfxTabPage* SvxCTLOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+void SvxCTLOptionsPage::dispose()
{
- return new SvxCTLOptionsPage( pParent, *rAttrSet );
+ m_pSequenceCheckingCB.clear();
+ m_pRestrictedCB.clear();
+ m_pTypeReplaceCB.clear();
+ m_pMovementLogicalRB.clear();
+ m_pMovementVisualRB.clear();
+ m_pNumeralsLB.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> SvxCTLOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SvxCTLOptionsPage>::Create( pParent, *rAttrSet );
}
bool SvxCTLOptionsPage::FillItemSet( SfxItemSet* )
diff --git a/cui/source/options/optctl.hxx b/cui/source/options/optctl.hxx
index 3ab62ad2c09d..ac2544d47c27 100644
--- a/cui/source/options/optctl.hxx
+++ b/cui/source/options/optctl.hxx
@@ -30,24 +30,22 @@ class SvxCTLOptionsPage : public SfxTabPage
{
private:
- CheckBox* m_pSequenceCheckingCB;
- CheckBox* m_pRestrictedCB;
- CheckBox* m_pTypeReplaceCB;
+ VclPtr<CheckBox> m_pSequenceCheckingCB;
+ VclPtr<CheckBox> m_pRestrictedCB;
+ VclPtr<CheckBox> m_pTypeReplaceCB;
- RadioButton* m_pMovementLogicalRB;
- RadioButton* m_pMovementVisualRB;
+ VclPtr<RadioButton> m_pMovementLogicalRB;
+ VclPtr<RadioButton> m_pMovementVisualRB;
- ListBox* m_pNumeralsLB;
+ VclPtr<ListBox> m_pNumeralsLB;
DECL_LINK( SequenceCheckingCB_Hdl, void* );
- SvxCTLOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
-
public:
-
+ SvxCTLOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxCTLOptionsPage();
-
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<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/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index d7d0c7297b2c..4d154e26f0f0 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -117,6 +117,19 @@ SvxNewDictionaryDialog::SvxNewDictionaryDialog( vcl::Window* pParent,
pLanguageLB->SelectEntryPos(0);
}
+SvxNewDictionaryDialog::~SvxNewDictionaryDialog()
+{
+ disposeOnce();
+}
+
+void SvxNewDictionaryDialog::dispose()
+{
+ pNameEdit.clear();
+ pLanguageLB.clear();
+ pExceptBtn.clear();
+ pOKBtn.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl)
@@ -212,8 +225,7 @@ IMPL_LINK_NOARG_INLINE_END(SvxNewDictionaryDialog, ModifyHdl_Impl)
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxDictEdit(vcl::Window *pParent, VclBuilder::stringmap&)
{
WinBits nWinStyle = WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK;
- SvxDictEdit *pEdit = new SvxDictEdit(pParent, nWinStyle);
- return pEdit;
+ return new SvxDictEdit(pParent, nWinStyle);
};
SvxEditDictionaryDialog::SvxEditDictionaryDialog(
@@ -331,10 +343,23 @@ SvxEditDictionaryDialog::SvxEditDictionaryDialog(
}
}
-
-
SvxEditDictionaryDialog::~SvxEditDictionaryDialog()
{
+ disposeOnce();
+}
+
+void SvxEditDictionaryDialog::dispose()
+{
+ pAllDictsLB.clear();
+ pLangFT.clear();
+ pLangLB.clear();
+ pWordED.clear();
+ pReplaceFT.clear();
+ pReplaceED.clear();
+ pWordsLB.clear();
+ pNewReplacePB.clear();
+ pDeletePB.clear();
+ ModalDialog::dispose();
}
@@ -451,12 +476,12 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl)
if ( nLang != nOldLang )
{
- MessageDialog aBox(this, CUI_RES( RID_SVXSTR_CONFIRM_SET_LANGUAGE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- OUString sTxt(aBox.get_primary_text());
+ ScopedVclPtrInstance< MessageDialog > aBox(this, CUI_RES( RID_SVXSTR_CONFIRM_SET_LANGUAGE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ OUString sTxt(aBox->get_primary_text());
sTxt = sTxt.replaceFirst( "%1", pAllDictsLB->GetSelectEntry() );
- aBox.set_primary_text(sTxt);
+ aBox->set_primary_text(sTxt);
- if ( aBox.Execute() == RET_YES )
+ if ( aBox->Execute() == RET_YES )
{
xDic->setLocale( LanguageTag::convertToLocale( nLang ) );
bool bNegativ = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index f3f1df5d2013..cd6858228f3c 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -56,8 +56,23 @@ OfaMSFilterTabPage::OfaMSFilterTabPage(vcl::Window* pParent, const SfxItemSet& r
OfaMSFilterTabPage::~OfaMSFilterTabPage()
{
+ disposeOnce();
}
+void OfaMSFilterTabPage::dispose()
+{
+ aWBasicCodeCB.clear();
+ aWBasicWbctblCB.clear();
+ aWBasicStgCB.clear();
+ aEBasicCodeCB.clear();
+ aEBasicExectblCB.clear();
+ aEBasicStgCB.clear();
+ aPBasicCodeCB.clear();
+ aPBasicStgCB.clear();
+ SfxTabPage::dispose();
+}
+
+
IMPL_LINK_NOARG(OfaMSFilterTabPage, LoadWordBasicCheckHdl_Impl)
{
aWBasicWbctblCB->Enable( aWBasicCodeCB->IsChecked() );
@@ -70,10 +85,10 @@ IMPL_LINK_NOARG(OfaMSFilterTabPage, LoadExcelBasicCheckHdl_Impl)
return 0;
}
-SfxTabPage* OfaMSFilterTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> OfaMSFilterTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
{
- return new OfaMSFilterTabPage( pParent, *rAttrSet );
+ return VclPtr<OfaMSFilterTabPage>::Create( pParent, *rAttrSet );
}
bool OfaMSFilterTabPage::FillItemSet( SfxItemSet* )
@@ -149,7 +164,7 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet
m_pCheckLBContainer->set_width_request(aControlSize.Width());
m_pCheckLBContainer->set_height_request(aControlSize.Height());
- m_pCheckLB = new MSFltrSimpleTable(*m_pCheckLBContainer);
+ m_pCheckLB = VclPtr<MSFltrSimpleTable>::Create(*m_pCheckLBContainer);
static long aStaticTabs[] = { 3, 0, 20, 40 };
m_pCheckLB->SvSimpleTable::SetTabs( aStaticTabs );
@@ -163,14 +178,25 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet
OfaMSFilterTabPage2::~OfaMSFilterTabPage2()
{
+ disposeOnce();
+}
+
+void OfaMSFilterTabPage2::dispose()
+{
delete pCheckButtonData;
- delete m_pCheckLB;
+ pCheckButtonData = NULL;
+ m_pCheckLB.clear();
+ m_pCheckLBContainer.clear();
+ aHighlightingRB.clear();
+ aShadingRB.clear();
+
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaMSFilterTabPage2::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> OfaMSFilterTabPage2::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
{
- return new OfaMSFilterTabPage2( pParent, *rAttrSet );
+ return VclPtr<OfaMSFilterTabPage2>::Create( pParent, *rAttrSet );
}
bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* )
diff --git a/cui/source/options/optfltr.hxx b/cui/source/options/optfltr.hxx
index 38d280b52a46..221c705f3ae1 100644
--- a/cui/source/options/optfltr.hxx
+++ b/cui/source/options/optfltr.hxx
@@ -27,23 +27,24 @@
class OfaMSFilterTabPage : public SfxTabPage
{
- CheckBox* aWBasicCodeCB;
- CheckBox* aWBasicWbctblCB;
- CheckBox* aWBasicStgCB;
- CheckBox* aEBasicCodeCB;
- CheckBox* aEBasicExectblCB;
- CheckBox* aEBasicStgCB;
- CheckBox* aPBasicCodeCB;
- CheckBox* aPBasicStgCB;
+ VclPtr<CheckBox> aWBasicCodeCB;
+ VclPtr<CheckBox> aWBasicWbctblCB;
+ VclPtr<CheckBox> aWBasicStgCB;
+ VclPtr<CheckBox> aEBasicCodeCB;
+ VclPtr<CheckBox> aEBasicExectblCB;
+ VclPtr<CheckBox> aEBasicStgCB;
+ VclPtr<CheckBox> aPBasicCodeCB;
+ VclPtr<CheckBox> aPBasicStgCB;
- OfaMSFilterTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~OfaMSFilterTabPage();
DECL_LINK(LoadWordBasicCheckHdl_Impl, void *);
DECL_LINK(LoadExcelBasicCheckHdl_Impl, void *);
public:
+ OfaMSFilterTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ virtual ~OfaMSFilterTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -73,8 +74,8 @@ class OfaMSFilterTabPage2 : public SfxTabPage
}
};
- SvSimpleTableContainer* m_pCheckLBContainer;
- MSFltrSimpleTable* m_pCheckLB;
+ VclPtr<SvSimpleTableContainer> m_pCheckLBContainer;
+ VclPtr<MSFltrSimpleTable> m_pCheckLB;
OUString sHeader1, sHeader2;
OUString sChgToFromMath,
sChgToFromWriter,
@@ -83,11 +84,11 @@ class OfaMSFilterTabPage2 : public SfxTabPage
sChgToFromSmartArt;
SvLBoxButtonData* pCheckButtonData;
- RadioButton* aHighlightingRB;
- RadioButton* aShadingRB;
+ VclPtr<RadioButton> aHighlightingRB;
+ VclPtr<RadioButton> aShadingRB;
- OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaMSFilterTabPage2();
+ virtual void dispose() SAL_OVERRIDE;
void InsertEntry( const OUString& _rTxt, sal_IntPtr _nType );
void InsertEntry( const OUString& _rTxt, sal_IntPtr _nType,
@@ -95,8 +96,8 @@ class OfaMSFilterTabPage2 : public SfxTabPage
SvTreeListEntry* GetEntry4Type( sal_IntPtr _nType ) const;
public:
-
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet& rSet );
+ static VclPtr<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/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 2ee207c85976..0a9b466a792c 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -309,11 +309,28 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
OfaMiscTabPage::~OfaMiscTabPage()
{
+ disposeOnce();
}
-SfxTabPage* OfaMiscTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+void OfaMiscTabPage::dispose()
{
- return new OfaMiscTabPage( pParent, *rAttrSet );
+ m_pToolTipsCB.clear();
+ m_pExtHelpCB.clear();
+ m_pFileDlgROImage.clear();
+ m_pFileDlgCB.clear();
+ m_pPrintDlgCB.clear();
+ m_pDocStatusCB.clear();
+ m_pSaveAlwaysCB.clear();
+ m_pYearFrame.clear();
+ m_pYearValueField.clear();
+ m_pToYearFT.clear();
+ m_pCollectUsageInfo.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> OfaMiscTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+{
+ return VclPtr<OfaMiscTabPage>::Create( pParent, *rAttrSet );
}
bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet )
@@ -686,9 +703,35 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
OfaViewTabPage::~OfaViewTabPage()
{
+ disposeOnce();
+}
+
+void OfaViewTabPage::dispose()
+{
delete mpDrawinglayerOpt;
+ mpDrawinglayerOpt = NULL;
delete pCanvasSettings;
+ pCanvasSettings = NULL;
delete pAppearanceCfg;
+ pAppearanceCfg = NULL;
+ m_pWindowSizeMF.clear();
+ m_pIconSizeLB.clear();
+ m_pIconStyleLB.clear();
+ m_pFontAntiAliasing.clear();
+ m_pAAPointLimitLabel.clear();
+ m_pAAPointLimit.clear();
+ m_pMenuIconsLB.clear();
+ m_pFontShowCB.clear();
+ m_pFontHistoryCB.clear();
+ m_pUseHardwareAccell.clear();
+ m_pUseAntiAliase.clear();
+ m_pUseOpenGL.clear();
+ m_pForceOpenGL.clear();
+ m_pMousePosLB.clear();
+ m_pMouseMiddleLB.clear();
+ m_pSelectionCB.clear();
+ m_pSelectionMF.clear();
+ SfxTabPage::dispose();
}
#if defined( UNX )
@@ -714,9 +757,9 @@ IMPL_LINK( OfaViewTabPage, OnSelectionToggled, void*, NOTINTERESTEDIN )
return 0;
}
-SfxTabPage* OfaViewTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> OfaViewTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new OfaViewTabPage(pParent, *rAttrSet);
+ return VclPtr<OfaViewTabPage>::Create(pParent, *rAttrSet);
}
bool OfaViewTabPage::FillItemSet( SfxItemSet* )
@@ -1205,12 +1248,35 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet&
OfaLanguagesTabPage::~OfaLanguagesTabPage()
{
+ disposeOnce();
+}
+
+void OfaLanguagesTabPage::dispose()
+{
delete pLangConfig;
+ pLangConfig = NULL;
+ m_pUserInterfaceLB.clear();
+ m_pLocaleSettingFT.clear();
+ m_pLocaleSettingLB.clear();
+ m_pDecimalSeparatorCB.clear();
+ m_pCurrencyFT.clear();
+ m_pCurrencyLB.clear();
+ m_pDatePatternsFT.clear();
+ m_pDatePatternsED.clear();
+ m_pWesternLanguageLB.clear();
+ m_pWesternLanguageFT.clear();
+ m_pAsianLanguageLB.clear();
+ m_pComplexLanguageLB.clear();
+ m_pCurrentDocCB.clear();
+ m_pAsianSupportCB.clear();
+ m_pCTLSupportCB.clear();
+ m_pIgnoreLanguageChangeCB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaLanguagesTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> OfaLanguagesTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new OfaLanguagesTabPage(pParent, *rAttrSet);
+ return VclPtr<OfaLanguagesTabPage>::Create(pParent, *rAttrSet);
}
static void lcl_UpdateAndDelete(SfxVoidItem* pInvalidItems[], SfxBoolItem* pBoolItems[], sal_uInt16 nCount)
@@ -1290,8 +1356,8 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
xProp->setPropertyValue(sUserLocaleKey, makeAny(aLangString));
Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
// display info
- MessageDialog aBox(this, CUI_RES(RID_SVXSTR_LANGUAGE_RESTART), VCL_MESSAGE_INFO);
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(this, CUI_RES(RID_SVXSTR_LANGUAGE_RESTART), VCL_MESSAGE_INFO);
+ aBox->Execute();
// tell quickstarter to stop being a veto listener
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index f4b4ee73cd86..8dc2397ffe4a 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -44,24 +44,24 @@ class OfaMiscTabPage : public SfxTabPage
{
using TabPage::DeactivatePage;
private:
- CheckBox* m_pToolTipsCB;
- CheckBox* m_pExtHelpCB;
+ VclPtr<CheckBox> m_pToolTipsCB;
+ VclPtr<CheckBox> m_pExtHelpCB;
- FixedImage* m_pFileDlgROImage;
- CheckBox* m_pFileDlgCB;
+ VclPtr<FixedImage> m_pFileDlgROImage;
+ VclPtr<CheckBox> m_pFileDlgCB;
- CheckBox* m_pPrintDlgCB;
+ VclPtr<CheckBox> m_pPrintDlgCB;
- CheckBox* m_pDocStatusCB;
- CheckBox* m_pSaveAlwaysCB;
+ VclPtr<CheckBox> m_pDocStatusCB;
+ VclPtr<CheckBox> m_pSaveAlwaysCB;
- VclContainer* m_pYearFrame;
- NumericField* m_pYearValueField;
- FixedText* m_pToYearFT;
+ VclPtr<VclContainer> m_pYearFrame;
+ VclPtr<NumericField> m_pYearValueField;
+ VclPtr<FixedText> m_pToYearFT;
OUString m_aStrDateInfo;
- CheckBox* m_pCollectUsageInfo;
+ VclPtr<CheckBox> m_pCollectUsageInfo;
DECL_LINK( TwoFigureHdl, NumericField* );
DECL_LINK( TwoFigureConfigHdl, NumericField* );
@@ -75,8 +75,9 @@ protected:
public:
OfaMiscTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaMiscTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -88,30 +89,30 @@ class SvtTabAppearanceCfg;
class OfaViewTabPage : public SfxTabPage
{
private:
- MetricField* m_pWindowSizeMF;
- ListBox* m_pIconSizeLB;
- ListBox* m_pIconStyleLB;
+ VclPtr<MetricField> m_pWindowSizeMF;
+ VclPtr<ListBox> m_pIconSizeLB;
+ VclPtr<ListBox> m_pIconStyleLB;
- CheckBox* m_pFontAntiAliasing;
- FixedText* m_pAAPointLimitLabel;
- MetricField* m_pAAPointLimit;
+ VclPtr<CheckBox> m_pFontAntiAliasing;
+ VclPtr<FixedText> m_pAAPointLimitLabel;
+ VclPtr<MetricField> m_pAAPointLimit;
- ListBox* m_pMenuIconsLB;
+ VclPtr<ListBox> m_pMenuIconsLB;
- CheckBox* m_pFontShowCB;
- CheckBox* m_pFontHistoryCB;
+ VclPtr<CheckBox> m_pFontShowCB;
+ VclPtr<CheckBox> m_pFontHistoryCB;
- CheckBox* m_pUseHardwareAccell;
- CheckBox* m_pUseAntiAliase;
- CheckBox* m_pUseOpenGL;
- CheckBox* m_pForceOpenGL;
+ VclPtr<CheckBox> m_pUseHardwareAccell;
+ VclPtr<CheckBox> m_pUseAntiAliase;
+ VclPtr<CheckBox> m_pUseOpenGL;
+ VclPtr<CheckBox> m_pForceOpenGL;
- ListBox* m_pMousePosLB;
- ListBox* m_pMouseMiddleLB;
+ VclPtr<ListBox> m_pMousePosLB;
+ VclPtr<ListBox> m_pMouseMiddleLB;
// #i97672#
- CheckBox* m_pSelectionCB;
- MetricField* m_pSelectionMF;
+ VclPtr<CheckBox> m_pSelectionCB;
+ VclPtr<MetricField> m_pSelectionMF;
sal_uInt16 nSizeLB_InitialSelection;
sal_uInt16 nStyleLB_InitialSelection;
@@ -132,8 +133,9 @@ private:
public:
OfaViewTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaViewTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -142,23 +144,23 @@ public:
struct LanguageConfig_Impl;
class OfaLanguagesTabPage : public SfxTabPage
{
- ListBox* m_pUserInterfaceLB;
- FixedText* m_pLocaleSettingFT;
- SvxLanguageBox* m_pLocaleSettingLB;
- CheckBox* m_pDecimalSeparatorCB;
- FixedText* m_pCurrencyFT;
- ListBox* m_pCurrencyLB;
- FixedText* m_pDatePatternsFT;
- Edit* m_pDatePatternsED;
-
- SvxLanguageBox* m_pWesternLanguageLB;
- FixedText* m_pWesternLanguageFT;
- SvxLanguageBox* m_pAsianLanguageLB;
- SvxLanguageBox* m_pComplexLanguageLB;
- CheckBox* m_pCurrentDocCB;
- CheckBox* m_pAsianSupportCB;
- CheckBox* m_pCTLSupportCB;
- CheckBox* m_pIgnoreLanguageChangeCB;
+ VclPtr<ListBox> m_pUserInterfaceLB;
+ VclPtr<FixedText> m_pLocaleSettingFT;
+ VclPtr<SvxLanguageBox> m_pLocaleSettingLB;
+ VclPtr<CheckBox> m_pDecimalSeparatorCB;
+ VclPtr<FixedText> m_pCurrencyFT;
+ VclPtr<ListBox> m_pCurrencyLB;
+ VclPtr<FixedText> m_pDatePatternsFT;
+ VclPtr<Edit> m_pDatePatternsED;
+
+ VclPtr<SvxLanguageBox> m_pWesternLanguageLB;
+ VclPtr<FixedText> m_pWesternLanguageFT;
+ VclPtr<SvxLanguageBox> m_pAsianLanguageLB;
+ VclPtr<SvxLanguageBox> m_pComplexLanguageLB;
+ VclPtr<CheckBox> m_pCurrentDocCB;
+ VclPtr<CheckBox> m_pAsianSupportCB;
+ VclPtr<CheckBox> m_pCTLSupportCB;
+ VclPtr<CheckBox> m_pIgnoreLanguageChangeCB;
bool m_bOldAsian;
bool m_bOldCtl;
@@ -176,8 +178,9 @@ class OfaLanguagesTabPage : public SfxTabPage
public:
OfaLanguagesTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaLanguagesTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<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/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 9cb1c1b82ef1..f102d9e50eb8 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -166,7 +166,7 @@ struct SvxGeneralTabPage::Row
// which row is it?
RowType eRow;
// row label
- FixedText* pLabel;
+ VclPtr<FixedText> pLabel;
// first and last field in the row (last is exclusive)
unsigned nFirstField, nLastField;
@@ -191,7 +191,7 @@ struct SvxGeneralTabPage::Field
// which field is this? (in vFieldInfo[] above)
unsigned iField;
// edit box
- Edit *pEdit;
+ VclPtr<Edit> pEdit;
public:
Field (Edit *pEdit_, unsigned iField_)
@@ -219,11 +219,16 @@ SvxGeneralTabPage::SvxGeneralTabPage(vcl::Window* pParent, const SfxItemSet& rCo
SetLinks();
}
+SvxGeneralTabPage::~SvxGeneralTabPage()
+{
+ disposeOnce();
+}
-
-SvxGeneralTabPage::~SvxGeneralTabPage ()
-{ }
-
+void SvxGeneralTabPage::dispose()
+{
+ m_pUseDataCB.clear();
+ SfxTabPage::dispose();
+}
// Initializes the titles and the edit boxes,
@@ -296,9 +301,9 @@ void SvxGeneralTabPage::SetLinks ()
-SfxTabPage* SvxGeneralTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxGeneralTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return ( new SvxGeneralTabPage( pParent, *rAttrSet ) );
+ return VclPtr<SvxGeneralTabPage>::Create( pParent, *rAttrSet );
}
diff --git a/cui/source/options/opthtml.cxx b/cui/source/options/opthtml.cxx
index b95873784cd0..8298bd6c6e6b 100644
--- a/cui/source/options/opthtml.cxx
+++ b/cui/source/options/opthtml.cxx
@@ -86,12 +86,34 @@ SfxTabPage( pParent, "OptHtmlPage" , "cui/ui/opthtmlpage.ui", &rSet )
OfaHtmlTabPage::~OfaHtmlTabPage()
{
+ disposeOnce();
}
-SfxTabPage* OfaHtmlTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+void OfaHtmlTabPage::dispose()
{
- return new OfaHtmlTabPage(pParent, *rAttrSet);
+ aSize1NF.clear();
+ aSize2NF.clear();
+ aSize3NF.clear();
+ aSize4NF.clear();
+ aSize5NF.clear();
+ aSize6NF.clear();
+ aSize7NF.clear();
+ aNumbersEnglishUSCB.clear();
+ aUnknownTagCB.clear();
+ aIgnoreFontNamesCB.clear();
+ aExportLB.clear();
+ aStarBasicCB.clear();
+ aStarBasicWarningCB.clear();
+ aPrintExtensionCB.clear();
+ aSaveGrfLocalCB.clear();
+ aCharSetLB.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> OfaHtmlTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
+{
+ return VclPtr<OfaHtmlTabPage>::Create(pParent, *rAttrSet);
}
bool OfaHtmlTabPage::FillItemSet( SfxItemSet* )
diff --git a/cui/source/options/opthtml.hxx b/cui/source/options/opthtml.hxx
index c79e2393e831..6977795feb65 100644
--- a/cui/source/options/opthtml.hxx
+++ b/cui/source/options/opthtml.hxx
@@ -30,34 +30,35 @@
class OfaHtmlTabPage : public SfxTabPage
{
- NumericField* aSize1NF;
- NumericField* aSize2NF;
- NumericField* aSize3NF;
- NumericField* aSize4NF;
- NumericField* aSize5NF;
- NumericField* aSize6NF;
- NumericField* aSize7NF;
+ VclPtr<NumericField> aSize1NF;
+ VclPtr<NumericField> aSize2NF;
+ VclPtr<NumericField> aSize3NF;
+ VclPtr<NumericField> aSize4NF;
+ VclPtr<NumericField> aSize5NF;
+ VclPtr<NumericField> aSize6NF;
+ VclPtr<NumericField> aSize7NF;
- CheckBox* aNumbersEnglishUSCB;
- CheckBox* aUnknownTagCB;
- CheckBox* aIgnoreFontNamesCB;
+ VclPtr<CheckBox> aNumbersEnglishUSCB;
+ VclPtr<CheckBox> aUnknownTagCB;
+ VclPtr<CheckBox> aIgnoreFontNamesCB;
- ListBox* aExportLB;
- CheckBox* aStarBasicCB;
- CheckBox* aStarBasicWarningCB;
- CheckBox* aPrintExtensionCB;
- CheckBox* aSaveGrfLocalCB;
- SvxTextEncodingBox* aCharSetLB;
+ VclPtr<ListBox> aExportLB;
+ VclPtr<CheckBox> aStarBasicCB;
+ VclPtr<CheckBox> aStarBasicWarningCB;
+ VclPtr<CheckBox> aPrintExtensionCB;
+ VclPtr<CheckBox> aSaveGrfLocalCB;
+ VclPtr<SvxTextEncodingBox> aCharSetLB;
DECL_LINK(ExportHdl_Impl, ListBox*);
DECL_LINK(CheckBoxHdl_Impl, CheckBox*);
- OfaHtmlTabPage(vcl::Window* pParent, const SfxItemSet& rSet);
- virtual ~OfaHtmlTabPage();
public:
+ virtual ~OfaHtmlTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet );
+ OfaHtmlTabPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ static VclPtr<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/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 17e97d2853e3..48e2626a31ec 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -217,11 +217,33 @@ SvxProxyTabPage::SvxProxyTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
SvxProxyTabPage::~SvxProxyTabPage()
{
+ disposeOnce();
}
-SfxTabPage* SvxProxyTabPage::Create(vcl::Window* pParent, const SfxItemSet* rAttrSet )
+void SvxProxyTabPage::dispose()
{
- return new SvxProxyTabPage(pParent, *rAttrSet);
+ m_pProxyModeLB.clear();
+ m_pHttpProxyFT.clear();
+ m_pHttpProxyED.clear();
+ m_pHttpPortFT.clear();
+ m_pHttpPortED.clear();
+ m_pHttpsProxyFT.clear();
+ m_pHttpsProxyED.clear();
+ m_pHttpsPortFT.clear();
+ m_pHttpsPortED.clear();
+ m_pFtpProxyFT.clear();
+ m_pFtpProxyED.clear();
+ m_pFtpPortFT.clear();
+ m_pFtpPortED.clear();
+ m_pNoProxyForFT.clear();
+ m_pNoProxyForED.clear();
+ m_pNoProxyDescFT.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> SvxProxyTabPage::Create(vcl::Window* pParent, const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SvxProxyTabPage>::Create(pParent, *rAttrSet);
}
void SvxProxyTabPage::ReadConfigData_Impl()
@@ -626,16 +648,35 @@ SvxSecurityTabPage::SvxSecurityTabPage(vcl::Window* pParent, const SfxItemSet& r
SvxSecurityTabPage::~SvxSecurityTabPage()
{
- delete mpCertPathDlg;
+ disposeOnce();
+}
+void SvxSecurityTabPage::dispose()
+{
delete mpSecOptions;
- delete mpSecOptDlg;
+ mpSecOptions = NULL;
+ mpCertPathDlg.disposeAndClear();
+ mpSecOptDlg.clear();
+ m_pSecurityOptionsPB.clear();
+ m_pSavePasswordsCB.clear();
+ m_pShowConnectionsPB.clear();
+ m_pMasterPasswordCB.clear();
+ m_pMasterPasswordFT.clear();
+ m_pMasterPasswordPB.clear();
+ m_pMacroSecFrame.clear();
+ m_pMacroSecPB.clear();
+ m_pCertFrame.clear();
+ m_pCertPathPB.clear();
+ m_pTSAURLsFrame.clear();
+ m_pTSAURLsPB.clear();
+
+ SfxTabPage::dispose();
}
IMPL_LINK_NOARG(SvxSecurityTabPage, SecurityOptionsHdl)
{
if ( !mpSecOptDlg )
- mpSecOptDlg = new svx::SecurityOptionsDialog( this, mpSecOptions );
+ mpSecOptDlg = VclPtr<svx::SecurityOptionsDialog>::Create( this, mpSecOptions );
mpSecOptDlg->Execute();
return 0;
}
@@ -667,8 +708,8 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, SavePasswordHdl)
}
else
{
- QueryBox aQuery( this, WB_YES_NO|WB_DEF_NO, m_sPasswordStoringDeactivateStr );
- sal_uInt16 nRet = aQuery.Execute();
+ ScopedVclPtrInstance< QueryBox > aQuery( this, WB_YES_NO|WB_DEF_NO, m_sPasswordStoringDeactivateStr );
+ sal_uInt16 nRet = aQuery->Execute();
if( RET_YES == nRet )
{
@@ -764,8 +805,8 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, ShowPasswordsHdl)
if ( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword( Reference< task::XInteractionHandler>() ) )
{
- svx::WebConnectionInfoDialog aDlg( this );
- aDlg.Execute();
+ ScopedVclPtrInstance< svx::WebConnectionInfoDialog > aDlg(this);
+ aDlg->Execute();
}
}
catch (const Exception&)
@@ -776,15 +817,15 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, ShowPasswordsHdl)
IMPL_LINK_NOARG(SvxSecurityTabPage, CertPathPBHdl)
{
if (!mpCertPathDlg)
- mpCertPathDlg = new CertPathDialog(this);
+ mpCertPathDlg = VclPtr<CertPathDialog>::Create(this);
OUString sOrig = mpCertPathDlg->getDirectory();
short nRet = mpCertPathDlg->Execute();
if (nRet == RET_OK && sOrig != mpCertPathDlg->getDirectory())
{
- MessageDialog aWarnBox(this, CUI_RES(RID_SVXSTR_OPTIONS_RESTART), VCL_MESSAGE_INFO);
- aWarnBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aWarnBox(this, CUI_RES(RID_SVXSTR_OPTIONS_RESTART), VCL_MESSAGE_INFO);
+ aWarnBox->Execute();
}
return 0;
@@ -795,12 +836,10 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, TSAURLsPBHdl)
// Unlike the mpCertPathDlg, we *don't* keep the same dialog object around between
// invocations. Seems clearer to my little brain that way.
- TSAURLsDialog* pTSAURLsDlg = new TSAURLsDialog(this);
+ ScopedVclPtrInstance<TSAURLsDialog> pTSAURLsDlg(this);
pTSAURLsDlg->Execute();
- delete pTSAURLsDlg;
-
return 0;
}
@@ -875,9 +914,9 @@ void SvxSecurityTabPage::InitControls()
}
}
-SfxTabPage* SvxSecurityTabPage::Create(vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxSecurityTabPage::Create(vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new SvxSecurityTabPage(pParent, *rAttrSet);
+ return VclPtr<SfxTabPage>(new SvxSecurityTabPage(pParent, *rAttrSet), SAL_NO_ACQUIRE);
}
void SvxSecurityTabPage::ActivatePage( const SfxItemSet& )
@@ -972,14 +1011,28 @@ SvxEMailTabPage::SvxEMailTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
SvxEMailTabPage::~SvxEMailTabPage()
{
+ disposeOnce();
+}
+
+void SvxEMailTabPage::dispose()
+{
delete pImpl;
+ pImpl = NULL;
+ m_pMailContainer.clear();
+ m_pMailerURLFI.clear();
+ m_pMailerURLED.clear();
+ m_pMailerURLPB.clear();
+ m_pSuppressHiddenContainer.clear();
+ m_pSuppressHiddenFI.clear();
+ m_pSuppressHidden.clear();
+ SfxTabPage::dispose();
}
/* -------------------------------------------------------------------------*/
-SfxTabPage* SvxEMailTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxEMailTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new SvxEMailTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxEMailTabPage>::Create(pParent, *rAttrSet);
}
/* -------------------------------------------------------------------------*/
diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx
index 2d137ba7bc33..d1b4362794ea 100644
--- a/cui/source/options/optinet2.hxx
+++ b/cui/source/options/optinet2.hxx
@@ -58,26 +58,26 @@ class SvxProxyTabPage : public SfxTabPage
{
private:
- ListBox* m_pProxyModeLB;
+ VclPtr<ListBox> m_pProxyModeLB;
- FixedText* m_pHttpProxyFT;
- SvxNoSpaceEdit* m_pHttpProxyED;
- FixedText* m_pHttpPortFT;
- SvxNoSpaceEdit* m_pHttpPortED;
+ VclPtr<FixedText> m_pHttpProxyFT;
+ VclPtr<SvxNoSpaceEdit> m_pHttpProxyED;
+ VclPtr<FixedText> m_pHttpPortFT;
+ VclPtr<SvxNoSpaceEdit> m_pHttpPortED;
- FixedText* m_pHttpsProxyFT;
- SvxNoSpaceEdit* m_pHttpsProxyED;
- FixedText* m_pHttpsPortFT;
- SvxNoSpaceEdit* m_pHttpsPortED;
+ VclPtr<FixedText> m_pHttpsProxyFT;
+ VclPtr<SvxNoSpaceEdit> m_pHttpsProxyED;
+ VclPtr<FixedText> m_pHttpsPortFT;
+ VclPtr<SvxNoSpaceEdit> m_pHttpsPortED;
- FixedText* m_pFtpProxyFT;
- SvxNoSpaceEdit* m_pFtpProxyED;
- FixedText* m_pFtpPortFT;
- SvxNoSpaceEdit* m_pFtpPortED;
+ VclPtr<FixedText> m_pFtpProxyFT;
+ VclPtr<SvxNoSpaceEdit> m_pFtpProxyED;
+ VclPtr<FixedText> m_pFtpPortFT;
+ VclPtr<SvxNoSpaceEdit> m_pFtpPortED;
- FixedText* m_pNoProxyForFT;
- Edit* m_pNoProxyForED;
- FixedText* m_pNoProxyDescFT;
+ VclPtr<FixedText> m_pNoProxyForFT;
+ VclPtr<Edit> m_pNoProxyForED;
+ VclPtr<FixedText> m_pNoProxyDescFT;
const OUString aProxyModePN;
const OUString aHttpProxyPN;
@@ -98,11 +98,11 @@ private:
DECL_LINK( ProxyHdl_Impl, ListBox * );
DECL_LINK( LoseFocusHdl_Impl, Edit * );
+public:
SvxProxyTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxProxyTabPage();
-
-public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
};
@@ -130,28 +130,28 @@ class SvxSecurityTabPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
- PushButton* m_pSecurityOptionsPB;
+ VclPtr<PushButton> m_pSecurityOptionsPB;
- CheckBox* m_pSavePasswordsCB;
- PushButton* m_pShowConnectionsPB;
+ VclPtr<CheckBox> m_pSavePasswordsCB;
+ VclPtr<PushButton> m_pShowConnectionsPB;
- CheckBox* m_pMasterPasswordCB;
- FixedText* m_pMasterPasswordFT;
- PushButton* m_pMasterPasswordPB;
+ VclPtr<CheckBox> m_pMasterPasswordCB;
+ VclPtr<FixedText> m_pMasterPasswordFT;
+ VclPtr<PushButton> m_pMasterPasswordPB;
- VclContainer* m_pMacroSecFrame;
- PushButton* m_pMacroSecPB;
+ VclPtr<VclContainer> m_pMacroSecFrame;
+ VclPtr<PushButton> m_pMacroSecPB;
- VclContainer* m_pCertFrame;
- PushButton* m_pCertPathPB;
+ VclPtr<VclContainer> m_pCertFrame;
+ VclPtr<PushButton> m_pCertPathPB;
- VclContainer* m_pTSAURLsFrame;
- PushButton* m_pTSAURLsPB;
+ VclPtr<VclContainer> m_pTSAURLsFrame;
+ VclPtr<PushButton> m_pTSAURLsPB;
SvtSecurityOptions* mpSecOptions;
- svx::SecurityOptionsDialog* mpSecOptDlg;
+ VclPtr<svx::SecurityOptionsDialog> mpSecOptDlg;
- CertPathDialog* mpCertPathDlg;
+ VclPtr<CertPathDialog> mpCertPathDlg;
OUString m_sPasswordStoringDeactivateStr;
@@ -168,13 +168,14 @@ private:
SvxSecurityTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxSecurityTabPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
};
@@ -182,13 +183,13 @@ public:
struct SvxEMailTabPage_Impl;
class SvxEMailTabPage : public SfxTabPage
{
- VclContainer* m_pMailContainer;
- FixedImage* m_pMailerURLFI;
- Edit* m_pMailerURLED;
- PushButton* m_pMailerURLPB;
- VclContainer* m_pSuppressHiddenContainer;
- FixedImage* m_pSuppressHiddenFI;
- CheckBox* m_pSuppressHidden;
+ VclPtr<VclContainer> m_pMailContainer;
+ VclPtr<FixedImage> m_pMailerURLFI;
+ VclPtr<Edit> m_pMailerURLED;
+ VclPtr<PushButton> m_pMailerURLPB;
+ VclPtr<VclContainer> m_pSuppressHiddenContainer;
+ VclPtr<FixedImage> m_pSuppressHiddenFI;
+ VclPtr<CheckBox> m_pSuppressHidden;
OUString m_sDefaultFilterName;
@@ -199,8 +200,9 @@ class SvxEMailTabPage : public SfxTabPage
public:
SvxEMailTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxEMailTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<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/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 3ad13eb797ba..95471d1121c5 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -161,7 +161,7 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet&
aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
pJavaListContainer->set_width_request(aControlSize.Width());
pJavaListContainer->set_height_request(aControlSize.Height());
- m_pJavaList = new SvxJavaListBox(*pJavaListContainer, m_sAccessibilityText);
+ m_pJavaList = VclPtr<SvxJavaListBox>::Create(*pJavaListContainer, m_sAccessibilityText);
long aStaticTabs[]= { 4, 0, 0, 0, 0 };
@@ -202,9 +202,14 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet&
SvxJavaOptionsPage::~SvxJavaOptionsPage()
{
- delete m_pJavaList;
- delete m_pParamDlg;
- delete m_pPathDlg;
+ disposeOnce();
+}
+
+void SvxJavaOptionsPage::dispose()
+{
+ m_pJavaList.disposeAndClear();
+ m_pParamDlg.disposeAndClear();
+ m_pPathDlg.disposeAndClear();
ClearJavaInfo();
#if HAVE_FEATURE_JAVA
std::vector< JavaInfo* >::iterator pIter;
@@ -213,9 +218,20 @@ SvxJavaOptionsPage::~SvxJavaOptionsPage()
JavaInfo* pInfo = *pIter;
jfw_freeJavaInfo( pInfo );
}
+ m_aAddedInfos.clear();
jfw_unlock();
#endif
+ m_pJavaEnableCB.clear();
+ m_pJavaBox.clear();
+ m_pJavaPathText.clear();
+ m_pAddBtn.clear();
+ m_pParameterBtn.clear();
+ m_pClassPathBtn.clear();
+ m_pExpertConfigBtn.clear();
+ m_pExperimentalCB.clear();
+ m_pMacroCB.clear();
+ SfxTabPage::dispose();
}
@@ -290,7 +306,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl)
Sequence< OUString > aParameterList;
if ( !m_pParamDlg )
{
- m_pParamDlg = new SvxJavaParameterDlg( this );
+ m_pParamDlg = VclPtr<SvxJavaParameterDlg>::Create( this );
javaFrameworkError eErr = jfw_getVMParameters( &m_parParameters, &m_nParamSize );
if ( JFW_E_NONE == eErr && m_parParameters && m_nParamSize > 0 )
{
@@ -320,8 +336,8 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl)
(void)eErr;
if ( bRunning )
{
- MessageDialog aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
- aWarnBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
+ aWarnBox->Execute();
}
}
}
@@ -340,7 +356,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl)
if ( !m_pPathDlg )
{
- m_pPathDlg = new SvxJavaClassPathDlg( this );
+ m_pPathDlg = VclPtr<SvxJavaClassPathDlg>::Create( this );
javaFrameworkError eErr = jfw_getUserClassPath( &m_pClassPath );
if ( JFW_E_NONE == eErr && m_pClassPath )
{
@@ -365,8 +381,8 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl)
(void)eErr;
if ( bRunning )
{
- MessageDialog aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
- aWarnBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
+ aWarnBox->Execute();
}
}
}
@@ -421,7 +437,7 @@ IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt )
IMPL_LINK_NOARG( SvxJavaOptionsPage, ExpertConfigHdl_Impl )
{
- CuiAboutConfigTabPage* m_pExpertConfigDlg = new CuiAboutConfigTabPage(this);
+ ScopedVclPtrInstance< CuiAboutConfigTabPage > m_pExpertConfigDlg(this);
m_pExpertConfigDlg->Reset();//initialize and reset function
if( RET_OK == m_pExpertConfigDlg->Execute() )
@@ -429,7 +445,7 @@ IMPL_LINK_NOARG( SvxJavaOptionsPage, ExpertConfigHdl_Impl )
m_pExpertConfigDlg->FillItemSet();//save changes if there are any
}
- delete m_pExpertConfigDlg;
+ m_pExpertConfigDlg.disposeAndClear();
return 0;
}
@@ -614,13 +630,13 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
}
else if ( JFW_E_NOT_RECOGNIZED == eErr )
{
- MessageDialog aErrBox( this, CUI_RES( RID_SVXSTR_JRE_NOT_RECOGNIZED ) );
- aErrBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrBox( this, CUI_RES( RID_SVXSTR_JRE_NOT_RECOGNIZED ) );
+ aErrBox->Execute();
}
else if ( JFW_E_FAILED_VERSION == eErr )
{
- MessageDialog aErrBox( this, CUI_RES( RID_SVXSTR_JRE_FAILED_VERSION ) );
- aErrBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrBox( this, CUI_RES( RID_SVXSTR_JRE_FAILED_VERSION ) );
+ aErrBox->Execute();
}
if ( bStartAgain )
@@ -635,9 +651,9 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
-SfxTabPage* SvxJavaOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxJavaOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return ( new SvxJavaOptionsPage( pParent, *rAttrSet ) );
+ return VclPtr<SvxJavaOptionsPage>::Create( pParent, *rAttrSet );
}
@@ -805,12 +821,19 @@ SvxJavaParameterDlg::SvxJavaParameterDlg( vcl::Window* pParent ) :
EnableRemoveButton();
}
-
-
SvxJavaParameterDlg::~SvxJavaParameterDlg()
{
+ disposeOnce();
}
+void SvxJavaParameterDlg::dispose()
+{
+ m_pParameterEdit.clear();
+ m_pAssignBtn.clear();
+ m_pAssignedList.clear();
+ m_pRemoveBtn.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(SvxJavaParameterDlg, ModifyHdl_Impl)
@@ -939,12 +962,24 @@ SvxJavaClassPathDlg::SvxJavaClassPathDlg(vcl::Window* pParent)
SvxJavaClassPathDlg::~SvxJavaClassPathDlg()
{
- sal_Int32 i, nCount = m_pPathList->GetEntryCount();
- for ( i = 0; i < nCount; ++i )
- delete static_cast< OUString* >( m_pPathList->GetEntryData(i) );
+ disposeOnce();
}
-
+void SvxJavaClassPathDlg::dispose()
+{
+ if (m_pPathList)
+ {
+ sal_Int32 i, nCount = m_pPathList->GetEntryCount();
+ for ( i = 0; i < nCount; ++i )
+ delete static_cast< OUString* >( m_pPathList->GetEntryData(i) );
+ m_pPathList = NULL;
+ }
+ m_pPathList.clear();
+ m_pAddArchiveBtn.clear();
+ m_pAddPathBtn.clear();
+ m_pRemoveBtn.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddArchiveHdl_Impl)
{
diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx
index 4b45f37265ea..ffe299b7c628 100644
--- a/cui/source/options/optjava.hxx
+++ b/cui/source/options/optjava.hxx
@@ -51,17 +51,17 @@ class SvxJavaListBox;
class SvxJavaOptionsPage : public SfxTabPage
{
private:
- CheckBox* m_pJavaEnableCB;
- VclContainer* m_pJavaBox;
- SvxJavaListBox* m_pJavaList;
- FixedText* m_pJavaPathText;
- PushButton* m_pAddBtn;
- PushButton* m_pParameterBtn;
- PushButton* m_pClassPathBtn;
- PushButton* m_pExpertConfigBtn;
-
- SvxJavaParameterDlg* m_pParamDlg;
- SvxJavaClassPathDlg* m_pPathDlg;
+ VclPtr<CheckBox> m_pJavaEnableCB;
+ VclPtr<VclContainer> m_pJavaBox;
+ VclPtr<SvxJavaListBox> m_pJavaList;
+ VclPtr<FixedText> m_pJavaPathText;
+ VclPtr<PushButton> m_pAddBtn;
+ VclPtr<PushButton> m_pParameterBtn;
+ VclPtr<PushButton> m_pClassPathBtn;
+ VclPtr<PushButton> m_pExpertConfigBtn;
+
+ VclPtr<SvxJavaParameterDlg> m_pParamDlg;
+ VclPtr<SvxJavaClassPathDlg> m_pPathDlg;
#if HAVE_FEATURE_JAVA
JavaInfo** m_parJavaInfo;
@@ -75,8 +75,8 @@ private:
OUString m_sAddDialogText;
Idle m_aResetIdle;
- CheckBox* m_pExperimentalCB;
- CheckBox* m_pMacroCB;
+ VclPtr<CheckBox> m_pExperimentalCB;
+ VclPtr<CheckBox> m_pMacroCB;
::std::vector< JavaInfo* >
m_aAddedInfos;
@@ -107,8 +107,9 @@ private:
public:
SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxJavaOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -120,11 +121,11 @@ public:
class SvxJavaParameterDlg : public ModalDialog
{
private:
- Edit* m_pParameterEdit;
- PushButton* m_pAssignBtn;
+ VclPtr<Edit> m_pParameterEdit;
+ VclPtr<PushButton> m_pAssignBtn;
- ListBox* m_pAssignedList;
- PushButton* m_pRemoveBtn;
+ VclPtr<ListBox> m_pAssignedList;
+ VclPtr<PushButton> m_pRemoveBtn;
DECL_LINK(ModifyHdl_Impl, void *);
DECL_LINK(AssignHdl_Impl, void *);
@@ -141,6 +142,7 @@ private:
public:
SvxJavaParameterDlg( vcl::Window* pParent );
virtual ~SvxJavaParameterDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
@@ -153,10 +155,10 @@ public:
class SvxJavaClassPathDlg : public ModalDialog
{
private:
- ListBox* m_pPathList;
- PushButton* m_pAddArchiveBtn;
- PushButton* m_pAddPathBtn;
- PushButton* m_pRemoveBtn;
+ VclPtr<ListBox> m_pPathList;
+ VclPtr<PushButton> m_pAddArchiveBtn;
+ VclPtr<PushButton> m_pAddPathBtn;
+ VclPtr<PushButton> m_pRemoveBtn;
OUString m_sOldPath;
@@ -173,6 +175,7 @@ private:
public:
SvxJavaClassPathDlg( vcl::Window* pParent );
virtual ~SvxJavaClassPathDlg();
+ virtual void dispose() SAL_OVERRIDE;
inline const OUString& GetOldPath() const { return m_sOldPath; }
inline void SetFocus() { m_pPathList->GrabFocus(); }
diff --git a/cui/source/options/optjsearch.cxx b/cui/source/options/optjsearch.cxx
index 96bc0146811f..2bd5401acac5 100644
--- a/cui/source/options/optjsearch.cxx
+++ b/cui/source/options/optjsearch.cxx
@@ -55,15 +55,38 @@ SvxJSearchOptionsPage::SvxJSearchOptionsPage( vcl::Window* pParent, const SfxIte
nTransliterationFlags = 0x00000000;
}
-
SvxJSearchOptionsPage::~SvxJSearchOptionsPage()
{
+ disposeOnce();
}
+void SvxJSearchOptionsPage::dispose()
+{
+ m_pMatchCase.clear();
+ m_pMatchFullHalfWidth.clear();
+ m_pMatchHiraganaKatakana.clear();
+ m_pMatchContractions.clear();
+ m_pMatchMinusDashChoon.clear();
+ m_pMatchRepeatCharMarks.clear();
+ m_pMatchVariantFormKanji.clear();
+ m_pMatchOldKanaForms.clear();
+ m_pMatchDiziDuzu.clear();
+ m_pMatchBavaHafa.clear();
+ m_pMatchTsithichiDhizi.clear();
+ m_pMatchHyuiyuByuvyu.clear();
+ m_pMatchSesheZeje.clear();
+ m_pMatchIaiya.clear();
+ m_pMatchKiku.clear();
+ m_pMatchProlongedSoundMark.clear();
+ m_pIgnorePunctuation.clear();
+ m_pIgnoreWhitespace.clear();
+ m_pIgnoreMiddleDot.clear();
+ SfxTabPage::dispose();
+}
-SfxTabPage* SvxJSearchOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxJSearchOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxJSearchOptionsPage( pParent, *rSet );
+ return VclPtr<SvxJSearchOptionsPage>::Create( pParent, *rSet );
}
diff --git a/cui/source/options/optjsearch.hxx b/cui/source/options/optjsearch.hxx
index bb5ac7a4606e..26fed46c9c3a 100644
--- a/cui/source/options/optjsearch.hxx
+++ b/cui/source/options/optjsearch.hxx
@@ -32,39 +32,37 @@ class SfxItemSet;
class SvxJSearchOptionsPage : public SfxTabPage
{
private:
- CheckBox* m_pMatchCase;
- CheckBox* m_pMatchFullHalfWidth;
- CheckBox* m_pMatchHiraganaKatakana;
- CheckBox* m_pMatchContractions;
- CheckBox* m_pMatchMinusDashChoon;
- CheckBox* m_pMatchRepeatCharMarks;
- CheckBox* m_pMatchVariantFormKanji;
- CheckBox* m_pMatchOldKanaForms;
- CheckBox* m_pMatchDiziDuzu;
- CheckBox* m_pMatchBavaHafa;
- CheckBox* m_pMatchTsithichiDhizi;
- CheckBox* m_pMatchHyuiyuByuvyu;
- CheckBox* m_pMatchSesheZeje;
- CheckBox* m_pMatchIaiya;
- CheckBox* m_pMatchKiku;
- CheckBox* m_pMatchProlongedSoundMark;
-
- CheckBox* m_pIgnorePunctuation;
- CheckBox* m_pIgnoreWhitespace;
- CheckBox* m_pIgnoreMiddleDot;
+ VclPtr<CheckBox> m_pMatchCase;
+ VclPtr<CheckBox> m_pMatchFullHalfWidth;
+ VclPtr<CheckBox> m_pMatchHiraganaKatakana;
+ VclPtr<CheckBox> m_pMatchContractions;
+ VclPtr<CheckBox> m_pMatchMinusDashChoon;
+ VclPtr<CheckBox> m_pMatchRepeatCharMarks;
+ VclPtr<CheckBox> m_pMatchVariantFormKanji;
+ VclPtr<CheckBox> m_pMatchOldKanaForms;
+ VclPtr<CheckBox> m_pMatchDiziDuzu;
+ VclPtr<CheckBox> m_pMatchBavaHafa;
+ VclPtr<CheckBox> m_pMatchTsithichiDhizi;
+ VclPtr<CheckBox> m_pMatchHyuiyuByuvyu;
+ VclPtr<CheckBox> m_pMatchSesheZeje;
+ VclPtr<CheckBox> m_pMatchIaiya;
+ VclPtr<CheckBox> m_pMatchKiku;
+ VclPtr<CheckBox> m_pMatchProlongedSoundMark;
+
+ VclPtr<CheckBox> m_pIgnorePunctuation;
+ VclPtr<CheckBox> m_pIgnoreWhitespace;
+ VclPtr<CheckBox> m_pIgnoreMiddleDot;
sal_Int32 nTransliterationFlags;
bool bSaveOptions;
sal_Int32 GetTransliterationFlags_Impl();
-protected:
- SvxJSearchOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
-
public:
- virtual ~SvxJSearchOptionsPage();
-
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ SvxJSearchOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ virtual ~SvxJSearchOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 1b72de3e8c23..54d4fe51598f 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -329,10 +329,10 @@ static inline OUString lcl_GetPropertyName( EID_OPTIONS eEntryId )
class OptionsBreakSet : public ModalDialog
{
- VclFrame* m_pBeforeFrame;
- VclFrame* m_pAfterFrame;
- VclFrame* m_pMinimalFrame;
- NumericField* m_pBreakNF;
+ VclPtr<VclFrame> m_pBeforeFrame;
+ VclPtr<VclFrame> m_pAfterFrame;
+ VclPtr<VclFrame> m_pMinimalFrame;
+ VclPtr<NumericField> m_pBreakNF;
public:
OptionsBreakSet(vcl::Window* pParent, sal_uInt16 nRID)
@@ -364,6 +364,15 @@ public:
get(m_pBreakNF, "wordlength");
}
}
+ virtual ~OptionsBreakSet() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ m_pBeforeFrame.clear();
+ m_pAfterFrame.clear();
+ m_pMinimalFrame.clear();
+ m_pBreakNF.clear();
+ ModalDialog::dispose();
+ }
NumericField& GetNumericFld()
{
@@ -1122,14 +1131,32 @@ SvxLinguTabPage::SvxLinguTabPage( vcl::Window* pParent, const SfxItemSet& rSet )
SvxLinguTabPage::~SvxLinguTabPage()
{
- if (pLinguData)
- delete pLinguData;
+ disposeOnce();
+}
+
+void SvxLinguTabPage::dispose()
+{
+ delete pLinguData;
+ pLinguData = NULL;
+ m_pLinguModulesFT.clear();
+ m_pLinguModulesCLB.clear();
+ m_pLinguModulesEditPB.clear();
+ m_pLinguDicsFT.clear();
+ m_pLinguDicsCLB.clear();
+ m_pLinguDicsNewPB.clear();
+ m_pLinguDicsEditPB.clear();
+ m_pLinguDicsDelPB.clear();
+ m_pLinguOptionsCLB.clear();
+ m_pLinguOptionsEditPB.clear();
+ m_pMoreDictsLink.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxLinguTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxLinguTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
{
- return ( new SvxLinguTabPage( pParent, *rAttrSet ) );
+ return VclPtr<SfxTabPage>( new SvxLinguTabPage( pParent, *rAttrSet ),
+ SAL_NO_ACQUIRE );
}
@@ -1570,8 +1597,8 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
pLinguData = new SvxLinguData_Impl;
SvxLinguData_Impl aOldLinguData( *pLinguData );
- SvxEditModulesDlg aDlg( this, *pLinguData );
- if (aDlg.Execute() != RET_OK)
+ ScopedVclPtrInstance< SvxEditModulesDlg > aDlg( this, *pLinguData );
+ if (aDlg->Execute() != RET_OK)
*pLinguData = aOldLinguData;
// evaluate new status of 'bConfigured' flag
@@ -1647,9 +1674,9 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
}
else if (m_pLinguDicsDelPB == pBtn)
{
- MessageDialog aQuery(this, "QueryDeleteDictionaryDialog",
- "cui/ui/querydeletedictionarydialog.ui");
- if (RET_NO == aQuery.Execute())
+ ScopedVclPtrInstance<MessageDialog> aQuery(this, "QueryDeleteDictionaryDialog",
+ "cui/ui/querydeletedictionarydialog.ui");
+ if (RET_NO == aQuery->Execute())
return 0;
SvTreeListEntry *pEntry = m_pLinguDicsCLB->GetCurEntry();
@@ -1719,11 +1746,11 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
if(aData.HasNumericValue())
{
sal_uInt16 nRID = aData.GetEntryId();
- OptionsBreakSet aDlg( this, nRID );
- aDlg.GetNumericFld().SetValue( aData.GetNumericValue() );
- if (RET_OK == aDlg.Execute() )
+ ScopedVclPtrInstance< OptionsBreakSet > aDlg(this, nRID);
+ aDlg->GetNumericFld().SetValue( aData.GetNumericValue() );
+ if (RET_OK == aDlg->Execute() )
{
- long nVal = static_cast<long>(aDlg.GetNumericFld().GetValue());
+ long nVal = static_cast<long>(aDlg->GetNumericFld().GetValue());
if (-1 != nVal && aData.GetNumericValue() != nVal)
{
aData.SetNumericValue( (sal_uInt8)nVal ); //! sets IsModified !
@@ -1892,9 +1919,22 @@ SvxEditModulesDlg::SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rD
SvxEditModulesDlg::~SvxEditModulesDlg()
{
- delete pDefaultLinguData;
+ disposeOnce();
}
+void SvxEditModulesDlg::dispose()
+{
+ delete pDefaultLinguData;
+ pDefaultLinguData = NULL;
+ m_pLanguageLB.clear();
+ m_pModulesCLB.clear();
+ m_pPrioUpPB.clear();
+ m_pPrioDownPB.clear();
+ m_pBackPB.clear();
+ m_pMoreDictsLink.clear();
+ m_pClosePB.clear();
+ ModalDialog::dispose();
+}
SvTreeListEntry* SvxEditModulesDlg::CreateEntry( OUString& rTxt, sal_uInt16 nCol )
{
diff --git a/cui/source/options/optmemory.cxx b/cui/source/options/optmemory.cxx
index a8bac7001b03..730df834fee1 100644
--- a/cui/source/options/optmemory.cxx
+++ b/cui/source/options/optmemory.cxx
@@ -141,15 +141,26 @@ OfaMemoryOptionsPage::OfaMemoryOptionsPage(vcl::Window* pParent, const SfxItemSe
m_pNfGraphicCache->SetModifyHdl( LINK( this, OfaMemoryOptionsPage, GraphicCacheConfigHdl ) );
}
-
-
OfaMemoryOptionsPage::~OfaMemoryOptionsPage()
{
+ disposeOnce();
+}
+
+void OfaMemoryOptionsPage::dispose()
+{
+ m_pUndoEdit.clear();
+ m_pNfGraphicCache.clear();
+ m_pNfGraphicObjectCache.clear();
+ m_pTfGraphicObjectTime.clear();
+ m_pNfOLECache.clear();
+ m_pQuickStarterFrame.clear();
+ m_pQuickLaunchCB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaMemoryOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> OfaMemoryOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new OfaMemoryOptionsPage( pParent, *rAttrSet );
+ return VclPtr<OfaMemoryOptionsPage>::Create( pParent, *rAttrSet );
}
bool OfaMemoryOptionsPage::FillItemSet( SfxItemSet* rSet )
diff --git a/cui/source/options/optmemory.hxx b/cui/source/options/optmemory.hxx
index 1ba1a1ec4b95..a9c823b2d640 100644
--- a/cui/source/options/optmemory.hxx
+++ b/cui/source/options/optmemory.hxx
@@ -32,16 +32,16 @@ class OfaMemoryOptionsPage : public SfxTabPage
{
using SfxTabPage::DeactivatePage;
private:
- NumericField* m_pUndoEdit;
+ VclPtr<NumericField> m_pUndoEdit;
- NumericField* m_pNfGraphicCache;
- NumericField* m_pNfGraphicObjectCache;
- TimeField* m_pTfGraphicObjectTime;
+ VclPtr<NumericField> m_pNfGraphicCache;
+ VclPtr<NumericField> m_pNfGraphicObjectCache;
+ VclPtr<TimeField> m_pTfGraphicObjectTime;
- NumericField* m_pNfOLECache;
+ VclPtr<NumericField> m_pNfOLECache;
- VclContainer* m_pQuickStarterFrame;
- CheckBox* m_pQuickLaunchCB;
+ VclPtr<VclContainer> m_pQuickStarterFrame;
+ VclPtr<CheckBox> m_pQuickLaunchCB;
DECL_LINK(GraphicCacheConfigHdl, void *);
@@ -58,8 +58,9 @@ protected:
public:
OfaMemoryOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaMemoryOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<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/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx
index e6703b08738d..465bb4acf437 100644
--- a/cui/source/options/optopencl.cxx
+++ b/cui/source/options/optopencl.cxx
@@ -72,8 +72,8 @@ SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
mpWhiteListDelete->SetClickHdl(LINK(this, SvxOpenCLTabPage, WhiteListDeleteHdl));
WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
- mpBlackList = new SvSimpleTable( *mpBlackListTable, nBits );
- mpWhiteList = new SvSimpleTable( *mpWhiteListTable, nBits );
+ mpBlackList = VclPtr<SvSimpleTable>::Create( *mpBlackListTable, nBits );
+ mpWhiteList = VclPtr<SvSimpleTable>::Create( *mpWhiteListTable, nBits );
HeaderBar &rBlBar = mpBlackList->GetTheHeaderBar();
HeaderBar &rWiBar = mpWhiteList->GetTheHeaderBar();
@@ -104,17 +104,41 @@ SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
SvxOpenCLTabPage::~SvxOpenCLTabPage()
{
- for ( sal_uInt16 i = 0; i < mpBlackList->GetEntryCount(); ++i )
+ disposeOnce();
+}
+
+void SvxOpenCLTabPage::dispose()
+{
+ for ( sal_uInt16 i = 0; i < mpBlackList->GetEntryCount(); ++i )
delete static_cast<OpenCLConfig::ImplMatcher*>(mpBlackList->GetEntry(i)->GetUserData());
for ( sal_uInt16 i = 0; i < mpWhiteList->GetEntryCount(); ++i )
delete static_cast<OpenCLConfig::ImplMatcher*>(mpWhiteList->GetEntry(i)->GetUserData());
- delete mpBlackList;
- delete mpWhiteList;
+ mpBlackList.disposeAndClear();
+ mpWhiteList.disposeAndClear();
+
+ mpUseOpenCL.clear();
+ mpBlackListFrame.clear();
+ mpBlackListTable.clear();
+ mpBlackListEdit.clear();
+ mpBlackListAdd.clear();
+ mpBlackListDelete.clear();
+ mpOS.clear();
+ mpOSVersion.clear();
+ mpDevice.clear();
+ mpVendor.clear();
+ mpDrvVersion.clear();
+ mpWhiteListFrame.clear();
+ mpWhiteListTable.clear();
+ mpWhiteListEdit.clear();
+ mpWhiteListAdd.clear();
+ mpWhiteListDelete.clear();
+
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxOpenCLTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxOpenCLTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new SvxOpenCLTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxOpenCLTabPage>::Create(pParent, *rAttrSet);
}
bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* )
@@ -189,16 +213,27 @@ class ListEntryDialog : public ModalDialog
public:
OpenCLConfig::ImplMatcher maEntry;
- ListBox* mpOS;
- Edit* mpOSVersion;
- Edit* mpPlatformVendor;
- Edit* mpDevice;
- Edit* mpDriverVersion;
+ VclPtr<ListBox> mpOS;
+ VclPtr<Edit> mpOSVersion;
+ VclPtr<Edit> mpPlatformVendor;
+ VclPtr<Edit> mpDevice;
+ VclPtr<Edit> mpDriverVersion;
DECL_LINK(OSSelectHdl, ListBox*);
DECL_LINK(EditModifiedHdl, Edit*);
ListEntryDialog(vcl::Window* pParent, const OpenCLConfig::ImplMatcher& rEntry, const OString& rTag);
+ virtual ~ListEntryDialog() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ mpOS.clear();
+ mpOSVersion.clear();
+ mpPlatformVendor.clear();
+ mpDevice.clear();
+ mpDriverVersion.clear();
+ ModalDialog::dispose();
+ }
+
};
ListEntryDialog::ListEntryDialog(vcl::Window* pParent, const OpenCLConfig::ImplMatcher& rEntry, const OString& rTag)
@@ -268,10 +303,10 @@ IMPL_LINK(ListEntryDialog, EditModifiedHdl, Edit*, pEdit)
void openListDialog(SvxOpenCLTabPage* pTabPage, OpenCLConfig::ImplMatcher& rEntry, const OString& rTag)
{
- ListEntryDialog aDlg(pTabPage, rEntry, rTag);
+ ScopedVclPtrInstance< ListEntryDialog > aDlg(pTabPage, rEntry, rTag);
- if (aDlg.Execute() == RET_OK)
- rEntry = aDlg.maEntry;
+ if (aDlg->Execute() == RET_OK)
+ rEntry = aDlg->maEntry;
}
const OpenCLConfig::ImplMatcher& findCurrentEntry(OpenCLConfig::ImplMatcherSet& rSet, SvSimpleTable* pListBox)
diff --git a/cui/source/options/optopencl.hxx b/cui/source/options/optopencl.hxx
index dc28ba32a2c1..09eb097609fd 100644
--- a/cui/source/options/optopencl.hxx
+++ b/cui/source/options/optopencl.hxx
@@ -31,26 +31,26 @@ class SvxOpenCLTabPage : public SfxTabPage
private:
OpenCLConfig maConfig;
- CheckBox* mpUseOpenCL;
-
- VclFrame* mpBlackListFrame;
- SvSimpleTable* mpBlackList;
- SvSimpleTableContainer* mpBlackListTable;
- PushButton* mpBlackListEdit;
- PushButton* mpBlackListAdd;
- PushButton* mpBlackListDelete;
- FixedText* mpOS;
- FixedText* mpOSVersion;
- FixedText* mpDevice;
- FixedText* mpVendor;
- FixedText* mpDrvVersion;
-
- VclFrame* mpWhiteListFrame;
- SvSimpleTable* mpWhiteList;
- SvSimpleTableContainer* mpWhiteListTable;
- PushButton* mpWhiteListEdit;
- PushButton* mpWhiteListAdd;
- PushButton* mpWhiteListDelete;
+ VclPtr<CheckBox> mpUseOpenCL;
+
+ VclPtr<VclFrame> mpBlackListFrame;
+ VclPtr<SvSimpleTable> mpBlackList;
+ VclPtr<SvSimpleTableContainer> mpBlackListTable;
+ VclPtr<PushButton> mpBlackListEdit;
+ VclPtr<PushButton> mpBlackListAdd;
+ VclPtr<PushButton> mpBlackListDelete;
+ VclPtr<FixedText> mpOS;
+ VclPtr<FixedText> mpOSVersion;
+ VclPtr<FixedText> mpDevice;
+ VclPtr<FixedText> mpVendor;
+ VclPtr<FixedText> mpDrvVersion;
+
+ VclPtr<VclFrame> mpWhiteListFrame;
+ VclPtr<SvSimpleTable> mpWhiteList;
+ VclPtr<SvSimpleTableContainer> mpWhiteListTable;
+ VclPtr<PushButton> mpWhiteListEdit;
+ VclPtr<PushButton> mpWhiteListAdd;
+ VclPtr<PushButton> mpWhiteListDelete;
DECL_LINK(BlackListEditHdl, void*);
DECL_LINK(BlackListAddHdl, void*);
@@ -71,8 +71,9 @@ private:
public:
SvxOpenCLTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxOpenCLTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 53363402f7d6..468f56eeed0e 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -214,7 +214,7 @@ SvxPathTabPage::SvxPathTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_pPathCtrl->set_width_request(aControlSize.Width());
m_pPathCtrl->set_height_request(aControlSize.Height());
WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
- pPathBox = new svx::OptHeaderTabListBox( *m_pPathCtrl, nBits );
+ pPathBox = VclPtr<svx::OptHeaderTabListBox>::Create( *m_pPathCtrl, nBits );
HeaderBar &rBar = pPathBox->GetTheHeaderBar();
rBar.SetSelectHdl( LINK( this, SvxPathTabPage, HeaderSelect_Impl ) );
@@ -247,21 +247,30 @@ SvxPathTabPage::SvxPathTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
SvxPathTabPage::~SvxPathTabPage()
{
- for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i )
- delete static_cast<PathUserData_Impl*>(pPathBox->GetEntry(i)->GetUserData());
- delete pPathBox;
- delete pImpl;
+ disposeOnce();
}
-
-
-SfxTabPage* SvxPathTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+void SvxPathTabPage::dispose()
{
- return ( new SvxPathTabPage( pParent, *rAttrSet ) );
+ if ( pPathBox )
+ {
+ for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i )
+ delete static_cast<PathUserData_Impl*>(pPathBox->GetEntry(i)->GetUserData());
+ pPathBox.disposeAndClear();
+ }
+ delete pImpl;
+ pImpl = NULL;
+ m_pPathCtrl.clear();
+ m_pStandardBtn.clear();
+ m_pPathBtn.clear();
+ SfxTabPage::dispose();
}
-
+VclPtr<SfxTabPage> SvxPathTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SvxPathTabPage>::Create( pParent, *rAttrSet );
+}
bool SvxPathTabPage::FillItemSet( SfxItemSet* )
{
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 1bc7861c0905..a57f3e0dca35 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -199,17 +199,38 @@ SfxSaveTabPage::SfxSaveTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet
SfxSaveTabPage::~SfxSaveTabPage()
{
- delete pImpl;
+ disposeOnce();
}
-
-
-SfxTabPage* SfxSaveTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+void SvxSaveTabPage::dispose()
{
- return ( new SfxSaveTabPage( pParent, *rAttrSet ) );
+ delete pImpl;
+ pImpl = NULL;
+ aLoadUserSettingsCB.clear();
+ aLoadDocPrinterCB.clear();
+ aDocInfoCB.clear();
+ aBackupCB.clear();
+ aAutoSaveCB.clear();
+ aAutoSaveEdit.clear();
+ aMinuteFT.clear();
+ aUserAutoSaveCB.clear();
+ aRelativeFsysCB.clear();
+ aRelativeInetCB.clear();
+ aODFVersionLB.clear();
+ aWarnAlienFormatCB.clear();
+ aDocTypeLB.clear();
+ aSaveAsFT.clear();
+ aSaveAsLB.clear();
+ aODFWarningFI.clear();
+ aODFWarningFT.clear();
+ SfxTabPage::dispose();
}
+VclPtr<SfxTabPage> SfxSaveTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SfxSaveTabPage>::Create( pParent, *rAttrSet );
+}
void SfxSaveTabPage::DetectHiddenControls()
{
diff --git a/cui/source/options/optsave.hxx b/cui/source/options/optsave.hxx
index b5fe40ad204e..f64dc0a82495 100644
--- a/cui/source/options/optsave.hxx
+++ b/cui/source/options/optsave.hxx
@@ -42,25 +42,25 @@ struct SvxSaveTabPage_Impl;
class SvxSaveTabPage : public SfxTabPage
{
private:
- CheckBox* aLoadUserSettingsCB;
- CheckBox* aLoadDocPrinterCB;
-
- CheckBox* aDocInfoCB;
- CheckBox* aBackupCB;
- CheckBox* aAutoSaveCB;
- NumericField* aAutoSaveEdit;
- FixedText* aMinuteFT;
- CheckBox* aUserAutoSaveCB;
- CheckBox* aRelativeFsysCB;
- CheckBox* aRelativeInetCB;
-
- ListBox* aODFVersionLB;
- CheckBox* aWarnAlienFormatCB;
- ListBox* aDocTypeLB;
- FixedText* aSaveAsFT;
- ListBox* aSaveAsLB;
- FixedImage* aODFWarningFI;
- FixedText* aODFWarningFT;
+ VclPtr<CheckBox> aLoadUserSettingsCB;
+ VclPtr<CheckBox> aLoadDocPrinterCB;
+
+ VclPtr<CheckBox> aDocInfoCB;
+ VclPtr<CheckBox> aBackupCB;
+ VclPtr<CheckBox> aAutoSaveCB;
+ VclPtr<NumericField> aAutoSaveEdit;
+ VclPtr<FixedText> aMinuteFT;
+ VclPtr<CheckBox> aUserAutoSaveCB;
+ VclPtr<CheckBox> aRelativeFsysCB;
+ VclPtr<CheckBox> aRelativeInetCB;
+
+ VclPtr<ListBox> aODFVersionLB;
+ VclPtr<CheckBox> aWarnAlienFormatCB;
+ VclPtr<ListBox> aDocTypeLB;
+ VclPtr<FixedText> aSaveAsFT;
+ VclPtr<ListBox> aSaveAsLB;
+ VclPtr<FixedImage> aODFWarningFI;
+ VclPtr<FixedText> aODFWarningFT;
SvxSaveTabPage_Impl* pImpl;
@@ -73,8 +73,9 @@ private:
public:
SvxSaveTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxSaveTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<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/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index e44e76006484..5f66f5bbbd43 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -82,10 +82,24 @@ SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage(vcl::Window* pParent, const SfxIt
UpdateLastCheckedText();
}
-
-
SvxOnlineUpdateTabPage::~SvxOnlineUpdateTabPage()
{
+ disposeOnce();
+}
+
+void SvxOnlineUpdateTabPage::dispose()
+{
+ m_pAutoCheckCheckBox.clear();
+ m_pEveryDayButton.clear();
+ m_pEveryWeekButton.clear();
+ m_pEveryMonthButton.clear();
+ m_pCheckNowButton.clear();
+ m_pAutoDownloadCheckBox.clear();
+ m_pDestPathLabel.clear();
+ m_pDestPath.clear();
+ m_pChangePathButton.clear();
+ m_pLastChecked.clear();
+ SfxTabPage::dispose();
}
@@ -146,17 +160,12 @@ void SvxOnlineUpdateTabPage::UpdateLastCheckedText()
m_pLastChecked->SetText( aText );
}
-
-
-SfxTabPage*
+VclPtr<SfxTabPage>
SvxOnlineUpdateTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new SvxOnlineUpdateTabPage( pParent, *rAttrSet );
+ return VclPtr<SvxOnlineUpdateTabPage>::Create( pParent, *rAttrSet );
}
-
-
-
bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet* )
{
bool bModified = false;
diff --git a/cui/source/options/optupdt.hxx b/cui/source/options/optupdt.hxx
index 54bb2a3791f8..ec749adc16c8 100644
--- a/cui/source/options/optupdt.hxx
+++ b/cui/source/options/optupdt.hxx
@@ -29,16 +29,16 @@
class SvxOnlineUpdateTabPage : public SfxTabPage
{
private:
- CheckBox* m_pAutoCheckCheckBox;
- RadioButton* m_pEveryDayButton;
- RadioButton* m_pEveryWeekButton;
- RadioButton* m_pEveryMonthButton;
- PushButton* m_pCheckNowButton;
- CheckBox* m_pAutoDownloadCheckBox;
- FixedText* m_pDestPathLabel;
- FixedText* m_pDestPath;
- PushButton* m_pChangePathButton;
- FixedText* m_pLastChecked;
+ VclPtr<CheckBox> m_pAutoCheckCheckBox;
+ VclPtr<RadioButton> m_pEveryDayButton;
+ VclPtr<RadioButton> m_pEveryWeekButton;
+ VclPtr<RadioButton> m_pEveryMonthButton;
+ VclPtr<PushButton> m_pCheckNowButton;
+ VclPtr<CheckBox> m_pAutoDownloadCheckBox;
+ VclPtr<FixedText> m_pDestPathLabel;
+ VclPtr<FixedText> m_pDestPath;
+ VclPtr<PushButton> m_pChangePathButton;
+ VclPtr<FixedText> m_pLastChecked;
OUString m_aNeverChecked;
OUString m_aLastCheckedTemplate;
@@ -53,8 +53,9 @@ private:
public:
SvxOnlineUpdateTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxOnlineUpdateTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index ddea9fed3c17..f19cfb4589d9 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -92,6 +92,25 @@ SelectPersonaDialog::SelectPersonaDialog( vcl::Window *pParent )
}
}
+SelectPersonaDialog::~SelectPersonaDialog()
+{
+ disposeOnce();
+}
+
+void SelectPersonaDialog::dispose()
+{
+ m_pEdit.clear();
+ m_pSearchButton.clear();
+ m_pProgressLabel.clear();
+ for (VclPtr<PushButton> vp : m_vResultList)
+ vp.clear();
+ for (VclPtr<PushButton> vp : m_vSearchSuggestions)
+ vp.clear();
+ m_pOkButton.clear();
+ m_pCancelButton.clear();
+ ModalDialog::dispose();
+}
+
OUString SelectPersonaDialog::GetSelectedPersona() const
{
if( !m_aSelectedPersona.isEmpty( ) )
@@ -293,11 +312,27 @@ SvxPersonalizationTabPage::SvxPersonalizationTabPage( vcl::Window *pParent, cons
SvxPersonalizationTabPage::~SvxPersonalizationTabPage()
{
+ disposeOnce();
}
-SfxTabPage* SvxPersonalizationTabPage::Create( vcl::Window *pParent, const SfxItemSet *rSet )
+void SvxPersonalizationTabPage::dispose()
+{
+ m_pNoPersona.clear();
+ m_pDefaultPersona.clear();
+ m_pOwnPersona.clear();
+ m_pSelectPersona.clear();
+ for (int i=0; i<3; ++i)
+ m_vDefaultPersonaImages[i].clear();
+ m_pExtensionPersonaPreview.clear();
+ m_pPersonaList.clear();
+ m_pExtensionLabel.clear();
+ SfxTabPage::dispose();
+}
+
+
+VclPtr<SfxTabPage> SvxPersonalizationTabPage::Create( vcl::Window *pParent, const SfxItemSet *rSet )
{
- return new SvxPersonalizationTabPage( pParent, *rSet );
+ return VclPtr<SvxPersonalizationTabPage>::Create( pParent, *rSet );
}
bool SvxPersonalizationTabPage::FillItemSet( SfxItemSet * )
@@ -441,11 +476,11 @@ void SvxPersonalizationTabPage::LoadExtensionThemes()
IMPL_LINK( SvxPersonalizationTabPage, SelectPersona, PushButton*, /*pButton*/ )
{
- SelectPersonaDialog aDialog( NULL );
+ ScopedVclPtrInstance< SelectPersonaDialog > aDialog(nullptr);
- if ( aDialog.Execute() == RET_OK )
+ if ( aDialog->Execute() == RET_OK )
{
- OUString aPersonaSetting( aDialog.GetAppliedPersonaSetting() );
+ OUString aPersonaSetting( aDialog->GetAppliedPersonaSetting() );
if ( !aPersonaSetting.isEmpty() )
{
SetPersonaSettings( aPersonaSetting );
diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx
index 95da0717c932..0ec920db2704 100644
--- a/cui/source/options/personalization.hxx
+++ b/cui/source/options/personalization.hxx
@@ -25,15 +25,15 @@ class SvxPersonalizationTabPage : public SfxTabPage
using SfxTabPage::DeactivatePage;
private:
- RadioButton *m_pNoPersona; ///< Just the default look, without any bitmap
- RadioButton *m_pDefaultPersona; ///< Use the built-in bitmap
- RadioButton *m_pOwnPersona; ///< Use the user-defined bitmap
- PushButton *m_pSelectPersona; ///< Let the user select in the 'own' case
- PushButton *m_vDefaultPersonaImages[3]; ///< Buttons to show the default persona images
- PushButton *m_pExtensionPersonaPreview; ///< Buttons to show the last 3 personas installed via extensions
- ListBox* m_pPersonaList; ///< The ListBox to show the list of installed personas
+ VclPtr<RadioButton> m_pNoPersona; ///< Just the default look, without any bitmap
+ VclPtr<RadioButton> m_pDefaultPersona; ///< Use the built-in bitmap
+ VclPtr<RadioButton> m_pOwnPersona; ///< Use the user-defined bitmap
+ VclPtr<PushButton> m_pSelectPersona; ///< Let the user select in the 'own' case
+ VclPtr<PushButton> m_vDefaultPersonaImages[3]; ///< Buttons to show the default persona images
+ VclPtr<PushButton> m_pExtensionPersonaPreview; ///< Buttons to show the last 3 personas installed via extensions
+ VclPtr<ListBox> m_pPersonaList; ///< The ListBox to show the list of installed personas
OUString m_aPersonaSettings; ///< Header and footer images + color to be set in the settings.
- FixedText *m_pExtensionLabel; ///< The "select persona installed via extensions" label
+ VclPtr<FixedText> m_pExtensionLabel; ///< The "select persona installed via extensions" label
std::vector<OUString> m_vDefaultPersonaSettings;
std::vector<OUString> m_vExtensionPersonaSettings;
@@ -42,8 +42,9 @@ public:
::rtl::Reference< SearchAndParseThread > m_rApplyThread;
SvxPersonalizationTabPage( vcl::Window *pParent, const SfxItemSet &rSet );
virtual ~SvxPersonalizationTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window *pParent, const SfxItemSet *rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window *pParent, const SfxItemSet *rSet );
/// Apply the settings ([OK] button).
virtual bool FillItemSet( SfxItemSet *rSet ) SAL_OVERRIDE;
@@ -78,13 +79,13 @@ https://addons.mozilla.org/firefox/themes ...
class SelectPersonaDialog : public ModalDialog
{
private:
- Edit *m_pEdit; ///< The input line for the search term
- PushButton *m_pSearchButton; ///< The search button
- FixedText *m_pProgressLabel; ///< The label for showing progress of search
- PushButton *m_vResultList[9]; ///< List of buttons to show search results
- PushButton *m_vSearchSuggestions[5]; ///< List of buttons for the search suggestions
- PushButton *m_pOkButton; ///< The OK button
- PushButton *m_pCancelButton; ///< The Cancel button
+ VclPtr<Edit> m_pEdit; ///< The input line for the search term
+ VclPtr<PushButton> m_pSearchButton; ///< The search button
+ VclPtr<FixedText> m_pProgressLabel; ///< The label for showing progress of search
+ VclPtr<PushButton> m_vResultList[9]; ///< List of buttons to show search results
+ VclPtr<PushButton> m_vSearchSuggestions[5]; ///< List of buttons for the search suggestions
+ VclPtr<PushButton> m_pOkButton; ///< The OK button
+ VclPtr<PushButton> m_pCancelButton; ///< The Cancel button
std::vector<OUString> m_vPersonaSettings;
OUString m_aSelectedPersona;
@@ -92,6 +93,8 @@ private:
public:
SelectPersonaDialog( vcl::Window *pParent );
+ virtual ~SelectPersonaDialog();
+ virtual void dispose() SAL_OVERRIDE;
::rtl::Reference< SearchAndParseThread > m_rSearchThread;
OUString GetSelectedPersona() const;
@@ -114,7 +117,7 @@ class SearchAndParseThread: public salhelper::Thread
{
private:
- SelectPersonaDialog *m_pPersonaDialog;
+ VclPtr<SelectPersonaDialog> m_pPersonaDialog;
OUString m_aURL;
bool m_bExecute;
diff --git a/cui/source/options/radiobtnbox.cxx b/cui/source/options/radiobtnbox.cxx
index 7830cbe024f2..500617bedf28 100644
--- a/cui/source/options/radiobtnbox.cxx
+++ b/cui/source/options/radiobtnbox.cxx
@@ -33,10 +33,6 @@ SvxRadioButtonListBox::SvxRadioButtonListBox(SvSimpleTableContainer& rParent, Wi
EnableCheckButton( new SvLBoxButtonData( this, true ) );
}
-SvxRadioButtonListBox::~SvxRadioButtonListBox()
-{
-}
-
void SvxRadioButtonListBox::SetTabs()
{
SvSimpleTable::SetTabs();
diff --git a/cui/source/options/securityoptions.cxx b/cui/source/options/securityoptions.cxx
index b046f218bbb6..aea7fd280645 100644
--- a/cui/source/options/securityoptions.cxx
+++ b/cui/source/options/securityoptions.cxx
@@ -74,8 +74,21 @@ SecurityOptionsDialog::SecurityOptionsDialog(vcl::Window* pParent, SvtSecurityOp
SecurityOptionsDialog::~SecurityOptionsDialog()
{
+ disposeOnce();
}
+void SecurityOptionsDialog::dispose()
+{
+ m_pSaveOrSendDocsCB.clear();
+ m_pSignDocsCB.clear();
+ m_pPrintDocsCB.clear();
+ m_pCreatePdfCB.clear();
+ m_pRemovePersInfoCB.clear();
+ m_pRecommPasswdCB.clear();
+ m_pCtrlHyperlinkCB.clear();
+ m_pBlockUntrustedRefererLinksCB.clear();
+ ModalDialog::dispose();
+}
} // namespace svx
diff --git a/cui/source/options/securityoptions.hxx b/cui/source/options/securityoptions.hxx
index 614e3f72dfa3..216e372e945f 100644
--- a/cui/source/options/securityoptions.hxx
+++ b/cui/source/options/securityoptions.hxx
@@ -37,19 +37,20 @@ namespace svx
class SecurityOptionsDialog : public ModalDialog
{
private:
- CheckBox* m_pSaveOrSendDocsCB;
- CheckBox* m_pSignDocsCB;
- CheckBox* m_pPrintDocsCB;
- CheckBox* m_pCreatePdfCB;
+ VclPtr<CheckBox> m_pSaveOrSendDocsCB;
+ VclPtr<CheckBox> m_pSignDocsCB;
+ VclPtr<CheckBox> m_pPrintDocsCB;
+ VclPtr<CheckBox> m_pCreatePdfCB;
- CheckBox* m_pRemovePersInfoCB;
- CheckBox* m_pRecommPasswdCB;
- CheckBox* m_pCtrlHyperlinkCB;
- CheckBox* m_pBlockUntrustedRefererLinksCB;
+ VclPtr<CheckBox> m_pRemovePersInfoCB;
+ VclPtr<CheckBox> m_pRecommPasswdCB;
+ VclPtr<CheckBox> m_pCtrlHyperlinkCB;
+ VclPtr<CheckBox> m_pBlockUntrustedRefererLinksCB;
public:
SecurityOptionsDialog( vcl::Window* pParent, SvtSecurityOptions* pOptions );
virtual ~SecurityOptionsDialog();
+ virtual void dispose() SAL_OVERRIDE;
bool IsSaveOrSendDocsChecked() const { return m_pSaveOrSendDocsCB->IsChecked(); }
bool IsSignDocsChecked() const { return m_pSignDocsCB->IsChecked(); }
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 42154b213a2f..2267d16775ad 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -291,7 +291,7 @@ void MailMergeCfg_Impl::Notify( const com::sun::star::uno::Sequence< OUString >&
}
//typedef SfxTabPage* (*FNCreateTabPage)( vcl::Window *pParent, const SfxItemSet &rAttrSet );
-SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet )
+VclPtr<SfxTabPage> CreateGeneralTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet )
{
CreateTabPage fnCreate = 0;
switch(nId)
@@ -332,7 +332,7 @@ SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, vcl::Window* pParent, const Sf
#endif
}
- SfxTabPage* pRet = fnCreate ? (*fnCreate)( pParent, &rSet ) : NULL;
+ VclPtr<SfxTabPage> pRet = fnCreate ? (*fnCreate)( pParent, &rSet ) : nullptr;
return pRet;
}
@@ -465,11 +465,11 @@ static bool lcl_isOptionHidden( sal_uInt16 _nPageId, const SvtOptionsDialogOptio
struct OptionsPageInfo
{
- SfxTabPage* m_pPage;
+ ScopedVclPtr<SfxTabPage> m_pPage;
sal_uInt16 m_nPageId;
OUString m_sPageURL;
OUString m_sEventHdl;
- ExtensionsTabPage* m_pExtPage;
+ VclPtr<ExtensionsTabPage> m_pExtPage;
OptionsPageInfo( sal_uInt16 nId ) : m_pPage( NULL ), m_nPageId( nId ), m_pExtPage( NULL ) {}
};
@@ -483,7 +483,7 @@ struct OptionsGroupInfo
sal_uInt16 m_nDialogId; // Id of the former dialog
bool m_bLoadError; // load fails?
OUString m_sPageURL;
- ExtensionsTabPage* m_pExtPage;
+ VclPtr<ExtensionsTabPage> m_pExtPage;
OptionsGroupInfo( SfxShell* pSh, SfxModule* pMod, sal_uInt16 nId ) :
m_pInItemSet( NULL ), m_pOutItemSet( NULL ), m_pShell( pSh ),
@@ -552,8 +552,13 @@ OfaTreeOptionsDialog::OfaTreeOptionsDialog( vcl::Window* pParent, const OUString
OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
{
+ disposeOnce();
+}
+
+void OfaTreeOptionsDialog::dispose()
+{
pCurrentPageEntry = NULL;
- SvTreeListEntry* pEntry = pTreeLB->First();
+ SvTreeListEntry* pEntry = pTreeLB ? pTreeLB->First() : NULL;
// first children
while(pEntry)
{
@@ -570,7 +575,7 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
SvtViewOptions aTabPageOpt( E_TABPAGE, OUString::number( pPageInfo->m_nPageId) );
SetViewOptUserItem( aTabPageOpt, aPageData );
}
- delete pPageInfo->m_pPage;
+ pPageInfo->m_pPage.disposeAndClear();
}
if (pPageInfo->m_nPageId == RID_SFXPAGE_LINGU)
@@ -583,7 +588,7 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
}
}
- delete pPageInfo->m_pExtPage;
+ pPageInfo->m_pExtPage.disposeAndClear();
delete pPageInfo;
}
@@ -591,20 +596,27 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
}
// and parents
- pEntry = pTreeLB->First();
+ pEntry = pTreeLB ? pTreeLB->First() : NULL;
while(pEntry)
{
if(!pTreeLB->GetParent(pEntry))
{
OptionsGroupInfo* pGroupInfo = static_cast<OptionsGroupInfo*>(pEntry->GetUserData());
- if ( pGroupInfo && pGroupInfo->m_pExtPage )
- delete pGroupInfo->m_pExtPage;
+ if ( pGroupInfo )
+ pGroupInfo->m_pExtPage.disposeAndClear();
delete pGroupInfo;
}
pEntry = pTreeLB->Next(pEntry);
}
delete pColorPageItemSet;
+ pColorPageItemSet = NULL;
deleteGroupNames();
+ pOkPB.clear();
+ pBackPB.clear();
+ pTreeLB.clear();
+ pTabBox.clear();
+ mpColorPage.clear();
+ SfxModalDialog::dispose();
}
OptionsPageInfo* OfaTreeOptionsDialog::AddTabPage(
@@ -1038,17 +1050,17 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
if(pPageInfo->m_nPageId == RID_SVXPAGE_COLOR)
{
- pPageInfo->m_pPage = ::CreateGeneralTabPage(
- pPageInfo->m_nPageId, pTabBox, *pColorPageItemSet );
- mpColorPage = static_cast<SvxColorTabPage*>(pPageInfo->m_pPage);
+ pPageInfo->m_pPage.reset( ::CreateGeneralTabPage(
+ pPageInfo->m_nPageId, pTabBox, *pColorPageItemSet ) );
+ mpColorPage = static_cast<SvxColorTabPage*>(pPageInfo->m_pPage.get());
mpColorPage->SetupForViewFrame( SfxViewFrame::Current() );
}
else
{
- pPageInfo->m_pPage = ::CreateGeneralTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet );
+ pPageInfo->m_pPage.reset( ::CreateGeneralTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet ) );
if(!pPageInfo->m_pPage && pGroupInfo->m_pModule)
- pPageInfo->m_pPage = pGroupInfo->m_pModule->CreateTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet);
+ pPageInfo->m_pPage.reset( pGroupInfo->m_pModule->CreateTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet) );
}
@@ -1076,7 +1088,8 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
m_xContainerWinProvider = awt::ContainerWindowProvider::create( ::comphelper::getProcessComponentContext() );
}
- pPageInfo->m_pExtPage = new ExtensionsTabPage(
+ pPageInfo->m_pExtPage = VclPtr<ExtensionsTabPage>::Create(
+
pTabBox, 0, pPageInfo->m_sPageURL, pPageInfo->m_sEventHdl, m_xContainerWinProvider );
}
@@ -2156,6 +2169,11 @@ ExtensionsTabPage::ExtensionsTabPage(
ExtensionsTabPage::~ExtensionsTabPage()
{
+ disposeOnce();
+}
+
+void ExtensionsTabPage::dispose()
+{
Hide();
DeactivatePage();
@@ -2174,6 +2192,7 @@ ExtensionsTabPage::~ExtensionsTabPage()
}
m_xPage.clear();
}
+ TabPage::dispose();
}
diff --git a/cui/source/options/tsaurls.cxx b/cui/source/options/tsaurls.cxx
index 9db380135ed7..142ea656f045 100644
--- a/cui/source/options/tsaurls.cxx
+++ b/cui/source/options/tsaurls.cxx
@@ -67,6 +67,17 @@ IMPL_LINK_NOARG(TSAURLsDialog, OKHdl_Impl)
TSAURLsDialog::~TSAURLsDialog()
{
+ disposeOnce();
+}
+
+void TSAURLsDialog::dispose()
+{
+ m_pAddBtn.clear();
+ m_pDeleteBtn.clear();
+ m_pOKBtn.clear();
+ m_pURLListBox.clear();
+
+ ModalDialog::dispose();
}
void TSAURLsDialog::AddTSAURL(const OUString& rURL)
diff --git a/cui/source/options/tsaurls.hxx b/cui/source/options/tsaurls.hxx
index aba749181ac5..0b25238f1397 100644
--- a/cui/source/options/tsaurls.hxx
+++ b/cui/source/options/tsaurls.hxx
@@ -16,10 +16,10 @@
class TSAURLsDialog : public ModalDialog
{
private:
- ListBox* m_pURLListBox;
- PushButton* m_pAddBtn;
- PushButton* m_pDeleteBtn;
- OKButton* m_pOKBtn;
+ VclPtr<ListBox> m_pURLListBox;
+ VclPtr<PushButton> m_pAddBtn;
+ VclPtr<PushButton> m_pDeleteBtn;
+ VclPtr<OKButton> m_pOKBtn;
DECL_LINK(AddHdl_Impl, void *);
DECL_LINK(DeleteHdl_Impl, void *);
@@ -32,7 +32,7 @@ private:
public:
TSAURLsDialog(vcl::Window* pParent);
virtual ~TSAURLsDialog();
-
+ virtual void dispose() SAL_OVERRIDE;
};
#endif
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index b5c61bf88397..e97f790b3a32 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -111,7 +111,7 @@ WebConnectionInfoDialog::WebConnectionInfoDialog(vcl::Window* pParent)
get(m_pChangeBtn, "change");
SvSimpleTableContainer *pPasswordsLBContainer = get<SvSimpleTableContainer>("logins");
- m_pPasswordsLB = new PasswordTable(*pPasswordsLBContainer, 0);
+ m_pPasswordsLB = VclPtr<PasswordTable>::Create(*pPasswordsLBContainer, 0);
long aStaticTabs[]= { 2, 0, 0 };
m_pPasswordsLB->SetTabs( aStaticTabs );
@@ -142,9 +142,17 @@ WebConnectionInfoDialog::WebConnectionInfoDialog(vcl::Window* pParent)
WebConnectionInfoDialog::~WebConnectionInfoDialog()
{
- delete m_pPasswordsLB;
+ disposeOnce();
}
+void WebConnectionInfoDialog::dispose()
+{
+ m_pPasswordsLB.disposeAndClear();
+ m_pRemoveBtn.clear();
+ m_pRemoveAllBtn.clear();
+ m_pChangeBtn.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK( WebConnectionInfoDialog, HeaderBarClickedHdl, SvSimpleTable*, pTable )
{
diff --git a/cui/source/options/webconninfo.hxx b/cui/source/options/webconninfo.hxx
index 366bcfc31283..a9d1b566d592 100644
--- a/cui/source/options/webconninfo.hxx
+++ b/cui/source/options/webconninfo.hxx
@@ -47,10 +47,10 @@ namespace svx
class WebConnectionInfoDialog : public ModalDialog
{
private:
- PasswordTable* m_pPasswordsLB;
- PushButton* m_pRemoveBtn;
- PushButton* m_pRemoveAllBtn;
- PushButton* m_pChangeBtn;
+ VclPtr<PasswordTable> m_pPasswordsLB;
+ VclPtr<PushButton> m_pRemoveBtn;
+ VclPtr<PushButton> m_pRemoveAllBtn;
+ VclPtr<PushButton> m_pChangeBtn;
sal_Int32 m_nPos;
DECL_LINK( HeaderBarClickedHdl, SvSimpleTable* );
@@ -64,6 +64,7 @@ namespace svx
public:
WebConnectionInfoDialog( vcl::Window* pParent );
virtual ~WebConnectionInfoDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 8a80c500e9f4..8d7329fe19b1 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -250,12 +250,44 @@ AlignmentTabPage::AlignmentTabPage( vcl::Window* pParent, const SfxItemSet& rCor
AlignmentTabPage::~AlignmentTabPage()
{
+ disposeOnce();
+}
+
+void AlignmentTabPage::dispose()
+{
delete m_pOrientHlp;
+ m_pOrientHlp = NULL;
+ m_pLbHorAlign.clear();
+ m_pFtIndent.clear();
+ m_pEdIndent.clear();
+ m_pFtVerAlign.clear();
+ m_pLbVerAlign.clear();
+ m_pCtrlDial.clear();
+ m_pFtRotate.clear();
+ m_pNfRotate.clear();
+ m_pFtRefEdge.clear();
+ m_pVsRefEdge.clear();
+ m_pCbStacked.clear();
+ m_pCbAsianMode.clear();
+ m_pBoxDirection.clear();
+ m_pBtnWrap.clear();
+ m_pBtnHyphen.clear();
+ m_pBtnShrink.clear();
+ m_pLbFrameDir.clear();
+ m_pFtBotLock.clear();
+ m_pFtTopLock.clear();
+ m_pFtCelLock.clear();
+ m_pFtABCD.clear();
+ m_pAlignmentFrame.clear();
+ m_pOrientFrame.clear();
+ m_pPropertiesFrame.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* AlignmentTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> AlignmentTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new AlignmentTabPage( pParent, *rAttrSet );
+ return VclPtr<SfxTabPage>( new AlignmentTabPage( pParent, *rAttrSet ),
+ SAL_NO_ACQUIRE );
}
bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 5c46ca9f8488..9d492b843612 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -137,6 +137,18 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(vcl::Window* pParent, const SfxItemSet* _pSet )
SetCurPageId("smarttags");
}
+OfaAutoCorrDlg::~OfaAutoCorrDlg()
+{
+ disposeOnce();
+}
+
+void OfaAutoCorrDlg::dispose()
+{
+ m_pLanguageBox.clear();
+ m_pLanguageLB.clear();
+ SfxTabDialog::dispose();
+}
+
void OfaAutoCorrDlg::EnableLanguage(bool bEnable)
{
m_pLanguageBox->Enable(bEnable);
@@ -192,10 +204,21 @@ OfaAutocorrOptionsPage::OfaAutocorrOptionsPage(vcl::Window* pParent, const SfxIt
get(m_pCheckLB, "checklist");
}
-SfxTabPage* OfaAutocorrOptionsPage::Create( vcl::Window* pParent,
- const SfxItemSet* rSet)
+OfaAutocorrOptionsPage::~OfaAutocorrOptionsPage()
+{
+ disposeOnce();
+}
+
+void OfaAutocorrOptionsPage::dispose()
+{
+ m_pCheckLB.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> OfaAutocorrOptionsPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rSet)
{
- return new OfaAutocorrOptionsPage(pParent, *rSet);
+ return VclPtr<OfaAutocorrOptionsPage>::Create(pParent, *rSet);
}
bool OfaAutocorrOptionsPage::FillItemSet( SfxItemSet* )
@@ -282,13 +305,16 @@ struct ImpUserData
class OfaAutoFmtPrcntSet : public ModalDialog
{
- MetricField* m_pPrcntMF;
+ VclPtr<MetricField> m_pPrcntMF;
public:
OfaAutoFmtPrcntSet(vcl::Window* pParent)
: ModalDialog(pParent, "PercentDialog","cui/ui/percentdialog.ui")
{
get(m_pPrcntMF, "margin");
}
+ virtual ~OfaAutoFmtPrcntSet() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE { m_pPrcntMF.clear(); ModalDialog::dispose(); }
+
MetricField& GetPrcntFld()
{
return *m_pPrcntMF;
@@ -417,7 +443,7 @@ OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( vcl::Window* pParent,
aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
pCheckLBContainer->set_width_request(aControlSize.Width());
pCheckLBContainer->set_height_request(aControlSize.Height());
- m_pCheckLB = new OfaACorrCheckListBox(*pCheckLBContainer);
+ m_pCheckLB = VclPtr<OfaACorrCheckListBox>::Create(*pCheckLBContainer);
m_pCheckLB->SetStyle(m_pCheckLB->GetStyle()|WB_HSCROLL| WB_VSCROLL);
@@ -469,17 +495,28 @@ SvTreeListEntry* OfaSwAutoFmtOptionsPage::CreateEntry(OUString& rTxt, sal_uInt16
OfaSwAutoFmtOptionsPage::~OfaSwAutoFmtOptionsPage()
{
- delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( REPLACE_BULLETS ));
- delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( APPLY_NUMBERING ));
- delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( MERGE_SINGLE_LINE_PARA ));
- delete pCheckButtonData;
- delete m_pCheckLB;
+ disposeOnce();
+}
+
+void OfaSwAutoFmtOptionsPage::dispose()
+{
+ if (m_pCheckLB)
+ {
+ delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( REPLACE_BULLETS ));
+ delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( APPLY_NUMBERING ));
+ delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( MERGE_SINGLE_LINE_PARA ));
+ delete pCheckButtonData;
+ pCheckButtonData = NULL;
+ }
+ m_pCheckLB.disposeAndClear();
+ m_pEditPB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaSwAutoFmtOptionsPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> OfaSwAutoFmtOptionsPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new OfaSwAutoFmtOptionsPage(pParent, *rAttrSet);
+ return VclPtr<SfxTabPage>( new OfaSwAutoFmtOptionsPage(pParent, *rAttrSet), SAL_NO_ACQUIRE );
}
bool OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet* )
@@ -694,7 +731,7 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl)
if( nSelEntryPos == REPLACE_BULLETS ||
nSelEntryPos == APPLY_NUMBERING)
{
- boost::scoped_ptr<SvxCharacterMap> pMapDlg(new SvxCharacterMap(this));
+ ScopedVclPtrInstance< SvxCharacterMap > pMapDlg(this);
ImpUserData* pUserData = static_cast<ImpUserData*>(m_pCheckLB->FirstSelected()->GetUserData());
pMapDlg->SetCharFont(*pUserData->pFont);
pMapDlg->SetChar( (*pUserData->pString)[0] );
@@ -711,11 +748,11 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl)
else if( MERGE_SINGLE_LINE_PARA == nSelEntryPos )
{
// dialog for per cent settings
- OfaAutoFmtPrcntSet aDlg(this);
- aDlg.GetPrcntFld().SetValue(nPercent);
- if(RET_OK == aDlg.Execute())
+ ScopedVclPtrInstance< OfaAutoFmtPrcntSet > aDlg(this);
+ aDlg->GetPrcntFld().SetValue(nPercent);
+ if(RET_OK == aDlg->Execute())
{
- nPercent = (sal_uInt16)aDlg.GetPrcntFld().GetValue();
+ nPercent = (sal_uInt16)aDlg->GetPrcntFld().GetValue();
sMargin = " " +
unicode::formatPercent(nPercent, Application::GetSettings().GetUILanguageTag());
}
@@ -897,16 +934,31 @@ void OfaAutocorrReplacePage::Resize()
OfaAutocorrReplacePage::~OfaAutocorrReplacePage()
{
+ disposeOnce();
+}
+
+void OfaAutocorrReplacePage::dispose()
+{
aDoubleStringTable.clear();
aChangesTable.clear();
delete pCompareClass;
+ pCompareClass = NULL;
delete pCharClass;
+ pCharClass = NULL;
+
+ m_pTextOnlyCB.clear();
+ m_pShortED.clear();
+ m_pReplaceED.clear();
+ m_pReplaceTLB.clear();
+ m_pNewReplacePB.clear();
+ m_pDeleteReplacePB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaAutocorrReplacePage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> OfaAutocorrReplacePage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new OfaAutocorrReplacePage(pParent, *rSet);
+ return VclPtr<OfaAutocorrReplacePage>::Create(pParent, *rSet);
}
void OfaAutocorrReplacePage::ActivatePage( const SfxItemSet& )
@@ -1400,14 +1452,30 @@ OfaAutocorrExceptPage::OfaAutocorrExceptPage(vcl::Window* pParent, const SfxItem
OfaAutocorrExceptPage::~OfaAutocorrExceptPage()
{
+ disposeOnce();
+}
+
+void OfaAutocorrExceptPage::dispose()
+{
aStringsTable.clear();
delete pCompareClass;
+ m_pAbbrevED.clear();
+ m_pAbbrevLB.clear();
+ m_pNewAbbrevPB.clear();
+ m_pDelAbbrevPB.clear();
+ m_pAutoAbbrevCB.clear();
+ m_pDoubleCapsED.clear();
+ m_pDoubleCapsLB.clear();
+ m_pNewDoublePB.clear();
+ m_pDelDoublePB.clear();
+ m_pAutoCapsCB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaAutocorrExceptPage::Create( vcl::Window* pParent,
- const SfxItemSet* rSet)
+VclPtr<SfxTabPage> OfaAutocorrExceptPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rSet)
{
- return new OfaAutocorrExceptPage(pParent, *rSet);
+ return VclPtr<OfaAutocorrExceptPage>::Create(pParent, *rSet);
}
void OfaAutocorrExceptPage::ActivatePage( const SfxItemSet& )
@@ -1618,7 +1686,7 @@ void OfaAutocorrExceptPage::Reset( const SfxItemSet* )
IMPL_LINK(OfaAutocorrExceptPage, NewDelHdl, void*, pBtn)
{
- if((pBtn == m_pNewAbbrevPB || pBtn == m_pAbbrevED )
+ if((pBtn == m_pNewAbbrevPB || pBtn == m_pAbbrevED.get() )
&& !m_pAbbrevED->GetText().isEmpty())
{
m_pAbbrevLB->InsertEntry(m_pAbbrevED->GetText());
@@ -1629,7 +1697,7 @@ IMPL_LINK(OfaAutocorrExceptPage, NewDelHdl, void*, pBtn)
m_pAbbrevLB->RemoveEntry(m_pAbbrevED->GetText());
ModifyHdl(m_pAbbrevED);
}
- else if((pBtn == m_pNewDoublePB || pBtn == m_pDoubleCapsED )
+ else if((pBtn == m_pNewDoublePB || pBtn == m_pDoubleCapsED.get() )
&& !m_pDoubleCapsED->GetText().isEmpty())
{
m_pDoubleCapsLB->InsertEntry(m_pDoubleCapsED->GetText());
@@ -1756,7 +1824,7 @@ OfaQuoteTabPage::OfaQuoteTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
pListContainer->set_width_request(aControlSize.Width());
pListContainer->set_height_request(aControlSize.Height());
- m_pSwCheckLB = new OfaACorrCheckListBox(*pListContainer),
+ m_pSwCheckLB = VclPtr<OfaACorrCheckListBox>::Create(*pListContainer),
get(m_pSingleTypoCB, "singlereplace");
get(m_pSglStartQuotePB, "startsingle");
@@ -1817,14 +1885,35 @@ OfaQuoteTabPage::OfaQuoteTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
OfaQuoteTabPage::~OfaQuoteTabPage()
{
- delete pCheckButtonData;
- delete m_pSwCheckLB;
+ disposeOnce();
}
-SfxTabPage* OfaQuoteTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+void OfaQuoteTabPage::dispose()
{
- return new OfaQuoteTabPage(pParent, *rAttrSet);
+ delete pCheckButtonData;
+ pCheckButtonData = NULL;
+ m_pSwCheckLB.disposeAndClear();
+ m_pCheckLB.disposeAndClear();
+ m_pSingleTypoCB.clear();
+ m_pSglStartQuotePB.clear();
+ m_pSglStartExFT.clear();
+ m_pSglEndQuotePB.clear();
+ m_pSglEndExFT.clear();
+ m_pSglStandardPB.clear();
+ m_pDoubleTypoCB.clear();
+ m_pDblStartQuotePB.clear();
+ m_pDblStartExFT.clear();
+ m_pDblEndQuotePB.clear();
+ m_pDblEndExFT.clear();
+ m_pDblStandardPB.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> OfaQuoteTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
+{
+ return VclPtr<SfxTabPage>( new OfaQuoteTabPage(pParent, *rAttrSet),
+ SAL_NO_ACQUIRE );
}
bool OfaQuoteTabPage::FillItemSet( SfxItemSet* )
@@ -1973,7 +2062,7 @@ IMPL_LINK( OfaQuoteTabPage, QuoteHdl, PushButton*, pBtn )
else if (pBtn == m_pDblEndQuotePB)
nMode = DBL_END;
// start character selection dialog
- boost::scoped_ptr<SvxCharacterMap> pMap(new SvxCharacterMap( this, true ));
+ ScopedVclPtrInstance< SvxCharacterMap > pMap( this, true );
pMap->SetCharFont( OutputDevice::GetDefaultFont(DEFAULTFONT_LATIN_TEXT,
LANGUAGE_ENGLISH_US, DEFAULTFONT_FLAGS_ONLYONE, 0 ));
pMap->SetText(nMode < SGL_END ? m_sStartQuoteDlg : m_sEndQuoteDlg );
@@ -2143,12 +2232,28 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage(vcl::Window* pParent,
OfaAutoCompleteTabPage::~OfaAutoCompleteTabPage()
{
+ disposeOnce();
}
-SfxTabPage* OfaAutoCompleteTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rSet)
+void OfaAutoCompleteTabPage::dispose()
{
- return new OfaAutoCompleteTabPage( pParent, *rSet );
+ m_pCBActiv.clear();
+ m_pCBAppendSpace.clear();
+ m_pCBAsTip.clear();
+ m_pCBCollect.clear();
+ m_pCBRemoveList.clear();
+ m_pDCBExpandKey.clear();
+ m_pNFMinWordlen.clear();
+ m_pNFMaxEntries.clear();
+ m_pLBEntries.clear();
+ m_pPBEntries.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> OfaAutoCompleteTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rSet)
+{
+ return VclPtr<SfxTabPage>( new OfaAutoCompleteTabPage( pParent, *rSet ), SAL_NO_ACQUIRE );
}
bool OfaAutoCompleteTabPage::FillItemSet( SfxItemSet* )
@@ -2318,6 +2423,17 @@ void OfaAutoCompleteTabPage::CopyToClipboard() const
}
}
+OfaAutoCompleteTabPage::AutoCompleteMultiListBox::~AutoCompleteMultiListBox()
+{
+ disposeOnce();
+}
+
+void OfaAutoCompleteTabPage::AutoCompleteMultiListBox::dispose()
+{
+ m_pPage.clear();
+ MultiListBox::dispose();
+}
+
bool OfaAutoCompleteTabPage::AutoCompleteMultiListBox::PreNotify(
NotifyEvent& rNEvt )
{
@@ -2381,12 +2497,20 @@ OfaSmartTagOptionsTabPage::OfaSmartTagOptionsTabPage( vcl::Window* pParent,
OfaSmartTagOptionsTabPage::~OfaSmartTagOptionsTabPage()
{
+ disposeOnce();
+}
+void OfaSmartTagOptionsTabPage::dispose()
+{
+ m_pMainCB.clear();
+ m_pSmartTagTypesLB.clear();
+ m_pPropertiesPB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaSmartTagOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> OfaSmartTagOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new OfaSmartTagOptionsTabPage( pParent, *rSet );
+ return VclPtr<OfaSmartTagOptionsTabPage>::Create( pParent, *rSet );
}
/** This struct is used to associate list box entries with smart tag data
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 6be44956e12d..6ff30321d4d3 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -183,6 +183,7 @@ public:
BackgroundPreviewImpl(vcl::Window* pParent);
void setBmp(bool bBmp);
virtual ~BackgroundPreviewImpl();
+ virtual void dispose() SAL_OVERRIDE;
void NotifyChange( const Color& rColor );
void NotifyChange( const Bitmap* pBitmap );
@@ -230,9 +231,15 @@ void BackgroundPreviewImpl::setBmp(bool bBmp)
BackgroundPreviewImpl::~BackgroundPreviewImpl()
{
- delete pBitmap;
+ disposeOnce();
}
+void BackgroundPreviewImpl::dispose()
+{
+ delete pBitmap;
+ pBitmap = NULL;
+ vcl::Window::dispose();
+}
void BackgroundPreviewImpl::NotifyChange( const Color& rColor )
{
@@ -422,9 +429,20 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const SfxItemSe
SvxBackgroundTabPage::~SvxBackgroundTabPage()
{
- delete pPageImpl->pLoadIdle;
- delete pPageImpl;
+ disposeOnce();
+}
+
+void SvxBackgroundTabPage::dispose()
+{
+ if (pPageImpl)
+ {
+ delete pPageImpl->pLoadIdle;
+ delete pPageImpl;
+ pPageImpl = NULL;
+ }
+
delete pImportDlg;
+ pImportDlg = NULL;
if( pTableBck_Impl)
{
@@ -432,6 +450,7 @@ SvxBackgroundTabPage::~SvxBackgroundTabPage()
delete pTableBck_Impl->pRowBrush;
delete pTableBck_Impl->pTableBrush;
delete pTableBck_Impl;
+ pTableBck_Impl = NULL;
}
if(pParaBck_Impl)
@@ -439,21 +458,44 @@ SvxBackgroundTabPage::~SvxBackgroundTabPage()
delete pParaBck_Impl->pParaBrush;
delete pParaBck_Impl->pCharBrush;
delete pParaBck_Impl;
+ pParaBck_Impl = NULL;
}
-}
-
+ m_pAsGrid.clear();
+ m_pSelectTxt.clear();
+ m_pLbSelect.clear();
+ m_pTblDesc.clear();
+ m_pTblLBox.clear();
+ m_pParaLBox.clear();
+ m_pBackGroundColorFrame.clear();
+ m_pBackgroundColorSet.clear();
+ m_pPreviewWin1.clear();
+ m_pColTransFT.clear();
+ m_pColTransMF.clear();
+ m_pBtnPreview.clear();
+ m_pBitmapContainer.clear();
+ m_pFileFrame.clear();
+ m_pBtnBrowse.clear();
+ m_pBtnLink.clear();
+ m_pFtUnlinked.clear();
+ m_pFtFile.clear();
+ m_pTypeFrame.clear();
+ m_pBtnPosition.clear();
+ m_pBtnArea.clear();
+ m_pBtnTile.clear();
+ m_pWndPosition.clear();
+ m_pGraphTransFrame.clear();
+ m_pGraphTransMF.clear();
+ m_pPreviewWin2.clear();
+ SvxTabPage::dispose();
+}
-SfxTabPage* SvxBackgroundTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
-
-/* [Description]
- create method for the TabDialog
-*/
+VclPtr<SfxTabPage> SvxBackgroundTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
{
- return ( new SvxBackgroundTabPage( pParent, *rAttrSet ) );
+ return VclPtr<SfxTabPage>( new SvxBackgroundTabPage( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
}
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 803779389026..387e003402c3 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -334,21 +334,47 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
m_pMergeAdjacentBordersCB->Hide();
}
-
-
SvxBorderTabPage::~SvxBorderTabPage()
{
+ disposeOnce();
}
-
-
-SfxTabPage* SvxBorderTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+void SvxBorderTabPage::dispose()
{
- return ( new SvxBorderTabPage( pParent, *rAttrSet ) );
+ m_pWndPresets.clear();
+ m_pUserDefFT.clear();
+ m_pFrameSel.clear();
+ m_pLbLineStyle.clear();
+ m_pLbLineColor.clear();
+ m_pLineWidthMF.clear();
+ m_pSpacingFrame.clear();
+ m_pLeftFT.clear();
+ m_pLeftMF.clear();
+ m_pRightFT.clear();
+ m_pRightMF.clear();
+ m_pTopFT.clear();
+ m_pTopMF.clear();
+ m_pBottomFT.clear();
+ m_pBottomMF.clear();
+ m_pSynchronizeCB.clear();
+ m_pShadowFrame.clear();
+ m_pWndShadows.clear();
+ m_pFtShadowSize.clear();
+ m_pEdShadowSize.clear();
+ m_pFtShadowColor.clear();
+ m_pLbShadowColor.clear();
+ m_pPropertiesFrame.clear();
+ m_pMergeWithNextCB.clear();
+ m_pMergeAdjacentBordersCB.clear();
+ SfxTabPage::dispose();
}
-
+VclPtr<SfxTabPage> SvxBorderTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SfxTabPage>(new SvxBorderTabPage( pParent, *rAttrSet ),
+ SAL_NO_ACQUIRE);
+}
void SvxBorderTabPage::ResetFrameLine_Impl( svx::FrameBorderType eBorder, const SvxBorderLine* pCoreLine, bool bValid )
{
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 6df37aa3d3d8..96da16d8c445 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -183,12 +183,16 @@ SvxCharBasePage::SvxCharBasePage(vcl::Window* pParent, const OString& rID, const
{
}
-
-
SvxCharBasePage::~SvxCharBasePage()
{
+ disposeOnce();
}
+void SvxCharBasePage::dispose()
+{
+ m_pPreviewWin.clear();
+ SfxTabPage::dispose();
+}
void SvxCharBasePage::ActivatePage( const SfxItemSet& rSet )
@@ -375,10 +379,45 @@ SvxCharNamePage::SvxCharNamePage( vcl::Window* pParent, const SfxItemSet& rInSet
SvxCharNamePage::~SvxCharNamePage()
{
- delete m_pImpl;
+ disposeOnce();
}
-
+void SvxCharNamePage::dispose()
+{
+ delete m_pImpl;
+ m_pImpl = NULL;
+ m_pWestFrame.clear();
+ m_pWestFontNameFT.clear();
+ m_pWestFontNameLB.clear();
+ m_pWestFontStyleFT.clear();
+ m_pWestFontStyleLB.clear();
+ m_pWestFontSizeFT.clear();
+ m_pWestFontSizeLB.clear();
+ m_pWestFontLanguageFT.clear();
+ m_pWestFontLanguageLB.clear();
+ m_pWestFontTypeFT.clear();
+ m_pEastFrame.clear();
+ m_pEastFontNameFT.clear();
+ m_pEastFontNameLB.clear();
+ m_pEastFontStyleFT.clear();
+ m_pEastFontStyleLB.clear();
+ m_pEastFontSizeFT.clear();
+ m_pEastFontSizeLB.clear();
+ m_pEastFontLanguageFT.clear();
+ m_pEastFontLanguageLB.clear();
+ m_pEastFontTypeFT.clear();
+ m_pCTLFrame.clear();
+ m_pCTLFontNameFT.clear();
+ m_pCTLFontNameLB.clear();
+ m_pCTLFontStyleFT.clear();
+ m_pCTLFontStyleLB.clear();
+ m_pCTLFontSizeFT.clear();
+ m_pCTLFontSizeLB.clear();
+ m_pCTLFontLanguageFT.clear();
+ m_pCTLFontLanguageLB.clear();
+ m_pCTLFontTypeFT.clear();
+ SvxCharBasePage::dispose();
+}
void SvxCharNamePage::Initialize()
{
@@ -1180,9 +1219,10 @@ SfxTabPage::sfxpg SvxCharNamePage::DeactivatePage( SfxItemSet* _pSet )
-SfxTabPage* SvxCharNamePage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxCharNamePage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxCharNamePage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxCharNamePage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
@@ -1337,6 +1377,37 @@ SvxCharEffectsPage::SvxCharEffectsPage( vcl::Window* pParent, const SfxItemSet&
Initialize();
}
+SvxCharEffectsPage::~SvxCharEffectsPage()
+{
+ disposeOnce();
+}
+
+void SvxCharEffectsPage::dispose()
+{
+ m_pFontColorFT.clear();
+ m_pFontColorLB.clear();
+ m_pEffectsFT.clear();
+ m_pEffectsLB.clear();
+ m_pReliefFT.clear();
+ m_pReliefLB.clear();
+ m_pOutlineBtn.clear();
+ m_pShadowBtn.clear();
+ m_pBlinkingBtn.clear();
+ m_pHiddenBtn.clear();
+ m_pOverlineLB.clear();
+ m_pOverlineColorFT.clear();
+ m_pOverlineColorLB.clear();
+ m_pStrikeoutLB.clear();
+ m_pUnderlineLB.clear();
+ m_pUnderlineColorFT.clear();
+ m_pUnderlineColorLB.clear();
+ m_pIndividualWordsBtn.clear();
+ m_pEmphasisFT.clear();
+ m_pEmphasisLB.clear();
+ m_pPositionFT.clear();
+ m_pPositionLB.clear();
+ SvxCharBasePage::dispose();
+}
void SvxCharEffectsPage::Initialize()
@@ -1440,12 +1511,6 @@ void SvxCharEffectsPage::Initialize()
}
}
-SvxCharEffectsPage::~SvxCharEffectsPage()
-{
-}
-
-
-
void SvxCharEffectsPage::UpdatePreview_Impl()
{
SvxFont& rFont = GetPreviewFont();
@@ -1643,7 +1708,7 @@ IMPL_LINK( SvxCharEffectsPage, SelectHdl_Impl, ListBox*, pBox )
m_pOutlineBtn->Enable( bEnable );
m_pShadowBtn->Enable( bEnable );
}
- else if ( m_pPositionLB != pBox )
+ else if ( m_pPositionLB.get() != pBox )
{
sal_Int32 nUPos = m_pUnderlineLB->GetSelectEntryPos(),
nOPos = m_pOverlineLB->GetSelectEntryPos(),
@@ -1720,9 +1785,10 @@ SfxTabPage::sfxpg SvxCharEffectsPage::DeactivatePage( SfxItemSet* _pSet )
-SfxTabPage* SvxCharEffectsPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxCharEffectsPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxCharEffectsPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxCharEffectsPage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
@@ -2585,6 +2651,35 @@ SvxCharPositionPage::SvxCharPositionPage( vcl::Window* pParent, const SfxItemSet
Initialize();
}
+SvxCharPositionPage::~SvxCharPositionPage()
+{
+ disposeOnce();
+}
+
+void SvxCharPositionPage::dispose()
+{
+ m_pHighPosBtn.clear();
+ m_pNormalPosBtn.clear();
+ m_pLowPosBtn.clear();
+ m_pHighLowFT.clear();
+ m_pHighLowMF.clear();
+ m_pHighLowRB.clear();
+ m_pFontSizeFT.clear();
+ m_pFontSizeMF.clear();
+ m_pRotationContainer.clear();
+ m_pScalingFT.clear();
+ m_pScalingAndRotationFT.clear();
+ m_p0degRB.clear();
+ m_p90degRB.clear();
+ m_p270degRB.clear();
+ m_pFitToLineCB.clear();
+ m_pScaleWidthMF.clear();
+ m_pKerningLB.clear();
+ m_pKerningFT.clear();
+ m_pKerningMF.clear();
+ m_pPairKerningBtn.clear();
+ SvxCharBasePage::dispose();
+}
void SvxCharPositionPage::Initialize()
@@ -2627,12 +2722,6 @@ void SvxCharPositionPage::Initialize()
m_pScaleWidthMF->SetModifyHdl( LINK( this, SvxCharPositionPage, ScaleWidthModifyHdl_Impl ) );
}
-SvxCharPositionPage::~SvxCharPositionPage()
-{
-}
-
-
-
void SvxCharPositionPage::UpdatePreview_Impl( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc )
{
SetPrevFontEscapement( nProp, nEscProp, nEsc );
@@ -2887,9 +2976,10 @@ SfxTabPage::sfxpg SvxCharPositionPage::DeactivatePage( SfxItemSet* _pSet )
-SfxTabPage* SvxCharPositionPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxCharPositionPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxCharPositionPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxCharPositionPage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
@@ -3323,9 +3413,17 @@ SvxCharTwoLinesPage::SvxCharTwoLinesPage(vcl::Window* pParent, const SfxItemSet&
SvxCharTwoLinesPage::~SvxCharTwoLinesPage()
{
+ disposeOnce();
}
-
+void SvxCharTwoLinesPage::dispose()
+{
+ m_pTwoLinesBtn.clear();
+ m_pEnclosingFrame.clear();
+ m_pStartBracketLB.clear();
+ m_pEndBracketLB.clear();
+ SvxCharBasePage::dispose();
+}
void SvxCharTwoLinesPage::Initialize()
{
@@ -3351,7 +3449,7 @@ void SvxCharTwoLinesPage::Initialize()
void SvxCharTwoLinesPage::SelectCharacter( ListBox* pBox )
{
bool bStart = pBox == m_pStartBracketLB;
- boost::scoped_ptr<SvxCharacterMap> aDlg(new SvxCharacterMap( this ));
+ VclPtrInstance< SvxCharacterMap > aDlg( this );
aDlg->DisableFontSelection();
if ( aDlg->Execute() == RET_OK )
@@ -3451,9 +3549,10 @@ SfxTabPage::sfxpg SvxCharTwoLinesPage::DeactivatePage( SfxItemSet* _pSet )
-SfxTabPage* SvxCharTwoLinesPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxCharTwoLinesPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxCharTwoLinesPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxCharTwoLinesPage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
void SvxCharTwoLinesPage::Reset( const SfxItemSet* rSet )
diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx
index 6b49e2aa0e83..66b493516fc1 100644
--- a/cui/source/tabpages/connect.cxx
+++ b/cui/source/tabpages/connect.cxx
@@ -54,7 +54,7 @@ SvxConnectionDialog::SvxConnectionDialog( vcl::Window* pParent, const SfxItemSet
const SdrView* pSdrView )
: SfxSingleTabDialog(pParent, rInAttrs)
{
- SvxConnectionPage* _pPage = new SvxConnectionPage( get_content_area(), rInAttrs );
+ VclPtrInstance<SvxConnectionPage> _pPage( get_content_area(), rInAttrs );
_pPage->SetView( pSdrView );
_pPage->Construct();
@@ -65,16 +65,6 @@ SvxConnectionDialog::SvxConnectionDialog( vcl::Window* pParent, const SfxItemSet
/*************************************************************************
|*
-|* Dtor
-|*
-\************************************************************************/
-
-SvxConnectionDialog::~SvxConnectionDialog()
-{
-}
-
-/*************************************************************************
-|*
|* page for changing connectors
|*
\************************************************************************/
@@ -141,14 +131,26 @@ SvxConnectionPage::SvxConnectionPage( vcl::Window* pWindow, const SfxItemSet& rI
m_pLbType->SetSelectHdl( aLink );
}
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
SvxConnectionPage::~SvxConnectionPage()
{
+ disposeOnce();
+}
+
+void SvxConnectionPage::dispose()
+{
+ m_pLbType.clear();
+ m_pFtLine1.clear();
+ m_pMtrFldLine1.clear();
+ m_pFtLine2.clear();
+ m_pMtrFldLine2.clear();
+ m_pFtLine3.clear();
+ m_pMtrFldLine3.clear();
+ m_pMtrFldHorz1.clear();
+ m_pMtrFldVert1.clear();
+ m_pMtrFldHorz2.clear();
+ m_pMtrFldVert2.clear();
+ m_pCtlPreview.clear();
+ SfxTabPage::dispose();
}
/*************************************************************************
@@ -388,10 +390,10 @@ void SvxConnectionPage::Construct()
|*
\************************************************************************/
-SfxTabPage* SvxConnectionPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxConnectionPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxConnectionPage( pWindow, *rAttrs );
+ return VclPtr<SvxConnectionPage>::Create( pWindow, *rAttrs );
}
IMPL_LINK( SvxConnectionPage, ChangeAttrHdl_Impl, void *, p )
diff --git a/cui/source/tabpages/dstribut.cxx b/cui/source/tabpages/dstribut.cxx
index 86d23299112b..ac14dbd34f17 100644
--- a/cui/source/tabpages/dstribut.cxx
+++ b/cui/source/tabpages/dstribut.cxx
@@ -37,10 +37,21 @@ SvxDistributeDialog::SvxDistributeDialog(vcl::Window* pParent,
"cui/ui/distributiondialog.ui")
, mpPage(NULL)
{
- mpPage = new SvxDistributePage(get_content_area(), rInAttrs, eHor, eVer);
+ mpPage = VclPtr<SvxDistributePage>::Create(get_content_area(), rInAttrs, eHor, eVer);
SetTabPage(mpPage);
}
+SvxDistributeDialog::~SvxDistributeDialog()
+{
+ disposeOnce();
+}
+
+void SvxDistributeDialog::dispose()
+{
+ mpPage.clear();
+ SfxSingleTabDialog::dispose();
+}
+
/*************************************************************************
|*
|* Tabpage
@@ -68,16 +79,37 @@ SvxDistributePage::SvxDistributePage(vcl::Window* pWindow,
get(m_pBtnVerBottom, "verbottom");
}
+SvxDistributePage::~SvxDistributePage()
+{
+ disposeOnce();
+}
+
+void SvxDistributePage::dispose()
+{
+ m_pBtnHorNone.clear();
+ m_pBtnHorLeft.clear();
+ m_pBtnHorCenter.clear();
+ m_pBtnHorDistance.clear();
+ m_pBtnHorRight.clear();
+ m_pBtnVerNone.clear();
+ m_pBtnVerTop.clear();
+ m_pBtnVerCenter.clear();
+ m_pBtnVerDistance.clear();
+ m_pBtnVerBottom.clear();
+ SvxTabPage::dispose();
+}
+
+
/*************************************************************************
|*
|* create the tabpage
|*
\************************************************************************/
-SfxTabPage* SvxDistributePage::Create(vcl::Window* pWindow, const SfxItemSet& rAttrs,
+VclPtr<SfxTabPage> SvxDistributePage::Create(vcl::Window* pWindow, const SfxItemSet& rAttrs,
SvxDistributeHorizontal eHor, SvxDistributeVertical eVer)
{
- return new SvxDistributePage(pWindow, rAttrs, eHor, eVer);
+ return VclPtr<SvxDistributePage>::Create(pWindow, rAttrs, eHor, eVer);
}
void SvxDistributePage::PointChanged(vcl::Window* /*pWindow*/, RECT_POINT /*eRP*/)
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index c416ad7c267f..af1c96b4be62 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -127,12 +127,37 @@ SvxGrfCropPage::SvxGrfCropPage ( vcl::Window *pParent, const SfxItemSet &rSet )
SvxGrfCropPage::~SvxGrfCropPage()
{
+ disposeOnce();
+}
+
+void SvxGrfCropPage::dispose()
+{
aTimer.Stop();
+ m_pCropFrame.clear();
+ m_pZoomConstRB.clear();
+ m_pSizeConstRB.clear();
+ m_pLeftMF.clear();
+ m_pRightMF.clear();
+ m_pTopMF.clear();
+ m_pBottomMF.clear();
+ m_pScaleFrame.clear();
+ m_pWidthZoomMF.clear();
+ m_pHeightZoomMF.clear();
+ m_pSizeFrame.clear();
+ m_pWidthMF.clear();
+ m_pHeightMF.clear();
+ m_pOrigSizeGrid.clear();
+ m_pOrigSizeFT.clear();
+ m_pOrigSizePB.clear();
+ m_pExampleWN.clear();
+ pLastCropField.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxGrfCropPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
+VclPtr<SfxTabPage> SvxGrfCropPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
{
- return new SvxGrfCropPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxGrfCropPage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
@@ -675,17 +700,17 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
// display original size
const FieldUnit eMetric = GetModuleFieldUnit( GetItemSet() );
- MetricField aFld(this, WB_HIDE);
- SetFieldUnit( aFld, eMetric );
- aFld.SetDecimalDigits( m_pWidthMF->GetDecimalDigits() );
- aFld.SetMax( LONG_MAX - 1 );
+ ScopedVclPtrInstance< MetricField > aFld(this, WB_HIDE);
+ SetFieldUnit( *aFld.get(), eMetric );
+ aFld->SetDecimalDigits( m_pWidthMF->GetDecimalDigits() );
+ aFld->SetMax( LONG_MAX - 1 );
- aFld.SetValue( aFld.Normalize( aOrigSize.Width() ), eUnit );
- OUString sTemp = aFld.GetText();
- aFld.SetValue( aFld.Normalize( aOrigSize.Height() ), eUnit );
+ aFld->SetValue( aFld->Normalize( aOrigSize.Width() ), eUnit );
+ OUString sTemp = aFld->GetText();
+ aFld->SetValue( aFld->Normalize( aOrigSize.Height() ), eUnit );
// multiplication sign (U+00D7)
sTemp += OUString( sal_Unicode (0x00D7) );
- sTemp += aFld.GetText();
+ sTemp += aFld->GetText();
if ( aOrigPixelSize.Width() && aOrigPixelSize.Height() ) {
sal_Int32 ax = sal_Int32(floor((float)aOrigPixelSize.Width() /
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index 243d9dcf038d..d57e180245d1 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -138,6 +138,26 @@ SvxCaptionTabPage::SvxCaptionTabPage(vcl::Window* pParent, const SfxItemSet& rIn
m_pCB_LAENGE->SetClickHdl(LINK(this,SvxCaptionTabPage,LineOptHdl_Impl));
}
+SvxCaptionTabPage::~SvxCaptionTabPage()
+{
+ disposeOnce();
+}
+
+void SvxCaptionTabPage::dispose()
+{
+ m_pCT_CAPTTYPE.clear();
+ m_pMF_ABSTAND.clear();
+ m_pLB_ANSATZ.clear();
+ m_pFT_UM.clear();
+ m_pMF_ANSATZ.clear();
+ m_pFT_ANSATZ_REL.clear();
+ m_pLB_ANSATZ_REL.clear();
+ m_pFT_LAENGE.clear();
+ m_pMF_LAENGE.clear();
+ m_pCB_LAENGE.clear();
+ SfxTabPage::dispose();
+}
+
void SvxCaptionTabPage::Construct()
{
// set rectangle and working area
@@ -336,10 +356,10 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
-SfxTabPage* SvxCaptionTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxCaptionTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rOutAttrs )
{
- return new SvxCaptionTabPage( pWindow, *rOutAttrs );
+ return VclPtr<SvxCaptionTabPage>::Create( pWindow, *rOutAttrs );
}
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index 64d38b7e4ddf..ced57182cea9 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -44,16 +44,16 @@ class _SfxMacroTabPage_Impl
public:
_SfxMacroTabPage_Impl();
- OUString maStaticMacroLBLabel;
- PushButton* pAssignPB;
- PushButton* pDeletePB;
- OUString sStrEvent;
- OUString sAssignedMacro;
- MacroEventListBox* pEventLB;
- VclFrame* pGroupFrame;
- SfxConfigGroupListBox* pGroupLB;
- VclFrame* pMacroFrame;
- SfxConfigFunctionListBox* pMacroLB;
+ OUString maStaticMacroLBLabel;
+ VclPtr<PushButton> pAssignPB;
+ VclPtr<PushButton> pDeletePB;
+ OUString sStrEvent;
+ OUString sAssignedMacro;
+ VclPtr<MacroEventListBox> pEventLB;
+ VclPtr<VclFrame> pGroupFrame;
+ VclPtr<SfxConfigGroupListBox> pGroupLB;
+ VclPtr<VclFrame> pMacroFrame;
+ VclPtr<SfxConfigFunctionListBox> pMacroLB;
bool bReadOnly;
Idle maFillGroupIdle;
@@ -143,7 +143,13 @@ _SfxMacroTabPage::_SfxMacroTabPage(vcl::Window* pParent, const SfxItemSet& rAttr
_SfxMacroTabPage::~_SfxMacroTabPage()
{
+ disposeOnce();
+}
+
+void _SfxMacroTabPage::dispose()
+{
DELETEZ( mpImpl );
+ SfxTabPage::dispose();
}
void _SfxMacroTabPage::AddEvent( const OUString & rEventName, sal_uInt16 nEventId )
@@ -454,13 +460,13 @@ SfxMacroTabPage::SfxMacroTabPage(vcl::Window* pParent, const Reference< XFrame >
namespace
{
- SfxMacroTabPage* CreateSfxMacroTabPage( vcl::Window* pParent, const SfxItemSet& rAttrSet )
+ VclPtr<SfxMacroTabPage> CreateSfxMacroTabPage( vcl::Window* pParent, const SfxItemSet& rAttrSet )
{
- return new SfxMacroTabPage( pParent, NULL, rAttrSet );
+ return VclPtr<SfxMacroTabPage>( new SfxMacroTabPage( pParent, NULL, rAttrSet ), SAL_NO_ACQUIRE );
}
}
-SfxTabPage* SfxMacroTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SfxMacroTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
return CreateSfxMacroTabPage(pParent, *rAttrSet);
}
diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index ea086be40fb3..2053ecf37977 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -64,7 +64,7 @@ SvxMeasureDialog::SvxMeasureDialog( vcl::Window* pParent, const SfxItemSet& rInA
const SdrView* pSdrView )
: SfxSingleTabDialog(pParent, rInAttrs)
{
- SvxMeasurePage* _pPage = new SvxMeasurePage( get_content_area(), rInAttrs );
+ VclPtrInstance<SvxMeasurePage> _pPage( get_content_area(), rInAttrs );
_pPage->SetView( pSdrView );
_pPage->Construct();
@@ -148,14 +148,29 @@ SvxMeasurePage::SvxMeasurePage( vcl::Window* pWindow, const SfxItemSet& rInAttrs
m_pLbUnit->SetSelectHdl( aLink );
}
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
SvxMeasurePage::~SvxMeasurePage()
{
+ disposeOnce();
+}
+
+void SvxMeasurePage::dispose()
+{
+ m_pMtrFldLineDist.clear();
+ m_pMtrFldHelplineOverhang.clear();
+ m_pMtrFldHelplineDist.clear();
+ m_pMtrFldHelpline1Len.clear();
+ m_pMtrFldHelpline2Len.clear();
+ m_pTsbBelowRefEdge.clear();
+ m_pMtrFldDecimalPlaces.clear();
+ m_pCtlPosition.clear();
+ m_pTsbAutoPosV.clear();
+ m_pTsbAutoPosH.clear();
+ m_pTsbShowUnit.clear();
+ m_pLbUnit.clear();
+ m_pTsbParallel.clear();
+ m_pFtAutomatic.clear();
+ m_pCtlPreview.clear();
+ SvxTabPage::dispose();
}
/*************************************************************************
@@ -587,16 +602,10 @@ void SvxMeasurePage::Construct()
m_pCtlPreview->Invalidate();
}
-/*************************************************************************
-|*
-|* create the tabpage
-|*
-\************************************************************************/
-
-SfxTabPage* SvxMeasurePage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxMeasurePage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxMeasurePage( pWindow, *rAttrs );
+ return VclPtr<SvxMeasurePage>::Create( pWindow, *rAttrs );
}
void SvxMeasurePage::PointChanged( vcl::Window* pWindow, RECT_POINT /*eRP*/ )
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index bc6f14273893..852607ca84c5 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -282,8 +282,41 @@ SvxNumberFormatTabPage::SvxNumberFormatTabPage(vcl::Window* pParent,
SvxNumberFormatTabPage::~SvxNumberFormatTabPage()
{
+ disposeOnce();
+}
+
+
+void SvxNumberFormatTabPage::dispose()
+{
delete pNumFmtShell;
+ pNumFmtShell = NULL;
delete pNumItem;
+ pNumItem = NULL;
+ m_pFtCategory.clear();
+ m_pLbCategory.clear();
+ m_pFtFormat.clear();
+ m_pLbCurrency.clear();
+ m_pLbFormat.clear();
+ m_pFtLanguage.clear();
+ m_pLbLanguage.clear();
+ m_pCbSourceFormat.clear();
+ m_pWndPreview.clear();
+ m_pFtOptions.clear();
+ m_pFtDecimals.clear();
+ m_pEdDecimals.clear();
+ m_pBtnNegRed.clear();
+ m_pFtLeadZeroes.clear();
+ m_pEdLeadZeroes.clear();
+ m_pBtnThousand.clear();
+ m_pFormatCodeFrame.clear();
+ m_pEdFormat.clear();
+ m_pIbAdd.clear();
+ m_pIbInfo.clear();
+ m_pIbRemove.clear();
+ m_pFtComment.clear();
+ m_pEdComment.clear();
+ pLastActivWindow.clear();
+ SfxTabPage::dispose();
}
void SvxNumberFormatTabPage::Init_Impl()
@@ -347,21 +380,10 @@ void SvxNumberFormatTabPage::Init_Impl()
}
}
-/*************************************************************************
-#* Method: Create
-#*------------------------------------------------------------------------
-#*
-#* Class: SvxNumberFormatTabPage
-#* Function: Creates a new number format page.
-#* Input: Window, SfxItemSet
-#* Output: new TabPage
-#*
-#************************************************************************/
-
-SfxTabPage* SvxNumberFormatTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxNumberFormatTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
{
- return ( new SvxNumberFormatTabPage( pParent, *rAttrSet ) );
+ return VclPtr<SfxTabPage>( new SvxNumberFormatTabPage( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
}
@@ -1644,7 +1666,7 @@ bool SvxNumberFormatTabPage::PreNotify( NotifyEvent& rNEvt )
{
if(rNEvt.GetType()==MouseNotifyEvent::LOSEFOCUS)
{
- if ( rNEvt.GetWindow() == dynamic_cast< vcl::Window* >( m_pEdComment ) && !m_pEdComment->IsVisible() )
+ if ( rNEvt.GetWindow() == dynamic_cast< vcl::Window* >( m_pEdComment.get() ) && !m_pEdComment->IsVisible() )
{
pLastActivWindow = NULL;
}
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index a725a70180e5..34a19e76227d 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -219,14 +219,23 @@ SvxSingleNumPickTabPage::SvxSingleNumPickTabPage(vcl::Window* pParent,
SvxSingleNumPickTabPage::~SvxSingleNumPickTabPage()
{
+ disposeOnce();
+}
+
+void SvxSingleNumPickTabPage::dispose()
+{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
+ m_pExamplesVS.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxSingleNumPickTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxSingleNumPickTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxSingleNumPickTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxSingleNumPickTabPage>::Create(pParent, *rAttrSet);
}
bool SvxSingleNumPickTabPage::FillItemSet( SfxItemSet* rSet )
@@ -380,14 +389,23 @@ SvxBulletPickTabPage::SvxBulletPickTabPage(vcl::Window* pParent,
SvxBulletPickTabPage::~SvxBulletPickTabPage()
{
+ disposeOnce();
+}
+
+void SvxBulletPickTabPage::dispose()
+{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
+ m_pExamplesVS.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxBulletPickTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxBulletPickTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxBulletPickTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxBulletPickTabPage>::Create(pParent, *rAttrSet);
}
bool SvxBulletPickTabPage::FillItemSet( SfxItemSet* rSet )
@@ -577,14 +595,23 @@ SvxNumPickTabPage::SvxNumPickTabPage(vcl::Window* pParent,
SvxNumPickTabPage::~SvxNumPickTabPage()
{
+ disposeOnce();
+}
+
+void SvxNumPickTabPage::dispose()
+{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
+ m_pExamplesVS.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxNumPickTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxNumPickTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxNumPickTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxNumPickTabPage>::Create(pParent, *rAttrSet);
}
bool SvxNumPickTabPage::FillItemSet( SfxItemSet* rSet )
@@ -818,14 +845,24 @@ SvxBitmapPickTabPage::SvxBitmapPickTabPage(vcl::Window* pParent,
SvxBitmapPickTabPage::~SvxBitmapPickTabPage()
{
+ disposeOnce();
+}
+
+void SvxBitmapPickTabPage::dispose()
+{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
+ m_pErrorText.clear();
+ m_pExamplesVS.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxBitmapPickTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxBitmapPickTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxBitmapPickTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxBitmapPickTabPage>::Create(pParent, *rAttrSet);
}
void SvxBitmapPickTabPage::ActivatePage(const SfxItemSet& rSet)
@@ -1125,9 +1162,53 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(vcl::Window* pParent,
SvxNumOptionsTabPage::~SvxNumOptionsTabPage()
{
- delete m_pBitmapMB->GetPopupMenu()->GetPopupMenu(m_nGalleryId);
+ disposeOnce();
+}
+
+void SvxNumOptionsTabPage::dispose()
+{
+ if (m_pBitmapMB)
+ {
+ delete m_pBitmapMB->GetPopupMenu()->GetPopupMenu(m_nGalleryId);
+ }
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
+ m_pLevelLB.clear();
+ m_pFmtLB.clear();
+ m_pSeparatorFT.clear();
+ m_pPrefixFT.clear();
+ m_pPrefixED.clear();
+ m_pSuffixFT.clear();
+ m_pSuffixED.clear();
+ m_pCharFmtFT.clear();
+ m_pCharFmtLB.clear();
+ m_pBulColorFT.clear();
+ m_pBulColLB.clear();
+ m_pBulRelSizeFT.clear();
+ m_pBulRelSizeMF.clear();
+ m_pAllLevelFT.clear();
+ m_pAllLevelNF.clear();
+ m_pStartFT.clear();
+ m_pStartED.clear();
+ m_pBulletFT.clear();
+ m_pBulletPB.clear();
+ m_pAlignFT.clear();
+ m_pAlignLB.clear();
+ m_pBitmapFT.clear();
+ m_pBitmapMB.clear();
+ m_pWidthFT.clear();
+ m_pWidthMF.clear();
+ m_pHeightFT.clear();
+ m_pHeightMF.clear();
+ m_pRatioCB.clear();
+ m_pOrientFT.clear();
+ m_pOrientLB.clear();
+ m_pAllLevelsFrame.clear();
+ m_pSameLevelCB.clear();
+ m_pPreviewWIN.clear();
+ SfxTabPage::dispose();
}
void SvxNumOptionsTabPage::SetMetric(FieldUnit eMetric)
@@ -1141,10 +1222,10 @@ void SvxNumOptionsTabPage::SetMetric(FieldUnit eMetric)
m_pHeightMF->SetUnit( eMetric );
}
-SfxTabPage* SvxNumOptionsTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxNumOptionsTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxNumOptionsTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxNumOptionsTabPage>::Create(pParent, *rAttrSet);
};
void SvxNumOptionsTabPage::ActivatePage(const SfxItemSet& rSet)
@@ -2014,7 +2095,7 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, PopupActivateHdl_Impl)
IMPL_LINK_NOARG(SvxNumOptionsTabPage, BulletHdl_Impl)
{
- boost::scoped_ptr<SvxCharacterMap> pMap(new SvxCharacterMap( this, true ));
+ VclPtrInstance< SvxCharacterMap > pMap( this, true );
sal_uInt16 nMask = 1;
const vcl::Font* pFmtFont = 0;
@@ -2298,7 +2379,7 @@ void SvxNumberingPreview::Paint( const Rectangle& /*rRect*/ )
const Color aBackColor = rStyleSettings.GetFieldColor();
const Color aTextColor = rStyleSettings.GetFieldTextColor();
- boost::scoped_ptr<VirtualDevice> pVDev(new VirtualDevice(*this));
+ ScopedVclPtrInstance< VirtualDevice > pVDev(*this);
pVDev->EnableRTL( IsRTLEnabled() );
pVDev->SetMapMode(GetMapMode());
pVDev->SetOutputSize( aSize );
@@ -2683,9 +2764,40 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(vcl::Window* pParent,
SvxNumPositionTabPage::~SvxNumPositionTabPage()
{
+ disposeOnce();
+}
+
+void SvxNumPositionTabPage::dispose()
+{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
+ m_pLevelLB.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();
+ SfxTabPage::dispose();
}
+
/*-------------------------------------------------------*/
#if OSL_DEBUG_LEVEL > 1
@@ -3108,10 +3220,10 @@ void SvxNumPositionTabPage::ShowControlsDependingOnPosAndSpaceMode()
m_pIndentAtMF->Show( bLabelAlignmentPosAndSpaceModeActive );
}
-SfxTabPage* SvxNumPositionTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxNumPositionTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxNumPositionTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxNumPositionTabPage>::Create(pParent, *rAttrSet);
}
void SvxNumPositionTabPage::SetMetric(FieldUnit eMetric)
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index ef8dc6a41b2c..6a37a3d1f1ed 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -164,9 +164,9 @@ bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize )
// class SvxPageDescPage --------------------------------------------------
-SfxTabPage* SvxPageDescPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxPageDescPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxPageDescPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>(new SvxPageDescPage( pParent, *rSet ), SAL_NO_ACQUIRE );
}
SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr ) :
@@ -366,10 +366,46 @@ SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr
SvxPageDescPage::~SvxPageDescPage()
{
+ disposeOnce();
+}
+
+void SvxPageDescPage::dispose()
+{
if(mbDelPrinter)
{
- delete mpDefPrinter;
+ mpDefPrinter.disposeAndClear();
+ mbDelPrinter = false;
}
+ m_pPaperSizeBox.clear();
+ m_pPaperWidthEdit.clear();
+ m_pPaperHeightEdit.clear();
+ m_pOrientationFT.clear();
+ m_pPortraitBtn.clear();
+ m_pLandscapeBtn.clear();
+ m_pBspWin.clear();
+ m_pTextFlowLbl.clear();
+ m_pTextFlowBox.clear();
+ m_pPaperTrayBox.clear();
+ m_pLeftMarginLbl.clear();
+ m_pLeftMarginEdit.clear();
+ m_pRightMarginLbl.clear();
+ m_pRightMarginEdit.clear();
+ m_pTopMarginEdit.clear();
+ m_pBottomMarginEdit.clear();
+ m_pPageText.clear();
+ m_pLayoutBox.clear();
+ m_pNumberFormatBox.clear();
+ m_pTblAlignFT.clear();
+ m_pHorzBox.clear();
+ m_pVertBox.clear();
+ m_pAdaptBox.clear();
+ m_pRegisterCB.clear();
+ m_pRegisterFT.clear();
+ m_pRegisterLB.clear();
+ m_pInsideLbl.clear();
+ m_pOutsideLbl.clear();
+ m_pPrintRangeQueryText.clear();
+ SfxTabPage::dispose();
}
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 527f4f760079..56b1345db3ad 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -194,9 +194,9 @@ IMPL_LINK_NOARG(SvxStdParagraphTabPage, ELRLoseFocusHdl)
return 0;
}
-SfxTabPage* SvxStdParagraphTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SvxStdParagraphTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new SvxStdParagraphTabPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxStdParagraphTabPage( pParent, *rSet ), SAL_NO_ACQUIRE );
}
bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
@@ -656,6 +656,29 @@ SvxStdParagraphTabPage::SvxStdParagraphTabPage( vcl::Window* pParent, const Sfx
SvxStdParagraphTabPage::~SvxStdParagraphTabPage()
{
+ disposeOnce();
+}
+
+void SvxStdParagraphTabPage::dispose()
+{
+ m_pLeftIndent.clear();
+ m_pRightLabel.clear();
+ m_pRightIndent.clear();
+ m_pFLineLabel.clear();
+ m_pFLineIndent.clear();
+ m_pAutoCB.clear();
+ m_pTopDist.clear();
+ m_pBottomDist.clear();
+ m_pContextualCB.clear();
+ m_pLineDist.clear();
+ m_pLineDistAtLabel.clear();
+ m_pLineDistAtPercentBox.clear();
+ m_pLineDistAtMetricBox.clear();
+ m_pAbsDist.clear();
+ m_pExampleWin.clear();
+ m_pRegisterFL.clear();
+ m_pRegisterCB.clear();
+ SfxTabPage::dispose();
}
void SvxStdParagraphTabPage::EnableNegativeMode()
@@ -1018,6 +1041,27 @@ SvxParaAlignTabPage::SvxParaAlignTabPage( vcl::Window* pParent, const SfxItemSet
SvxParaAlignTabPage::~SvxParaAlignTabPage()
{
+ disposeOnce();
+}
+
+void SvxParaAlignTabPage::dispose()
+{
+ m_pLeft.clear();
+ m_pRight.clear();
+ m_pCenter.clear();
+ m_pJustify.clear();
+ m_pLeftBottom.clear();
+ m_pRightTop.clear();
+ m_pLastLineFT.clear();
+ m_pLastLineLB.clear();
+ m_pExpandCB.clear();
+ m_pSnapToGridCB.clear();
+ m_pExampleWin.clear();
+ m_pVertAlignFL.clear();
+ m_pVertAlignLB.clear();
+ m_pPropertiesFL.clear();
+ m_pTextDirectionLB.clear();
+ SfxTabPage::dispose();
}
SfxTabPage::sfxpg SvxParaAlignTabPage::DeactivatePage( SfxItemSet* _pSet )
@@ -1027,9 +1071,9 @@ SfxTabPage::sfxpg SvxParaAlignTabPage::DeactivatePage( SfxItemSet* _pSet )
return LEAVE_PAGE;
}
-SfxTabPage* SvxParaAlignTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxParaAlignTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxParaAlignTabPage(pParent, *rSet);
+ return VclPtr<SfxTabPage>( new SvxParaAlignTabPage(pParent, *rSet), SAL_NO_ACQUIRE );
}
bool SvxParaAlignTabPage::FillItemSet( SfxItemSet* rOutSet )
@@ -1300,10 +1344,10 @@ void SvxParaAlignTabPage::PageCreated (const SfxAllItemSet& aSet)
EnableJustifyExt();
}
-SfxTabPage* SvxExtParagraphTabPage::Create( vcl::Window* pParent,
+VclPtr<SfxTabPage> SvxExtParagraphTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rSet )
{
- return new SvxExtParagraphTabPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxExtParagraphTabPage( pParent, *rSet ), SAL_NO_ACQUIRE );
}
bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
@@ -1901,6 +1945,36 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage( vcl::Window* pParent, const SfxI
SvxExtParagraphTabPage::~SvxExtParagraphTabPage()
{
+ disposeOnce();
+}
+
+void SvxExtParagraphTabPage::dispose()
+{
+ m_pHyphenBox.clear();
+ m_pBeforeText.clear();
+ m_pExtHyphenBeforeBox.clear();
+ m_pAfterText.clear();
+ m_pExtHyphenAfterBox.clear();
+ m_pMaxHyphenLabel.clear();
+ m_pMaxHyphenEdit.clear();
+ m_pPageBreakBox.clear();
+ m_pBreakTypeFT.clear();
+ m_pBreakTypeLB.clear();
+ m_pBreakPositionFT.clear();
+ m_pBreakPositionLB.clear();
+ m_pApplyCollBtn.clear();
+ m_pApplyCollBox.clear();
+ m_pPagenumText.clear();
+ m_pPagenumEdit.clear();
+ m_pKeepTogetherBox.clear();
+ m_pKeepParaBox.clear();
+ m_pOrphanBox.clear();
+ m_pOrphanRowNo.clear();
+ m_pOrphanRowLabel.clear();
+ m_pWidowBox.clear();
+ m_pWidowRowNo.clear();
+ m_pWidowRowLabel.clear();
+ SfxTabPage::dispose();
}
IMPL_LINK_NOARG(SvxExtParagraphTabPage, PageBreakHdl_Impl)
@@ -2107,11 +2181,20 @@ SvxAsianTabPage::SvxAsianTabPage( vcl::Window* pParent, const SfxItemSet& rSet )
SvxAsianTabPage::~SvxAsianTabPage()
{
+ disposeOnce();
+}
+
+void SvxAsianTabPage::dispose()
+{
+ m_pForbiddenRulesCB.clear();
+ m_pHangingPunctCB.clear();
+ m_pScriptSpaceCB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxAsianTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxAsianTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxAsianTabPage(pParent, *rSet);
+ return VclPtr<SfxTabPage>(new SvxAsianTabPage(pParent, *rSet), SAL_NO_ACQUIRE );
}
const sal_uInt16* SvxAsianTabPage::GetRanges()
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index dcf3b945de4a..64c9085f0a35 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -588,6 +588,43 @@ SvxSwPosSizeTabPage::SvxSwPosSizeTabPage(vcl::Window* pParent, const SfxItemSet&
m_pPositionCB->SetClickHdl(LINK(this, SvxSwPosSizeTabPage, ProtectHdl));
}
+SvxSwPosSizeTabPage::~SvxSwPosSizeTabPage()
+{
+ disposeOnce();
+}
+
+void SvxSwPosSizeTabPage::dispose()
+{
+ m_pWidthMF.clear();
+ m_pHeightMF.clear();
+ m_pKeepRatioCB.clear();
+ m_pToPageRB.clear();
+ m_pToParaRB.clear();
+ m_pToCharRB.clear();
+ m_pAsCharRB.clear();
+ m_pToFrameRB.clear();
+ m_pPositionCB.clear();
+ m_pSizeCB.clear();
+ m_pPosFrame.clear();
+ m_pHoriFT.clear();
+ m_pHoriLB.clear();
+ m_pHoriByFT.clear();
+ m_pHoriByMF.clear();
+ m_pHoriToFT.clear();
+ m_pHoriToLB.clear();
+ m_pHoriMirrorCB.clear();
+ m_pVertFT.clear();
+ m_pVertLB.clear();
+ m_pVertByFT.clear();
+ m_pVertByMF.clear();
+ m_pVertToFT.clear();
+ m_pVertToLB.clear();
+ m_pFollowCB.clear();
+ m_pExampleWN.clear();
+ SfxTabPage::dispose();
+}
+
+
namespace
{
struct FrmMaps
@@ -689,13 +726,9 @@ void SvxSwPosSizeTabPage::setOptimalRelWidth()
m_pHoriLB->Clear();
}
-SvxSwPosSizeTabPage::~SvxSwPosSizeTabPage()
-{
-}
-
-SfxTabPage* SvxSwPosSizeTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SvxSwPosSizeTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new SvxSwPosSizeTabPage(pParent, *rSet);
+ return VclPtr<SvxSwPosSizeTabPage>::Create(pParent, *rSet);
}
const sal_uInt16* SvxSwPosSizeTabPage::GetRanges()
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index d856f6b91fc0..56e54c8bc07c 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -96,10 +96,6 @@ SvxAreaTabDialog::SvxAreaTabDialog
rBtnCancel.SetClickHdl( LINK( this, SvxAreaTabDialog, CancelHdlImpl ) );
}
-SvxAreaTabDialog::~SvxAreaTabDialog()
-{
-}
-
void SvxAreaTabDialog::SavePalettes()
{
SfxObjectShell* pShell = SfxObjectShell::Current();
diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx
index be818ba57f02..f9ee914225b9 100644
--- a/cui/source/tabpages/tabline.cxx
+++ b/cui/source/tabpages/tabline.cxx
@@ -104,12 +104,6 @@ SvxLineTabDialog::SvxLineTabDialog
-SvxLineTabDialog::~SvxLineTabDialog()
-{
-}
-
-
-
void SvxLineTabDialog::SavePalettes()
{
SfxObjectShell* pShell = SfxObjectShell::Current();
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index 4d589e7fe55f..2d8b7c0c7326 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -38,7 +38,7 @@
class TabWin_Impl : public vcl::Window
{
- SvxTabulatorTabPage* mpPage;
+ VclPtr<SvxTabulatorTabPage> mpPage;
private:
sal_uInt16 nTabStyle;
@@ -50,8 +50,10 @@ public:
, nTabStyle(0)
{
}
+ virtual ~TabWin_Impl() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE { mpPage.clear(); vcl::Window::dispose(); }
- virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
+ virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
void SetTabulatorTabPage(SvxTabulatorTabPage* pPage) { mpPage = pPage; }
void SetTabStyle(sal_uInt16 nStyle) {nTabStyle = nStyle; }
@@ -185,13 +187,37 @@ SvxTabulatorTabPage::SvxTabulatorTabPage( vcl::Window* pParent, const SfxItemSet
aAktTab.GetDecimal() = rLocaleWrapper.getNumDecimalSep()[0];
}
-
-
SvxTabulatorTabPage::~SvxTabulatorTabPage()
{
+ disposeOnce();
}
-
+void SvxTabulatorTabPage::dispose()
+{
+ m_pTabBox.clear();
+ m_pLeftTab.clear();
+ m_pRightTab.clear();
+ m_pCenterTab.clear();
+ m_pDezTab.clear();
+ m_pLeftWin.clear();
+ m_pRightWin.clear();
+ m_pCenterWin.clear();
+ m_pDezWin.clear();
+ m_pDezCharLabel.clear();
+ m_pDezChar.clear();
+ m_pNoFillChar.clear();
+ m_pFillPoints.clear();
+ m_pFillDashLine.clear();
+ m_pFillSolidLine.clear();
+ m_pFillSpecial.clear();
+ m_pFillChar.clear();
+ m_pNewBtn.clear();
+ m_pDelAllBtn.clear();
+ m_pDelBtn.clear();
+ m_pTypeFrame.clear();
+ m_pFillFrame.clear();
+ SfxTabPage::dispose();
+}
bool SvxTabulatorTabPage::FillItemSet( SfxItemSet* rSet )
{
@@ -252,10 +278,11 @@ bool SvxTabulatorTabPage::FillItemSet( SfxItemSet* rSet )
-SfxTabPage* SvxTabulatorTabPage::Create( vcl::Window* pParent,
+VclPtr<SfxTabPage> SvxTabulatorTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rSet)
{
- return ( new SvxTabulatorTabPage( pParent, *rSet ) );
+ return VclPtr<SfxTabPage>( new SvxTabulatorTabPage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx
index 72626e953100..b2f2980de258 100644
--- a/cui/source/tabpages/textanim.cxx
+++ b/cui/source/tabpages/textanim.cxx
@@ -122,14 +122,30 @@ SvxTextAnimationPage::SvxTextAnimationPage( vcl::Window* pWindow, const SfxItemS
m_pBtnDown->SetClickHdl( aLink );
}
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
SvxTextAnimationPage::~SvxTextAnimationPage()
{
+ disposeOnce();
+}
+
+void SvxTextAnimationPage::dispose()
+{
+ m_pLbEffect.clear();
+ m_pBoxDirection.clear();
+ m_pBtnUp.clear();
+ m_pBtnLeft.clear();
+ m_pBtnRight.clear();
+ m_pBtnDown.clear();
+ m_pFlProperties.clear();
+ m_pTsbStartInside.clear();
+ m_pTsbStopInside.clear();
+ m_pBoxCount.clear();
+ m_pTsbEndless.clear();
+ m_pNumFldCount.clear();
+ m_pTsbPixel.clear();
+ m_pMtrFldAmount.clear();
+ m_pTsbAuto.clear();
+ m_pMtrFldDelay.clear();
+ SfxTabPage::dispose();
}
/*************************************************************************
@@ -445,10 +461,10 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs)
|*
\************************************************************************/
-SfxTabPage* SvxTextAnimationPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxTextAnimationPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxTextAnimationPage( pWindow, *rAttrs );
+ return VclPtr<SvxTextAnimationPage>::Create( pWindow, *rAttrs );
}
IMPL_LINK_NOARG(SvxTextAnimationPage, SelectEffectHdl_Impl)
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index 655638577e35..d04a830b9dbd 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -96,13 +96,28 @@ SvxTextAttrPage::SvxTextAttrPage(vcl::Window* pWindow, const SfxItemSet& rInAttr
m_pTsbFullWidth->SetClickHdl(LINK( this, SvxTextAttrPage, ClickFullWidthHdl_Impl ) );
}
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
SvxTextAttrPage::~SvxTextAttrPage()
{
+ disposeOnce();
+}
+
+void SvxTextAttrPage::dispose()
+{
+ m_pTsbAutoGrowWidth.clear();
+ m_pTsbAutoGrowHeight.clear();
+ m_pTsbFitToSize.clear();
+ m_pTsbContour.clear();
+ m_pTsbWordWrapText.clear();
+ m_pTsbAutoGrowSize.clear();
+ m_pFlDistance.clear();
+ m_pMtrFldLeft.clear();
+ m_pMtrFldRight.clear();
+ m_pMtrFldTop.clear();
+ m_pMtrFldBottom.clear();
+ m_pFlPosition.clear();
+ m_pCtlPosition.clear();
+ m_pTsbFullWidth.clear();
+ SvxTabPage::dispose();
}
/*************************************************************************
@@ -514,16 +529,10 @@ void SvxTextAttrPage::Construct()
m_pTsbWordWrapText->Enable( bWordWrapTextEnabled );
}
-/*************************************************************************
-|*
-|* creates the page
-|*
-\************************************************************************/
-
-SfxTabPage* SvxTextAttrPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxTextAttrPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxTextAttrPage( pWindow, *rAttrs );
+ return VclPtr<SvxTextAttrPage>::Create( pWindow, *rAttrs );
}
/** Check whether we have to uncheck the "Full width" check box.
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 944aff6abe8e..7cd0685cb031 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -118,6 +118,33 @@ IMPL_LINK_NOARG(SvxTransparenceTabPage, ClickTransGradientHdl_Impl)
return 0L;
}
+SvxTransparenceTabPage::~SvxTransparenceTabPage()
+{
+ disposeOnce();
+}
+
+void SvxTransparenceTabPage::dispose()
+{
+ m_pRbtTransOff.clear();
+ m_pRbtTransLinear.clear();
+ m_pRbtTransGradient.clear();
+ m_pMtrTransparent.clear();
+ m_pGridGradient.clear();
+ m_pLbTrgrGradientType.clear();
+ m_pFtTrgrCenterX.clear();
+ m_pMtrTrgrCenterX.clear();
+ m_pFtTrgrCenterY.clear();
+ m_pMtrTrgrCenterY.clear();
+ m_pFtTrgrAngle.clear();
+ m_pMtrTrgrAngle.clear();
+ m_pMtrTrgrBorder.clear();
+ m_pMtrTrgrStartValue.clear();
+ m_pMtrTrgrEndValue.clear();
+ m_pCtlBitmapPreview.clear();
+ m_pCtlXRectPreview.clear();
+ SvxTabPage::dispose();
+}
+
void SvxTransparenceTabPage::ActivateLinear(bool bActivate)
{
m_pMtrTransparent->Enable(bActivate);
@@ -287,9 +314,9 @@ SvxTransparenceTabPage::SvxTransparenceTabPage(vcl::Window* pParent, const SfxIt
SetExchangeSupport();
}
-SfxTabPage* SvxTransparenceTabPage::Create(vcl::Window* pWindow, const SfxItemSet* rAttrs)
+VclPtr<SfxTabPage> SvxTransparenceTabPage::Create(vcl::Window* pWindow, const SfxItemSet* rAttrs)
{
- return new SvxTransparenceTabPage(pWindow, *rAttrs);
+ return VclPtr<SvxTransparenceTabPage>::Create(pWindow, *rAttrs);
}
bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs)
@@ -768,6 +795,51 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
m_pCtlXRectPreview->set_height_request(aSize2.Height());
}
+SvxAreaTabPage::~SvxAreaTabPage()
+{
+ disposeOnce();
+}
+
+void SvxAreaTabPage::dispose()
+{
+ m_pTypeLB.clear();
+ m_pFillLB.clear();
+ m_pLbColor.clear();
+ m_pLbGradient.clear();
+ m_pLbHatching.clear();
+ m_pLbBitmap.clear();
+ m_pCtlBitmapPreview.clear();
+ m_pTsbStepCount.clear();
+ m_pFlStepCount.clear();
+ m_pNumFldStepCount.clear();
+ m_pFlHatchBckgrd.clear();
+ m_pCbxHatchBckgrd.clear();
+ m_pLbHatchBckgrdColor.clear();
+ m_pBxBitmap.clear();
+ m_pFlSize.clear();
+ m_pTsbOriginal.clear();
+ m_pTsbScale.clear();
+ m_pGridX_Y.clear();
+ m_pFtXSize.clear();
+ m_pMtrFldXSize.clear();
+ m_pFtYSize.clear();
+ m_pMtrFldYSize.clear();
+ m_pFlPosition.clear();
+ m_pCtlPosition.clear();
+ m_pGridOffset.clear();
+ m_pMtrFldXOffset.clear();
+ m_pMtrFldYOffset.clear();
+ m_pBxTile.clear();
+ m_pTsbTile.clear();
+ m_pTsbStretch.clear();
+ m_pFlOffset.clear();
+ m_pRbtRow.clear();
+ m_pRbtColumn.clear();
+ m_pMtrFldOffset.clear();
+ m_pCtlXRectPreview.clear();
+ m_pBtnImport.clear();
+ SvxTabPage::dispose();
+}
void SvxAreaTabPage::Construct()
@@ -1758,10 +1830,10 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
-SfxTabPage* SvxAreaTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxAreaTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxAreaTabPage( pWindow, *rAttrs );
+ return VclPtr<SvxAreaTabPage>::Create( pWindow, *rAttrs );
}
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 3ce5ff5b1696..e75afb7d1a29 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -122,10 +122,28 @@ SvxBitmapTabPage::SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rIn
SvxBitmapTabPage::~SvxBitmapTabPage()
{
- delete m_pBitmapCtl;
+ disposeOnce();
}
-
+void SvxBitmapTabPage::dispose()
+{
+ delete m_pBitmapCtl;
+ m_pBitmapCtl = NULL;
+ m_pBxPixelEditor.clear();
+ m_pCtlPixel.clear();
+ m_pLbColor.clear();
+ m_pLbBackgroundColor.clear();
+ m_pLbBitmapsHidden.clear();
+ m_pLbBitmaps.clear();
+ m_pCtlPreview.clear();
+ m_pBtnAdd.clear();
+ m_pBtnModify.clear();
+ m_pBtnImport.clear();
+ m_pBtnDelete.clear();
+ m_pBtnLoad.clear();
+ m_pBtnSave.clear();
+ SvxTabPage::dispose();
+}
void SvxBitmapTabPage::Construct()
{
@@ -292,10 +310,10 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* )
-SfxTabPage* SvxBitmapTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxBitmapTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rSet )
{
- return new SvxBitmapTabPage( pWindow, *rSet );
+ return VclPtr<SvxBitmapTabPage>::Create( pWindow, *rSet );
}
@@ -428,10 +446,10 @@ long SvxBitmapTabPage::CheckChanges_Impl()
{
ResMgr& rMgr = CUI_MGR();
Image aWarningBoxImage = WarningBox::GetStandardImage();
- boost::scoped_ptr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(),
- SVX_RES( RID_SVXSTR_BITMAP ),
- CUI_RES( RID_SVXSTR_ASK_CHANGE_BITMAP ),
- &aWarningBoxImage ));
+ ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(),
+ SVX_RES( RID_SVXSTR_BITMAP ),
+ CUI_RES( RID_SVXSTR_ASK_CHANGE_BITMAP ),
+ &aWarningBoxImage );
DBG_ASSERT(aMessDlg, "Dialog creation failed!");
aMessDlg->SetButtonText( MESS_BTN_1, ResId( RID_SVXSTR_CHANGE, rMgr ) );
aMessDlg->SetButtonText( MESS_BTN_2, ResId( RID_SVXSTR_ADD, rMgr ) );
@@ -492,7 +510,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickAddHdl_Impl)
DBG_ASSERT(pFact, "Dialog creation failed!");
boost::scoped_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
DBG_ASSERT(pDlg, "Dialog creation failed!");
- boost::scoped_ptr<MessageDialog> pWarnBox;
+ ScopedVclPtr<MessageDialog> pWarnBox;
sal_uInt16 nError(1);
while( pDlg->Execute() == RET_OK )
@@ -512,7 +530,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickAddHdl_Impl)
if( !pWarnBox )
{
- pWarnBox.reset(new MessageDialog( GetParentDialog()
+ pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -592,7 +610,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl_Impl)
if( !nError )
{
OUString aDesc( ResId(RID_SVXSTR_DESC_EXT_BITMAP, rMgr) );
- boost::scoped_ptr<MessageDialog> pWarnBox;
+ ScopedVclPtr<MessageDialog> pWarnBox;
// convert file URL to UI name
OUString aName;
@@ -621,7 +639,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl_Impl)
if( !pWarnBox )
{
- pWarnBox.reset(new MessageDialog( GetParentDialog()
+ pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -710,10 +728,11 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickModifyHdl_Impl)
}
else
{
- MessageDialog aBox( GetParentDialog()
+ ScopedVclPtrInstance<MessageDialog> aBox(
+ GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui");
- aBox.Execute();
+ aBox->Execute();
}
}
}
@@ -728,9 +747,9 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- MessageDialog aQueryBox( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui");
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui" );
- if( aQueryBox.Execute() == RET_YES )
+ if( aQueryBox->Execute() == RET_YES )
{
delete pBitmapList->Remove( nPos );
m_pLbBitmaps->RemoveEntry( nPos );
@@ -969,7 +988,7 @@ void SvxBitmapTabPage::PointChanged( vcl::Window* pWindow, RECT_POINT )
vcl::Window* SvxBitmapTabPage::GetParentLabeledBy( const vcl::Window* pLabeled ) const
{
if (pLabeled == m_pLbBitmaps)
- return m_pLbBitmapsHidden;
+ return m_pLbBitmapsHidden.get();
else
return SvxTabPage::GetParentLabeledBy (pLabeled);
}
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 165736eb60ca..b96b0d64e51c 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -51,8 +51,8 @@ using namespace com::sun::star;
XPropertyListRef SvxColorTabPage::GetList()
{
- SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( mpTopDlg );
- SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( mpTopDlg );
+ SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( mpTopDlg.get() );
+ SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( mpTopDlg.get() );
XColorListRef pList;
if( pArea )
@@ -162,8 +162,8 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickLoadHdl_Impl)
if( pList->Load() )
{
// check whether the table may be deleted:
- SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( mpTopDlg );
- SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( mpTopDlg );
+ SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( mpTopDlg.get() );
+ SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( mpTopDlg.get() );
// FIXME: want to have a generic set and get method by type ...
if( pArea )
@@ -397,10 +397,39 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
SvxColorTabPage::~SvxColorTabPage()
{
- delete pShadow;
+ disposeOnce();
}
-
+void SvxColorTabPage::dispose()
+{
+ delete pShadow;
+ pShadow = NULL;
+ mpTopDlg.clear();
+ m_pBoxEmbed.clear();
+ m_pBtnLoad.clear();
+ m_pBtnSave.clear();
+ m_pTableName.clear();
+ m_pEdtName.clear();
+ m_pLbColor.clear();
+ m_pValSetColorList.clear();
+ m_pCtlPreviewOld.clear();
+ m_pCtlPreviewNew.clear();
+ m_pLbColorModel.clear();
+ m_pRGB.clear();
+ m_pR.clear();
+ m_pG.clear();
+ m_pB.clear();
+ m_pCMYK.clear();
+ m_pC.clear();
+ m_pY.clear();
+ m_pM.clear();
+ m_pK.clear();
+ m_pBtnAdd.clear();
+ m_pBtnModify.clear();
+ m_pBtnWorkOn.clear();
+ m_pBtnDelete.clear();
+ SfxTabPage::dispose();
+}
void SvxColorTabPage::ImpColorCountChanged()
{
@@ -510,10 +539,10 @@ long SvxColorTabPage::CheckChanges_Impl()
{
ResMgr& rMgr = CUI_MGR();
Image aWarningBoxImage = WarningBox::GetStandardImage();
- boost::scoped_ptr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(),
- SVX_RESSTR( RID_SVXSTR_COLOR ),
- ResId( RID_SVXSTR_ASK_CHANGE_COLOR, rMgr ),
- &aWarningBoxImage ));
+ ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(),
+ SVX_RESSTR( RID_SVXSTR_COLOR ),
+ ResId( RID_SVXSTR_ASK_CHANGE_COLOR, rMgr ),
+ &aWarningBoxImage );
aMessDlg->SetButtonText( MESS_BTN_1,
ResId( RID_SVXSTR_CHANGE, rMgr ) );
aMessDlg->SetButtonText( MESS_BTN_2,
@@ -618,10 +647,10 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet )
-SfxTabPage* SvxColorTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxColorTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rOutAttrs )
{
- return new SvxColorTabPage( pWindow, *rOutAttrs );
+ return VclPtr<SvxColorTabPage>::Create( pWindow, *rOutAttrs );
}
// is called when the content of the MtrFields is changed for color values
@@ -676,10 +705,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl)
// if yes, it is repeated and a new name is demanded
if ( !bDifferent )
{
- MessageDialog aWarningBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aWarningBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aWarningBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui");
+ aWarningBox->Execute();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
boost::scoped_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
@@ -699,7 +728,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl)
if( bDifferent )
bLoop = false;
else
- aWarningBox.Execute();
+ aWarningBox->Execute();
}
}
@@ -747,10 +776,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl)
// if yes, it is repeated and a new name is demanded
if ( !bDifferent )
{
- MessageDialog aWarningBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aWarningBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aWarningBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui");
+ aWarningBox->Execute();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
boost::scoped_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
@@ -768,7 +797,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl)
if( bDifferent )
bLoop = false;
else
- aWarningBox.Execute();
+ aWarningBox->Execute();
}
}
@@ -843,9 +872,9 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- MessageDialog aQueryBox( GetParentDialog(),"AskDelColorDialog","cui/ui/querydeletecolordialog.ui");
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelColorDialog","cui/ui/querydeletecolordialog.ui");
- if( aQueryBox.Execute() == RET_YES )
+ if( aQueryBox->Execute() == RET_YES )
{
XColorEntry* pEntry = pColorList->Remove( nPos );
DBG_ASSERT( pEntry, "ColorEntry not found !" );
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index b2c334883f91..55c81296f638 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -139,6 +139,34 @@ SvxGradientTabPage::SvxGradientTabPage
setPreviewsToSamePlace(pParent, this);
}
+SvxGradientTabPage::~SvxGradientTabPage()
+{
+ disposeOnce();
+}
+
+void SvxGradientTabPage::dispose()
+{
+ m_pLbGradientType.clear();
+ m_pFtCenterX.clear();
+ m_pMtrCenterX.clear();
+ m_pFtCenterY.clear();
+ m_pMtrCenterY.clear();
+ m_pFtAngle.clear();
+ m_pMtrAngle.clear();
+ m_pMtrBorder.clear();
+ m_pLbColorFrom.clear();
+ m_pMtrColorFrom.clear();
+ m_pLbColorTo.clear();
+ m_pMtrColorTo.clear();
+ m_pLbGradients.clear();
+ m_pCtlPreview.clear();
+ m_pBtnAdd.clear();
+ m_pBtnModify.clear();
+ m_pBtnDelete.clear();
+ m_pBtnLoad.clear();
+ m_pBtnSave.clear();
+ SfxTabPage::dispose();
+}
void SvxGradientTabPage::Construct()
@@ -263,10 +291,10 @@ long SvxGradientTabPage::CheckChanges_Impl()
{
ResMgr& rMgr = CUI_MGR();
Image aWarningBoxImage = WarningBox::GetStandardImage();
- boost::scoped_ptr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(),
- SVX_RESSTR( RID_SVXSTR_GRADIENT ),
- CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_GRADIENT ),
- &aWarningBoxImage ));
+ ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(),
+ SVX_RESSTR( RID_SVXSTR_GRADIENT ),
+ CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_GRADIENT ),
+ &aWarningBoxImage );
DBG_ASSERT(aMessDlg, "Dialog creation failed!");
aMessDlg->SetButtonText( MESS_BTN_1,
OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
@@ -366,10 +394,10 @@ void SvxGradientTabPage::Reset( const SfxItemSet* )
-SfxTabPage* SvxGradientTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxGradientTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rOutAttrs )
{
- return new SvxGradientTabPage( pWindow, *rOutAttrs );
+ return VclPtr<SvxGradientTabPage>::Create( pWindow, *rOutAttrs );
}
@@ -429,7 +457,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
DBG_ASSERT(pFact, "Dialog creation failed!");
boost::scoped_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
DBG_ASSERT(pDlg, "Dialog creation failed!");
- boost::scoped_ptr<MessageDialog> pWarnBox;
+ ScopedVclPtr<MessageDialog> pWarnBox;
sal_uInt16 nError = 1;
while( pDlg->Execute() == RET_OK )
@@ -450,7 +478,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
if( !pWarnBox )
{
- pWarnBox.reset(new MessageDialog( GetParentDialog()
+ pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -561,10 +589,10 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl)
}
else
{
- MessageDialog aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui" );
+ aBox->Execute();
}
}
@@ -580,9 +608,9 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- MessageDialog aQueryBox( GetParentDialog(),"AskDelGradientDialog","cui/ui/querydeletegradientdialog.ui");
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelGradientDialog","cui/ui/querydeletegradientdialog.ui");
- if ( aQueryBox.Execute() == RET_YES )
+ if ( aQueryBox->Execute() == RET_YES )
{
delete pGradientList->Remove( nPos );
m_pLbGradients->RemoveEntry( nPos );
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 418a7ce500db..3e839505e0cc 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -137,6 +137,27 @@ SvxHatchTabPage::SvxHatchTabPage
setPreviewsToSamePlace(pParent, this);
}
+SvxHatchTabPage::~SvxHatchTabPage()
+{
+ disposeOnce();
+}
+
+void SvxHatchTabPage::dispose()
+{
+ m_pMtrDistance.clear();
+ m_pMtrAngle.clear();
+ m_pCtlAngle.clear();
+ m_pLbLineType.clear();
+ m_pLbLineColor.clear();
+ m_pLbHatchings.clear();
+ m_pCtlPreview.clear();
+ m_pBtnAdd.clear();
+ m_pBtnModify.clear();
+ m_pBtnDelete.clear();
+ m_pBtnLoad.clear();
+ m_pBtnSave.clear();
+ SvxTabPage::dispose();
+}
void SvxHatchTabPage::Construct()
@@ -240,10 +261,10 @@ long SvxHatchTabPage::CheckChanges_Impl()
{
ResMgr& rMgr = CUI_MGR();
Image aWarningBoxImage = WarningBox::GetStandardImage();
- boost::scoped_ptr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(),
- SVX_RESSTR( RID_SVXSTR_HATCH ),
- CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_HATCH ),
- &aWarningBoxImage ));
+ ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(),
+ SVX_RESSTR( RID_SVXSTR_HATCH ),
+ CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_HATCH ),
+ &aWarningBoxImage );
DBG_ASSERT(aMessDlg, "Dialog creation failed!");
aMessDlg->SetButtonText( MESS_BTN_1,
OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
@@ -339,10 +360,10 @@ void SvxHatchTabPage::Reset( const SfxItemSet* rSet )
-SfxTabPage* SvxHatchTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxHatchTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rSet )
{
- return new SvxHatchTabPage( pWindow, *rSet );
+ return VclPtr<SvxHatchTabPage>::Create( pWindow, *rSet );
}
@@ -479,7 +500,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl)
DBG_ASSERT(pFact, "Dialog creation failed!");
boost::scoped_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
DBG_ASSERT(pDlg, "Dialog creation failed!");
- boost::scoped_ptr<MessageDialog> pWarnBox;
+ ScopedVclPtr<MessageDialog> pWarnBox;
sal_uInt16 nError = 1;
while( pDlg->Execute() == RET_OK )
@@ -499,7 +520,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl)
if( !pWarnBox )
{
- pWarnBox.reset(new MessageDialog( GetParentDialog()
+ pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -606,10 +627,10 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl)
}
else
{
- MessageDialog aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui" );
+ aBox->Execute();
}
}
}
@@ -624,9 +645,9 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- MessageDialog aQueryBox( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui");
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui");
- if( aQueryBox.Execute() == RET_YES )
+ if( aQueryBox->Execute() == RET_YES )
{
delete pHatchingList->Remove( nPos );
m_pLbHatchings->RemoveEntry( nPos );
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 119d59948a5f..300db7422607 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -230,12 +230,20 @@ void SvxLineTabPage::ShowSymbolControls(bool bOn)
SvxLineTabPage::~SvxLineTabPage()
{
- // Symbols on a line (e.g. StarCharts), dtor new!
+ disposeOnce();
+}
- delete m_pSymbolMB->GetPopupMenu()->GetPopupMenu( MN_GALLERY );
+void SvxLineTabPage::dispose()
+{
+ // Symbols on a line (e.g. StarCharts), dtor new!
+ if (m_pSymbolMB)
+ {
+ delete m_pSymbolMB->GetPopupMenu()->GetPopupMenu( MN_GALLERY );
- if(pSymbolList)
- delete m_pSymbolMB->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS );
+ if(pSymbolList)
+ delete m_pSymbolMB->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS );
+ m_pSymbolMB = NULL;
+ }
for ( size_t i = 0, n = aGrfBrushItems.size(); i < n; ++i )
{
@@ -243,7 +251,40 @@ SvxLineTabPage::~SvxLineTabPage()
delete pInfo->pBrushItem;
delete pInfo;
}
+ aGrfBrushItems.clear();
+
+ m_pBoxColor.clear();
+ m_pLbLineStyle.clear();
+ m_pLbColor.clear();
+ m_pBoxWidth.clear();
+ m_pMtrLineWidth.clear();
+ m_pBoxTransparency.clear();
+ m_pMtrTransparent.clear();
+ m_pFlLineEnds.clear();
+ m_pBoxArrowStyles.clear();
+ m_pLbStartStyle.clear();
+ m_pBoxStart.clear();
+ m_pMtrStartWidth.clear();
+ m_pTsbCenterStart.clear();
+ m_pBoxEnd.clear();
+ m_pLbEndStyle.clear();
+ m_pMtrEndWidth.clear();
+ m_pTsbCenterEnd.clear();
+ m_pCbxSynchronize.clear();
+ m_pCtlPreview.clear();
+ m_pFLEdgeStyle.clear();
+ m_pGridEdgeCaps.clear();
+ m_pLBEdgeStyle.clear();
+ m_pLBCapStyle.clear();
+ m_pFlSymbol.clear();
+ m_pGridIconSize.clear();
+ m_pSymbolMB.clear();
+ m_pSymbolWidthMF.clear();
+ m_pSymbolHeightMF.clear();
+ m_pSymbolRatioCB.clear();
+ SvxTabPage::dispose();
}
+
void SvxLineTabPage::Construct()
{
// Color chart
@@ -319,8 +360,8 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton)
if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && pSymbolList)
{
- VirtualDevice aVDev;
- aVDev.SetMapMode(MapMode(MAP_100TH_MM));
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
+ pVDev->SetMapMode(MapMode(MAP_100TH_MM));
boost::scoped_ptr<SdrModel> pModel(new SdrModel);
pModel->GetItemPool().FreezeIdRanges();
// Page
@@ -329,7 +370,7 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton)
pModel->InsertPage( pPage, 0 );
{
// 3D View
- boost::scoped_ptr<SdrView> pView(new SdrView( pModel.get(), &aVDev ));
+ boost::scoped_ptr<SdrView> pView(new SdrView( pModel.get(), pVDev ));
pView->hideMarkHandles();
pView->ShowSdrPage(pPage);
@@ -1114,8 +1155,8 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
}
else if(nSymType >= 0)
{
- VirtualDevice aVDev;
- aVDev.SetMapMode(MapMode(MAP_100TH_MM));
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
+ pVDev->SetMapMode(MapMode(MAP_100TH_MM));
boost::scoped_ptr<SdrModel> pModel(new SdrModel);
pModel->GetItemPool().FreezeIdRanges();
@@ -1123,7 +1164,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
pPage->SetSize(Size(1000,1000));
pModel->InsertPage( pPage, 0 );
{
- boost::scoped_ptr<SdrView> pView(new SdrView( pModel.get(), &aVDev ));
+ boost::scoped_ptr<SdrView> pView(new SdrView( pModel.get(), pVDev ));
pView->hideMarkHandles();
pView->ShowSdrPage(pPage);
SdrObject *pObj=NULL;
@@ -1488,10 +1529,10 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
-SfxTabPage* SvxLineTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxLineTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxLineTabPage( pWindow, *rAttrs );
+ return VclPtr<SvxLineTabPage>::Create( pWindow, *rAttrs );
}
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 9e947e89358d..0e68ad35c932 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -154,6 +154,31 @@ SvxLineDefTabPage::SvxLineDefTabPage
pDashList = NULL;
}
+SvxLineDefTabPage::~SvxLineDefTabPage()
+{
+ disposeOnce();
+}
+
+void SvxLineDefTabPage::dispose()
+{
+ m_pLbLineStyles.clear();
+ m_pLbType1.clear();
+ m_pLbType2.clear();
+ m_pNumFldNumber1.clear();
+ m_pNumFldNumber2.clear();
+ m_pMtrLength1.clear();
+ m_pMtrLength2.clear();
+ m_pMtrDistance.clear();
+ m_pCbxSynchronize.clear();
+ m_pBtnAdd.clear();
+ m_pBtnModify.clear();
+ m_pBtnDelete.clear();
+ m_pBtnLoad.clear();
+ m_pBtnSave.clear();
+ m_pCtlPreview.clear();
+ SfxTabPage::dispose();
+}
+
void SvxLineDefTabPage::Construct()
{
// Line style fill; do *not* add default fields here
@@ -221,10 +246,10 @@ void SvxLineDefTabPage::CheckChanges_Impl()
{
ResMgr& rMgr = CUI_MGR();
Image aWarningBoxImage = WarningBox::GetStandardImage();
- boost::scoped_ptr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(),
- SVX_RESSTR( RID_SVXSTR_LINESTYLE ),
- OUString( ResId( RID_SVXSTR_ASK_CHANGE_LINESTYLE, rMgr ) ),
- &aWarningBoxImage ));
+ ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(),
+ SVX_RESSTR( RID_SVXSTR_LINESTYLE ),
+ OUString( ResId( RID_SVXSTR_ASK_CHANGE_LINESTYLE, rMgr ) ),
+ &aWarningBoxImage );
DBG_ASSERT(aMessDlg, "Dialog creation failed!");
aMessDlg->SetButtonText( MESS_BTN_1, OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
aMessDlg->SetButtonText( MESS_BTN_2, OUString( ResId( RID_SVXSTR_ADD, rMgr ) ) );
@@ -325,9 +350,9 @@ void SvxLineDefTabPage::Reset( const SfxItemSet* rAttrs )
-SfxTabPage* SvxLineDefTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxLineDefTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs )
{
- return new SvxLineDefTabPage( pWindow, *rOutAttrs );
+ return VclPtr<SvxLineDefTabPage>::Create( pWindow, *rOutAttrs );
}
@@ -593,11 +618,10 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl)
}
else
{
-
- MessageDialog aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui" );
+ aBox->Execute();
}
}
pDlg.reset();
@@ -672,10 +696,10 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickModifyHdl_Impl)
}
else
{
- MessageDialog aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui" );
+ aBox->Execute();
}
}
}
@@ -690,11 +714,11 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickDeleteHdl_Impl)
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- MessageDialog aQueryBox( GetParentDialog()
- ,"AskDelLineStyleDialog"
- ,"cui/ui/querydeletelinestyledialog.ui");
+ ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog()
+ ,"AskDelLineStyleDialog"
+ ,"cui/ui/querydeletelinestyledialog.ui" );
- if ( aQueryBox.Execute() == RET_YES )
+ if ( aQueryBox->Execute() == RET_YES )
{
delete pDashList->Remove( nPos );
m_pLbLineStyles->RemoveEntry( nPos );
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 194b0cd8f2fa..e33cd057f4ed 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -105,17 +105,29 @@ SvxLineEndDefTabPage::SvxLineEndDefTabPage
}
-void SvxLineEndDefTabPage::Resize()
+SvxLineEndDefTabPage::~SvxLineEndDefTabPage()
{
- rXLSet.Put(XLineStartWidthItem(m_pCtlPreview->GetOutputSize().Height() / 2 ));
- rXLSet.Put(XLineEndWidthItem(m_pCtlPreview->GetOutputSize().Height() / 2 ));
- SfxTabPage::Resize();
+ disposeOnce();
}
+void SvxLineEndDefTabPage::dispose()
+{
+ m_pEdtName.clear();
+ m_pLbLineEnds.clear();
+ m_pBtnAdd.clear();
+ m_pBtnModify.clear();
+ m_pBtnDelete.clear();
+ m_pBtnLoad.clear();
+ m_pBtnSave.clear();
+ m_pCtlPreview.clear();
+ SfxTabPage::dispose();
+}
-
-SvxLineEndDefTabPage::~SvxLineEndDefTabPage()
+void SvxLineEndDefTabPage::Resize()
{
+ rXLSet.Put(XLineStartWidthItem(m_pCtlPreview->GetOutputSize().Height() / 2 ));
+ rXLSet.Put(XLineEndWidthItem(m_pCtlPreview->GetOutputSize().Height() / 2 ));
+ SfxTabPage::Resize();
}
@@ -194,11 +206,10 @@ void SvxLineEndDefTabPage::CheckChanges_Impl()
if( aString != m_pLbLineEnds->GetSelectEntry() )
{
- MessageDialog aQueryBox( GetParentDialog()
- ,"AskChangeLineEndDialog"
- ,"cui/ui/querychangelineenddialog.ui");
-
- if ( aQueryBox.Execute() == RET_YES )
+ ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog()
+ ,"AskChangeLineEndDialog"
+ ,"cui/ui/querychangelineenddialog.ui" );
+ if ( aQueryBox->Execute() == RET_YES )
ClickModifyHdl_Impl( this );
}
}
@@ -269,9 +280,9 @@ void SvxLineEndDefTabPage::Reset( const SfxItemSet* )
-SfxTabPage* SvxLineEndDefTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxLineEndDefTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rSet )
{
- return new SvxLineEndDefTabPage( pWindow, *rSet );
+ return VclPtr<SvxLineEndDefTabPage>::Create( pWindow, *rSet );
}
@@ -331,10 +342,10 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl)
// if yes, repeat and demand a new name
if ( !bDifferent )
{
- MessageDialog aWarningBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aWarningBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aWarningBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui" );
+ aWarningBox->Execute();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialog creation failed!");
@@ -356,7 +367,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl)
if( bDifferent )
bLoop = false;
else
- aWarningBox.Execute();
+ aWarningBox->Execute();
}
}
@@ -485,10 +496,10 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl)
}
else
{
- MessageDialog aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui" );
+ aBox->Execute();
}
}
}
@@ -513,11 +524,11 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- MessageDialog aQueryBox( GetParentDialog()
- ,"AskDelLineEndDialog"
- ,"cui/ui/querydeletelineenddialog.ui");
+ ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog()
+ ,"AskDelLineEndDialog"
+ ,"cui/ui/querydeletelineenddialog.ui" );
- if ( aQueryBox.Execute() == RET_YES )
+ if ( aQueryBox->Execute() == RET_YES )
{
delete pLineEndList->Remove( nPos );
m_pLbLineEnds->RemoveEntry( nPos );
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index e1121a6acd65..9c18dc3240f7 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -165,6 +165,23 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA
m_pMtrDistance->SetModifyHdl( aLink );
}
+SvxShadowTabPage::~SvxShadowTabPage()
+{
+ disposeOnce();
+}
+
+void SvxShadowTabPage::dispose()
+{
+ m_pTsbShowShadow.clear();
+ m_pGridShadow.clear();
+ m_pCtlPosition.clear();
+ m_pMtrDistance.clear();
+ m_pLbShadowColor.clear();
+ m_pMtrTransparent.clear();
+ m_pCtlXRectPreview.clear();
+ SvxTabPage::dispose();
+}
+
void SvxShadowTabPage::Construct()
{
m_pLbShadowColor->Fill( pColorList );
@@ -466,10 +483,10 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs )
-SfxTabPage* SvxShadowTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxShadowTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxShadowTabPage( pWindow, *rAttrs );
+ return VclPtr<SvxShadowTabPage>::Create( pWindow, *rAttrs );
}
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 5658f7aba4a8..2da50ac83e69 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -116,12 +116,6 @@ SvxTransformTabDialog::SvxTransformTabDialog( vcl::Window* pParent, const SfxIte
-SvxTransformTabDialog::~SvxTransformTabDialog()
-{
-}
-
-
-
void SvxTransformTabDialog::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
{
if (nId==nPosSize)
@@ -203,6 +197,23 @@ SvxAngleTabPage::SvxAngleTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
m_pCtlAngle->SetLinkedField( m_pNfAngle, 2 );
}
+SvxAngleTabPage::~SvxAngleTabPage()
+{
+ disposeOnce();
+}
+
+void SvxAngleTabPage::dispose()
+{
+ m_pFlPosition.clear();
+ m_pMtrPosX.clear();
+ m_pMtrPosY.clear();
+ m_pCtlRect.clear();
+ m_pFlAngle.clear();
+ m_pNfAngle.clear();
+ m_pCtlAngle.clear();
+ SvxTabPage::dispose();
+}
+
void SvxAngleTabPage::Construct()
{
DBG_ASSERT(pView, "No valid view (!)");
@@ -313,9 +324,9 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs)
-SfxTabPage* SvxAngleTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SvxAngleTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rSet)
{
- return new SvxAngleTabPage(pWindow, *rSet);
+ return VclPtr<SvxAngleTabPage>::Create(pWindow, *rSet);
}
@@ -428,6 +439,20 @@ SvxSlantTabPage::SvxSlantTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
ePoolUnit = pPool->GetMetric( SID_ATTR_TRANSFORM_POS_X );
}
+SvxSlantTabPage::~SvxSlantTabPage()
+{
+ disposeOnce();
+}
+
+void SvxSlantTabPage::dispose()
+{
+ m_pFlRadius.clear();
+ m_pMtrRadius.clear();
+ m_pFlAngle.clear();
+ m_pMtrAngle.clear();
+ SvxTabPage::dispose();
+}
+
void SvxSlantTabPage::Construct()
{
// get the range
@@ -540,9 +565,9 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
-SfxTabPage* SvxSlantTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxSlantTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs )
{
- return new SvxSlantTabPage( pWindow, *rOutAttrs );
+ return VclPtr<SvxSlantTabPage>::Create( pWindow, *rOutAttrs );
}
@@ -643,6 +668,33 @@ SvxPositionSizeTabPage::SvxPositionSizeTabPage(vcl::Window* pParent, const SfxIt
}
+SvxPositionSizeTabPage::~SvxPositionSizeTabPage()
+{
+ disposeOnce();
+}
+
+void SvxPositionSizeTabPage::dispose()
+{
+ m_pFlPosition.clear();
+ m_pMtrPosX.clear();
+ m_pMtrPosY.clear();
+ m_pCtlPos.clear();
+ m_pFlSize.clear();
+ m_pFtWidth.clear();
+ m_pMtrWidth.clear();
+ m_pFtHeight.clear();
+ m_pMtrHeight.clear();
+ m_pCbxScale.clear();
+ m_pCtlSize.clear();
+ m_pFlProtect.clear();
+ m_pTsbPosProtect.clear();
+ m_pTsbSizeProtect.clear();
+ m_pFlAdjust.clear();
+ m_pTsbAutoGrowWidth.clear();
+ m_pTsbAutoGrowHeight.clear();
+ SvxTabPage::dispose();
+}
+
void SvxPositionSizeTabPage::Construct()
{
// get range and work area
@@ -972,9 +1024,9 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
-SfxTabPage* SvxPositionSizeTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxPositionSizeTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs )
{
- return new SvxPositionSizeTabPage( pWindow, *rOutAttrs );
+ return VclPtr<SvxPositionSizeTabPage>::Create( pWindow, *rOutAttrs );
}