summaryrefslogtreecommitdiff
path: root/cui/source/options
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/options')
-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
57 files changed, 1330 insertions, 639 deletions
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;
};