diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-05-05 10:13:50 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-05-05 10:15:13 +0100 |
commit | 36c8dd27b19ce5088b65096af5f464ec5720efaa (patch) | |
tree | 36621dd14e74860260b65c0c08570b458d56ce2b /svtools | |
parent | 83076579132eabf50748c15d7a8defb6c3aa851e (diff) |
tdf#91027 - cleanup dbaccess related dispose logic.
Change-Id: Ice92188b097974b8e305c0180a791e25ed537054
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/dialogs/roadmapwizard.cxx | 10 | ||||
-rw-r--r-- | svtools/source/dialogs/wizardmachine.cxx | 14 | ||||
-rw-r--r-- | svtools/source/dialogs/wizdlg.cxx | 9 |
3 files changed, 19 insertions, 14 deletions
diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx index 83ef2f42f767..e63997907de9 100644 --- a/svtools/source/dialogs/roadmapwizard.cxx +++ b/svtools/source/dialogs/roadmapwizard.cxx @@ -33,16 +33,14 @@ namespace svt { - - namespace { - typedef ::std::set< WizardTypes::WizardState > StateSet; + typedef ::std::set< WizardTypes::WizardState > StateSet; typedef ::std::map< RoadmapWizardTypes::PathId, RoadmapWizardTypes::WizardPath - > Paths; + > Paths; typedef ::std::map< WizardTypes::WizardState, @@ -50,7 +48,7 @@ namespace svt OUString, RoadmapWizardTypes::RoadmapPageFactory > - > StateDescriptions; + > StateDescriptions; } struct RoadmapWizardImpl : public RoadmapWizardTypes @@ -155,10 +153,10 @@ namespace svt void RoadmapWizard::dispose() { delete m_pImpl; + m_pImpl = NULL; OWizardMachine::dispose(); } - void RoadmapWizard::SetRoadmapHelpId( const OString& _rId ) { m_pImpl->pRoadmap->SetHelpId( _rId ); diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx index 278df80c2d37..156159c160ac 100644 --- a/svtools/source/dialogs/wizardmachine.cxx +++ b/svtools/source/dialogs/wizardmachine.cxx @@ -213,10 +213,18 @@ namespace svt m_pPrevPage.disposeAndClear(); m_pHelp.disposeAndClear(); - for (WizardState i=0; i<m_pImpl->nFirstUnknownPage; ++i) - GetPage(i)->disposeOnce(); + if (m_pImpl) + { + for (WizardState i = 0; i < m_pImpl->nFirstUnknownPage; ++i) + { + TabPage *pPage = GetPage(i); + if (pPage) + pPage->disposeOnce(); + } + delete m_pImpl; + m_pImpl = NULL; + } - delete m_pImpl; WizardDialog::dispose(); } diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx index 0d0acc4e5242..74c04e77f15e 100644 --- a/svtools/source/dialogs/wizdlg.cxx +++ b/svtools/source/dialogs/wizdlg.cxx @@ -622,15 +622,14 @@ void WizardDialog::SetPage( sal_uInt16 nLevel, TabPage* pPage ) TabPage* WizardDialog::GetPage( sal_uInt16 nLevel ) const { - sal_uInt16 nTempLevel = 0; - ImplWizPageData* pPageData = mpFirstPage; - while ( pPageData ) + sal_uInt16 nTempLevel = 0; + + for (ImplWizPageData* pPageData = mpFirstPage; pPageData; + pPageData = pPageData->mpNext) { if ( nTempLevel == nLevel ) return pPageData->mpPage; - nTempLevel++; - pPageData = pPageData->mpNext; } return NULL; |