diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx index 02888d3f505d..dd61fc2e7884 100644 --- a/cui/source/customize/eventdlg.cxx +++ b/cui/source/customize/eventdlg.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include "headertablistbox.hxx" #include "macropg_impl.hxx" @@ -108,7 +109,18 @@ void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFra SvxEventConfigPage::~SvxEventConfigPage() { + // need to delete the user data + SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); + SvTreeListEntry* pE = rListBox.GetEntry( 0 ); + while( pE ) + { + OUString* pEventName = (OUString*)pE->GetUserData(); + delete pEventName; + pE->SetUserData((void*)0); + pE = rListBox.NextSibling( pE ); + } delete mpImpl->pEventLB; + delete mpImpl->pAssignFT; delete mpImpl->pAssignPB; delete mpImpl->pDeletePB; diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 99b962fd0db1..9f0fe1d93d0f 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -250,16 +250,6 @@ _SvxMacroTabPage::_SvxMacroTabPage(Window* pParent, const OString& rID, _SvxMacroTabPage::~_SvxMacroTabPage() { - // need to delete the user data - SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); - SvTreeListEntry* pE = rListBox.GetEntry( 0 ); - while( pE ) - { - OUString* pEventName = (OUString*)pE->GetUserData(); - delete pEventName; - pE->SetUserData((void*)0); - pE = rListBox.NextSibling( pE ); - } DELETEZ( mpImpl ); } // -----------------------------------------------------------------------------