summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-03-02 22:02:19 +0000
committerMichael Meeks <michael.meeks@collabora.com>2015-04-09 22:35:14 +0100
commit954e5e4b7820c5db3a6720dc9dc27e49cee449ac (patch)
treea5136c84a45d3861f7271b9eced37e33aa274658 /cui/source
parente8284454f517d29a29f95a347a38730ded047f41 (diff)
prophylactic double dispose audit.
Change-Id: Ia18c0b7a76fb0894efe33afaf69a0079c4583228
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/customize/acccfg.cxx2
-rw-r--r--cui/source/customize/cfg.cxx35
-rw-r--r--cui/source/dialogs/SpellDialog.cxx16
-rw-r--r--cui/source/dialogs/colorpicker.cxx2
-rw-r--r--cui/source/dialogs/cuifmsearch.cxx9
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx4
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx2
-rw-r--r--cui/source/dialogs/dlgname.cxx1
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx16
-rw-r--r--cui/source/dialogs/hldocntp.cxx8
-rw-r--r--cui/source/dialogs/hltpbase.cxx2
-rw-r--r--cui/source/dialogs/iconcdlg.cxx18
-rw-r--r--cui/source/dialogs/insdlg.cxx3
-rw-r--r--cui/source/dialogs/multipat.cxx13
-rw-r--r--cui/source/dialogs/srchxtra.cxx1
-rw-r--r--cui/source/options/certpath.cxx1
-rw-r--r--cui/source/options/dbregister.cxx1
-rw-r--r--cui/source/options/fontsubs.cxx3
-rw-r--r--cui/source/options/optaccessibility.cxx1
-rw-r--r--cui/source/options/optasian.cxx1
-rw-r--r--cui/source/options/optchart.cxx13
-rw-r--r--cui/source/options/optcolor.cxx32
-rw-r--r--cui/source/options/optfltr.cxx2
-rw-r--r--cui/source/options/optgdlg.cxx4
-rw-r--r--cui/source/options/optinet2.cxx5
-rw-r--r--cui/source/options/optjava.cxx16
-rw-r--r--cui/source/options/optlingu.cxx6
-rw-r--r--cui/source/options/optpath.cxx13
-rw-r--r--cui/source/options/optsave.cxx3
-rw-r--r--cui/source/options/treeopt.cxx6
-rw-r--r--cui/source/options/webconninfo.cxx2
-rw-r--r--cui/source/tabpages/align.cxx1
-rw-r--r--cui/source/tabpages/autocdlg.cxx19
-rw-r--r--cui/source/tabpages/backgrnd.cxx14
-rw-r--r--cui/source/tabpages/chardlg.cxx3
-rw-r--r--cui/source/tabpages/numfmt.cxx2
-rw-r--r--cui/source/tabpages/numpages.cxx19
-rw-r--r--cui/source/tabpages/page.cxx2
-rw-r--r--cui/source/tabpages/tpbitmap.cxx3
-rw-r--r--cui/source/tabpages/tpcolor.cxx3
-rw-r--r--cui/source/tabpages/tpline.cxx13
41 files changed, 213 insertions, 107 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index d6a2c53bf487..a65e56568cdb 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -828,6 +828,8 @@ void SfxAcceleratorConfigPage::dispose()
m_pKeyBox->Clear();
delete m_pFileDlg;
+ m_pFileDlg = NULL;
+
SfxTabPage::dispose();
}
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 7c108a6e28eb..8fc2b26db078 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2233,9 +2233,13 @@ void SvxMenuConfigPage::dispose()
delete pData;
}
+ m_pSaveInListBox->Clear();
delete m_pSelectorDlg;
+ m_pSelectorDlg = NULL;
delete m_pContentsListBox;
+ m_pContentsListBox = NULL;
+
SvxConfigPage::dispose();
}
@@ -2925,14 +2929,14 @@ void SvxToolbarConfigPage::dispose()
delete pData;
}
+ m_pSaveInListBox->Clear();
- if ( m_pSelectorDlg != NULL )
- {
- delete m_pSelectorDlg;
- }
-
+ delete m_pSelectorDlg;
+ m_pSelectorDlg = NULL;
delete m_pContentsListBox;
+ m_pContentsListBox = NULL;
+
SvxConfigPage::dispose();
}
@@ -4531,6 +4535,8 @@ SvxToolbarEntriesListBox::~SvxToolbarEntriesListBox()
void SvxToolbarEntriesListBox::dispose()
{
delete m_pButtonData;
+ m_pButtonData = NULL;
+
SvxMenuEntriesListBox::dispose();
}
@@ -4920,20 +4926,23 @@ SvxIconSelectorDialog::~SvxIconSelectorDialog()
void SvxIconSelectorDialog::dispose()
{
- sal_uInt16 nCount = pTbSymbol->GetItemCount();
-
- for (sal_uInt16 n = 0; n < nCount; ++n )
+ if (pTbSymbol)
{
- sal_uInt16 nId = pTbSymbol->GetItemId(n);
-
- uno::XInterface* xi = static_cast< uno::XInterface* >(
- pTbSymbol->GetItemData( nId ) );
+ sal_uInt16 nCount = pTbSymbol->GetItemCount();
- if ( xi != NULL )
+ for (sal_uInt16 n = 0; n < nCount; ++n )
{
+ sal_uInt16 nId = pTbSymbol->GetItemId(n);
+
+ uno::XInterface* xi = static_cast< uno::XInterface* >(
+ pTbSymbol->GetItemData( nId ) );
+
+ if ( xi != NULL )
xi->release();
}
+ pTbSymbol = NULL;
}
+
ModalDialog::dispose();
}
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 2d130a525741..5c81f1c02206 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -251,19 +251,19 @@ SpellDialog::~SpellDialog()
void SpellDialog::dispose()
{
- // save possibly modified user-dictionaries
- Reference< XSearchableDictionaryList > xDicList( SvxGetDictionaryList() );
- if (xDicList.is())
+ if (pImpl)
{
- SaveDictionaries( xDicList );
- }
+ // save possibly modified user-dictionaries
+ Reference< XSearchableDictionaryList > xDicList( SvxGetDictionaryList() );
+ if (xDicList.is())
+ SaveDictionaries( xDicList );
- delete pImpl;
+ delete pImpl;
+ pImpl = NULL;
+ }
SfxModelessDialog::dispose();
}
-
-
void SpellDialog::Init_Impl()
{
// initialize handler
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 76619dab9fcd..7edff10bf399 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -366,6 +366,7 @@ ColorFieldControl::~ColorFieldControl()
void ColorFieldControl::dispose()
{
delete mpBitmap;
+ mpBitmap = NULL;
Control::dispose();
}
@@ -758,6 +759,7 @@ ColorSliderControl::~ColorSliderControl()
void ColorSliderControl::dispose()
{
delete mpBitmap;
+ mpBitmap = NULL;
Control::dispose();
}
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index d651f0e4c89b..c8bbf0abab69 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -170,13 +170,12 @@ void FmSearchDialog::dispose()
SaveParams();
- if (m_pConfig)
- {
- delete m_pConfig;
- m_pConfig = NULL;
- }
+ delete m_pConfig;
+ m_pConfig = NULL;
delete m_pSearchEngine;
+ m_pSearchEngine = NULL;
+
ModalDialog::dispose();
}
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 27337db42052..ac330ae95173 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -767,11 +767,11 @@ void TPGalleryThemeProperties::dispose()
for ( size_t i = 0, n = aFilterEntryList.size(); i < n; ++i ) {
delete aFilterEntryList[ i ];
}
+ aFilterEntryList.clear();
+
SfxTabPage::dispose();
}
-
-
SfxTabPage* TPGalleryThemeProperties::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
return new TPGalleryThemeProperties( pParent, *rSet );
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index bb5463e7d655..99f8dadd6d60 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -167,6 +167,8 @@ void SvxHpLinkDlg::dispose()
aViewOpt.Delete();
delete mpItemSet;
+ mpItemSet = NULL;
+
IconChoiceDialog::dispose();
}
diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index 1f6c66310725..4a49494243d1 100644
--- a/cui/source/dialogs/dlgname.cxx
+++ b/cui/source/dialogs/dlgname.cxx
@@ -144,6 +144,7 @@ SvxMessDialog::~SvxMessDialog()
void SvxMessDialog::dispose()
{
delete pImage;
+ pImage = NULL;
ModalDialog::dispose();
}
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 46136a9e66ec..6d8e10123d7f 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -1139,17 +1139,17 @@ namespace svx
void HangulHanjaOptionsDialog::dispose()
{
- SvTreeListEntry* pEntry = m_pDictsLB->First();
+ SvTreeListEntry* pEntry = m_pDictsLB->First();
while( pEntry )
{
- OUString const * pDel = static_cast<OUString const *>(pEntry->GetUserData());
- if( pDel )
- delete pDel;
+ delete static_cast<OUString const *>(pEntry->GetUserData());
+ pEntry->SetUserData(NULL);
pEntry = m_pDictsLB->Next( pEntry );
}
- if( m_pCheckButtonData )
- delete m_pCheckButtonData;
+ delete m_pCheckButtonData;
+ m_pCheckButtonData = NULL;
+
ModalDialog::dispose();
}
@@ -1785,8 +1785,8 @@ namespace svx
void HangulHanjaEditDictDialog::dispose()
{
- if( m_pSuggestions )
- delete m_pSuggestions;
+ delete m_pSuggestions;
+ m_pSuggestions = NULL;
ModalDialog::dispose();
}
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index f1c790045a1b..ad1e7fafc64b 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -134,11 +134,11 @@ SvxHyperlinkNewDocTp::~SvxHyperlinkNewDocTp ()
void SvxHyperlinkNewDocTp::dispose()
{
- for ( sal_uInt16 n=0; n<m_pLbDocTypes->GetEntryCount(); n++ )
+ if (m_pLbDocTypes)
{
- DocumentTypeData* pTypeData = static_cast<DocumentTypeData*>(
- m_pLbDocTypes->GetEntryData ( n ));
- delete pTypeData;
+ for ( sal_uInt16 n=0; n<m_pLbDocTypes->GetEntryCount(); n++ )
+ delete static_cast<DocumentTypeData*>(m_pLbDocTypes->GetEntryData ( n ));
+ m_pLbDocTypes = NULL;
}
SvxHyperlinkTabPageBase::dispose();
}
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 62fd0465fa5a..804442321f1d 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -115,6 +115,8 @@ void SvxHyperlinkTabPageBase::dispose()
maTimer.Stop();
delete mpMarkWnd;
+ mpMarkWnd = NULL;
+
IconChoicePage::dispose();
}
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 111499ef5c5c..0a1c70e7d70b 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -236,18 +236,24 @@ void IconChoiceDialog::dispose()
}
delete pData;
}
+ maPageList.clear();
- // remove Userdata from Icons
- for ( sal_uLong i=0; i < m_pIconCtrl->GetEntryCount(); i++)
+ if (m_pIconCtrl)
{
- SvxIconChoiceCtrlEntry* pEntry = m_pIconCtrl->GetEntry ( i );
- sal_uInt16* pUserData = static_cast<sal_uInt16*>(pEntry->GetUserData());
- delete pUserData;
+ // remove Userdata from Icons
+ for ( sal_uLong i=0; i < m_pIconCtrl->GetEntryCount(); i++)
+ {
+ SvxIconChoiceCtrlEntry* pEntry = m_pIconCtrl->GetEntry ( i );
+ delete static_cast<sal_uInt16*>(pEntry->GetUserData());
+ }
+ m_pIconCtrl = NULL;
}
-
delete pRanges;
+ pRanges = NULL;
delete pOutSet;
+ pOutSet = NULL;
+
ModalDialog::dispose();
}
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index db360449bd41..4131c40c5c8a 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -401,11 +401,10 @@ SvInsertPlugInDialog::~SvInsertPlugInDialog()
void SvInsertPlugInDialog::dispose()
{
delete m_pURL;
+ m_pURL = NULL;
InsertObjectDialog_Impl::dispose();
}
-
-
static void Plugin_ImplFillCommandSequence( const OUString& aCommands, uno::Sequence< beans::PropertyValue >& aCommandSequence )
{
sal_Int32 nEaten;
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index 6b4b4b7733c4..ebb8fcdca031 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -237,6 +237,8 @@ void SvxMultiPathDialog::dispose()
}
delete m_pRadioLB;
+ m_pRadioLB = NULL;
+
ModalDialog::dispose();
}
@@ -247,10 +249,13 @@ SvxPathSelectDialog::~SvxPathSelectDialog()
void SvxPathSelectDialog::dispose()
{
- sal_uInt16 nPos = m_pPathLB->GetEntryCount();
- while ( nPos-- )
- delete static_cast<OUString*>(m_pPathLB->GetEntryData(nPos));
-
+ if (m_pPathLB)
+ {
+ sal_uInt16 nPos = m_pPathLB->GetEntryCount();
+ while ( nPos-- )
+ delete static_cast<OUString*>(m_pPathLB->GetEntryData(nPos));
+ m_pPathLB = NULL;
+ }
ModalDialog::dispose();
}
diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx
index da6a1e6d99a9..bb797e3d4dd8 100644
--- a/cui/source/dialogs/srchxtra.cxx
+++ b/cui/source/dialogs/srchxtra.cxx
@@ -70,6 +70,7 @@ SvxSearchFormatDialog::~SvxSearchFormatDialog()
void SvxSearchFormatDialog::dispose()
{
delete m_pFontList;
+ m_pFontList = NULL;
SfxTabDialog::dispose();
}
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index 0cfb700e66aa..8e4776361897 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -157,6 +157,7 @@ void CertPathDialog::dispose()
pEntry = m_pCertPathList->Next( pEntry );
}
delete m_pCertPathList;
+ m_pCertPathList = NULL;
ModalDialog::dispose();
}
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index eb2364e981e4..de08fa07c5e0 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -171,6 +171,7 @@ void DbRegistrationOptionsPage::dispose()
for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i )
delete static_cast< DatabaseRegistration* >( pPathBox->GetEntry(i)->GetUserData() );
delete pPathBox;
+ pPathBox = NULL;
SfxTabPage::dispose();
}
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index c135ab289618..098855ae032e 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -144,8 +144,11 @@ SvxFontSubstTabPage::~SvxFontSubstTabPage()
void SvxFontSubstTabPage::dispose()
{
delete pCheckButtonData;
+ pCheckButtonData = NULL;
delete pConfig;
+ pConfig = NULL;
delete m_pCheckLB;
+ m_pCheckLB = NULL;
SfxTabPage::dispose();
}
diff --git a/cui/source/options/optaccessibility.cxx b/cui/source/options/optaccessibility.cxx
index 8deb9e7cccc0..f09b19c5eafa 100644
--- a/cui/source/options/optaccessibility.cxx
+++ b/cui/source/options/optaccessibility.cxx
@@ -64,6 +64,7 @@ SvxAccessibilityOptionsTabPage::~SvxAccessibilityOptionsTabPage()
void SvxAccessibilityOptionsTabPage::dispose()
{
delete m_pImpl;
+ m_pImpl = NULL;
SfxTabPage::dispose();
}
diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx
index f8658bdd8673..0f9bab237d61 100644
--- a/cui/source/options/optasian.cxx
+++ b/cui/source/options/optasian.cxx
@@ -157,6 +157,7 @@ SvxAsianLayoutPage::~SvxAsianLayoutPage()
void SvxAsianLayoutPage::dispose()
{
delete pImpl;
+ pImpl = NULL;
SfxTabPage::dispose();
}
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx
index 8f8fd9770bac..8005483464f1 100644
--- a/cui/source/options/optchart.cxx
+++ b/cui/source/options/optchart.cxx
@@ -89,11 +89,16 @@ SvxDefaultColorOptPage::~SvxDefaultColorOptPage()
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;
+ }
SfxTabPage::dispose();
}
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index c96cb625fb4f..b18abccdec0f 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -1077,23 +1077,29 @@ SvxColorOptionsTabPage::~SvxColorOptionsTabPage()
void SvxColorOptionsTabPage::dispose()
{
- //when the dialog is cancelled but the color scheme ListBox has been changed these
- //changes need to be undone
- if(!bFillItemSetCalled && m_pColorSchemeLB->IsValueChangedFromSaved())
+ 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;
SfxTabPage::dispose();
}
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 59262aa314c1..6a6d7116d70b 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -165,7 +165,9 @@ OfaMSFilterTabPage2::~OfaMSFilterTabPage2()
void OfaMSFilterTabPage2::dispose()
{
delete pCheckButtonData;
+ pCheckButtonData = NULL;
delete m_pCheckLB;
+ m_pCheckLB = NULL;
SfxTabPage::dispose();
}
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 09c74e5a7417..3ab3ae842707 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -688,8 +688,11 @@ OfaViewTabPage::~OfaViewTabPage()
void OfaViewTabPage::dispose()
{
delete mpDrawinglayerOpt;
+ mpDrawinglayerOpt = NULL;
delete pCanvasSettings;
+ pCanvasSettings = NULL;
delete pAppearanceCfg;
+ pAppearanceCfg = NULL;
SfxTabPage::dispose();
}
@@ -1213,6 +1216,7 @@ OfaLanguagesTabPage::~OfaLanguagesTabPage()
void OfaLanguagesTabPage::dispose()
{
delete pLangConfig;
+ pLangConfig = NULL;
SfxTabPage::dispose();
}
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 04333b7b8ef6..a9063ece06d4 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -628,9 +628,11 @@ SvxSecurityTabPage::~SvxSecurityTabPage()
void SvxSecurityTabPage::dispose()
{
delete mpCertPathDlg;
-
+ mpCertPathDlg = NULL;
delete mpSecOptions;
+ mpSecOptions = NULL;
delete mpSecOptDlg;
+ mpSecOptDlg = NULL;
SfxTabPage::dispose();
}
@@ -980,6 +982,7 @@ SvxEMailTabPage::~SvxEMailTabPage()
void SvxEMailTabPage::dispose()
{
delete pImpl;
+ pImpl = NULL;
SfxTabPage::dispose();
}
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 8843f10df485..5be1b1fa39fe 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -208,8 +208,11 @@ SvxJavaOptionsPage::~SvxJavaOptionsPage()
void SvxJavaOptionsPage::dispose()
{
delete m_pJavaList;
+ m_pJavaList = NULL;
delete m_pParamDlg;
+ m_pParamDlg = NULL;
delete m_pPathDlg;
+ m_pPathDlg = NULL;
ClearJavaInfo();
#if HAVE_FEATURE_JAVA
std::vector< JavaInfo* >::iterator pIter;
@@ -218,6 +221,7 @@ void SvxJavaOptionsPage::dispose()
JavaInfo* pInfo = *pIter;
jfw_freeJavaInfo( pInfo );
}
+ m_aAddedInfos.clear();
jfw_unlock();
#endif
@@ -944,14 +948,16 @@ SvxJavaClassPathDlg::~SvxJavaClassPathDlg()
void SvxJavaClassPathDlg::dispose()
{
- sal_Int32 i, nCount = m_pPathList->GetEntryCount();
- for ( i = 0; i < nCount; ++i )
- delete static_cast< OUString* >( m_pPathList->GetEntryData(i) );
+ 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;
+ }
ModalDialog::dispose();
}
-
-
IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddArchiveHdl_Impl)
{
sfx2::FileDialogHelper aDlg( TemplateDescription::FILEOPEN_SIMPLE, 0 );
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 393f6f7625ec..8e7929e0334f 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1127,8 +1127,8 @@ SvxLinguTabPage::~SvxLinguTabPage()
void SvxLinguTabPage::dispose()
{
- if (pLinguData)
- delete pLinguData;
+ delete pLinguData;
+ pLinguData = NULL;
SfxTabPage::dispose();
}
@@ -1904,10 +1904,10 @@ SvxEditModulesDlg::~SvxEditModulesDlg()
void SvxEditModulesDlg::dispose()
{
delete pDefaultLinguData;
+ pDefaultLinguData = NULL;
ModalDialog::dispose();
}
-
SvTreeListEntry* SvxEditModulesDlg::CreateEntry( OUString& rTxt, sal_uInt16 nCol )
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 8cefe813a072..94de402f231c 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -252,15 +252,18 @@ SvxPathTabPage::~SvxPathTabPage()
void SvxPathTabPage::dispose()
{
- for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i )
- delete static_cast<PathUserData_Impl*>(pPathBox->GetEntry(i)->GetUserData());
- delete pPathBox;
+ if ( pPathBox )
+ {
+ for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i )
+ delete static_cast<PathUserData_Impl*>(pPathBox->GetEntry(i)->GetUserData());
+ delete pPathBox;
+ pPathBox = NULL;
+ }
delete pImpl;
+ pImpl = NULL;
SfxTabPage::dispose();
}
-
-
SfxTabPage* SvxPathTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet )
{
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 12fac31eb495..00d3aff38e77 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -205,11 +205,10 @@ SfxSaveTabPage::~SfxSaveTabPage()
void SvxSaveTabPage::dispose()
{
delete pImpl;
+ pImpl = NULL;
SfxTabPage::dispose();
}
-
-
SfxTabPage* SfxSaveTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet )
{
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 75311ef88885..095b6fc3b6c8 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -558,7 +558,7 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
void OfaTreeOptionsDialog::dispose()
{
pCurrentPageEntry = NULL;
- SvTreeListEntry* pEntry = pTreeLB->First();
+ SvTreeListEntry* pEntry = pTreeLB ? pTreeLB->First() : NULL;
// first children
while(pEntry)
{
@@ -596,7 +596,7 @@ void OfaTreeOptionsDialog::dispose()
}
// and parents
- pEntry = pTreeLB->First();
+ pEntry = pTreeLB ? pTreeLB->First() : NULL;
while(pEntry)
{
if(!pTreeLB->GetParent(pEntry))
@@ -609,7 +609,9 @@ void OfaTreeOptionsDialog::dispose()
pEntry = pTreeLB->Next(pEntry);
}
delete pColorPageItemSet;
+ pColorPageItemSet = NULL;
deleteGroupNames();
+ pTreeLB = NULL;
SfxModalDialog::dispose();
}
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index 9acfdafe5616..6628b18d4fb5 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -148,10 +148,10 @@ WebConnectionInfoDialog::~WebConnectionInfoDialog()
void WebConnectionInfoDialog::dispose()
{
delete m_pPasswordsLB;
+ m_pPasswordsLB = NULL;
ModalDialog::dispose();
}
-
IMPL_LINK( WebConnectionInfoDialog, HeaderBarClickedHdl, SvSimpleTable*, pTable )
{
m_pPasswordsLB->Resort( NULL == pTable );
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 1c5587ce3a33..7405627bf192 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -256,6 +256,7 @@ AlignmentTabPage::~AlignmentTabPage()
void AlignmentTabPage::dispose()
{
delete m_pOrientHlp;
+ m_pOrientHlp = NULL;
SfxTabPage::dispose();
}
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index a35fa19ad9c3..9ad3cfca5369 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -474,11 +474,16 @@ OfaSwAutoFmtOptionsPage::~OfaSwAutoFmtOptionsPage()
void OfaSwAutoFmtOptionsPage::dispose()
{
- delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( REPLACE_BULLETS ));
- delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( APPLY_NUMBERING ));
- delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( MERGE_SINGLE_LINE_PARA ));
- delete pCheckButtonData;
- delete m_pCheckLB;
+ if (m_pCheckLB)
+ {
+ delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( REPLACE_BULLETS ));
+ delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( APPLY_NUMBERING ));
+ delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( MERGE_SINGLE_LINE_PARA ));
+ delete pCheckButtonData;
+ pCheckButtonData = NULL;
+ delete m_pCheckLB;
+ m_pCheckLB = NULL;
+ }
SfxTabPage::dispose();
}
@@ -912,7 +917,9 @@ void OfaAutocorrReplacePage::dispose()
aChangesTable.clear();
delete pCompareClass;
+ pCompareClass = NULL;
delete pCharClass;
+ pCharClass = NULL;
SfxTabPage::dispose();
}
@@ -1841,7 +1848,9 @@ OfaQuoteTabPage::~OfaQuoteTabPage()
void OfaQuoteTabPage::dispose()
{
delete pCheckButtonData;
+ pCheckButtonData = NULL;
delete m_pSwCheckLB;
+ m_pSwCheckLB = NULL;
SfxTabPage::dispose();
}
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 294530446418..15c78264e57b 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -237,10 +237,10 @@ BackgroundPreviewImpl::~BackgroundPreviewImpl()
void BackgroundPreviewImpl::dispose()
{
delete pBitmap;
+ pBitmap = NULL;
vcl::Window::dispose();
}
-
void BackgroundPreviewImpl::NotifyChange( const Color& rColor )
{
if ( !bIsBmp )
@@ -434,9 +434,15 @@ SvxBackgroundTabPage::~SvxBackgroundTabPage()
void SvxBackgroundTabPage::dispose()
{
- delete pPageImpl->pLoadIdle;
- delete pPageImpl;
+ if (pPageImpl)
+ {
+ delete pPageImpl->pLoadIdle;
+ delete pPageImpl;
+ pPageImpl = NULL;
+ }
+
delete pImportDlg;
+ pImportDlg = NULL;
if( pTableBck_Impl)
{
@@ -444,6 +450,7 @@ void SvxBackgroundTabPage::dispose()
delete pTableBck_Impl->pRowBrush;
delete pTableBck_Impl->pTableBrush;
delete pTableBck_Impl;
+ pTableBck_Impl = NULL;
}
if(pParaBck_Impl)
@@ -451,6 +458,7 @@ void SvxBackgroundTabPage::dispose()
delete pParaBck_Impl->pParaBrush;
delete pParaBck_Impl->pCharBrush;
delete pParaBck_Impl;
+ pParaBck_Impl = NULL;
}
SvxTabPage::dispose();
}
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index d3fc39713347..f4c10541ef8f 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -375,11 +375,10 @@ SvxCharNamePage::~SvxCharNamePage()
void SvxCharNamePage::dispose()
{
delete m_pImpl;
+ m_pImpl = NULL;
SvxCharBasePage::dispose();
}
-
-
void SvxCharNamePage::Initialize()
{
// to handle the changes of the other pages
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index f80c0d8c3881..cab5ff266877 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -289,7 +289,9 @@ SvxNumberFormatTabPage::~SvxNumberFormatTabPage()
void SvxNumberFormatTabPage::dispose()
{
delete pNumFmtShell;
+ pNumFmtShell = NULL;
delete pNumItem;
+ pNumItem = NULL;
SfxTabPage::dispose();
}
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 7ffcd79d9592..56d500e35164 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -225,7 +225,9 @@ SvxSingleNumPickTabPage::~SvxSingleNumPickTabPage()
void SvxSingleNumPickTabPage::dispose()
{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
SfxTabPage::dispose();
}
@@ -392,7 +394,9 @@ SvxBulletPickTabPage::~SvxBulletPickTabPage()
void SvxBulletPickTabPage::dispose()
{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
SfxTabPage::dispose();
}
@@ -595,7 +599,9 @@ SvxNumPickTabPage::~SvxNumPickTabPage()
void SvxNumPickTabPage::dispose()
{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
SfxTabPage::dispose();
}
@@ -842,7 +848,9 @@ SvxBitmapPickTabPage::~SvxBitmapPickTabPage()
void SvxBitmapPickTabPage::dispose()
{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
SfxTabPage::dispose();
}
@@ -1154,9 +1162,15 @@ SvxNumOptionsTabPage::~SvxNumOptionsTabPage()
void SvxNumOptionsTabPage::dispose()
{
- delete m_pBitmapMB->GetPopupMenu()->GetPopupMenu(m_nGalleryId);
+ if (m_pBitmapMB)
+ {
+ delete m_pBitmapMB->GetPopupMenu()->GetPopupMenu(m_nGalleryId);
+ m_pBitmapMB = NULL;
+ }
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
SfxTabPage::dispose();
}
@@ -2719,9 +2733,12 @@ SvxNumPositionTabPage::~SvxNumPositionTabPage()
void SvxNumPositionTabPage::dispose()
{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
SfxTabPage::dispose();
}
+
/*-------------------------------------------------------*/
#if OSL_DEBUG_LEVEL > 1
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 13f87f7494b1..6c8c41eaa0bd 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -374,6 +374,8 @@ void SvxPageDescPage::dispose()
if(mbDelPrinter)
{
delete mpDefPrinter;
+ mpDefPrinter = NULL;
+ mbDelPrinter = false;
}
SfxTabPage::dispose();
}
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 3a81c3dfaa41..faf565ce7549 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -128,11 +128,10 @@ SvxBitmapTabPage::~SvxBitmapTabPage()
void SvxBitmapTabPage::dispose()
{
delete m_pBitmapCtl;
+ m_pBitmapCtl = NULL;
SvxTabPage::dispose();
}
-
-
void SvxBitmapTabPage::Construct()
{
m_pLbColor->Fill( pColorList );
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index a9dd01440549..3d74649ae106 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -403,11 +403,10 @@ SvxColorTabPage::~SvxColorTabPage()
void SvxColorTabPage::dispose()
{
delete pShadow;
+ pShadow = NULL;
SfxTabPage::dispose();
}
-
-
void SvxColorTabPage::ImpColorCountChanged()
{
if (!pColorList.is())
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index eb0cf976aea6..e6fe6a96f899 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -236,11 +236,14 @@ SvxLineTabPage::~SvxLineTabPage()
void SvxLineTabPage::dispose()
{
// Symbols on a line (e.g. StarCharts), dtor new!
+ if (m_pSymbolMB)
+ {
+ delete m_pSymbolMB->GetPopupMenu()->GetPopupMenu( MN_GALLERY );
- delete m_pSymbolMB->GetPopupMenu()->GetPopupMenu( MN_GALLERY );
-
- if(pSymbolList)
- delete m_pSymbolMB->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS );
+ if(pSymbolList)
+ delete m_pSymbolMB->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS );
+ m_pSymbolMB = NULL;
+ }
for ( size_t i = 0, n = aGrfBrushItems.size(); i < n; ++i )
{
@@ -248,6 +251,8 @@ void SvxLineTabPage::dispose()
delete pInfo->pBrushItem;
delete pInfo;
}
+ aGrfBrushItems.clear();
+
SvxTabPage::dispose();
}