Reuse wxBookCtrlBase::DeleteAllPages() in wxNotebook

Don't duplicate the base class code unnecessarily.

No real changes.
This commit is contained in:
Vadim Zeitlin 2018-03-25 00:33:21 +01:00
parent 96f9a12898
commit 3d37b8c72a
3 changed files with 3 additions and 13 deletions

View File

@ -586,7 +586,6 @@ bool wxNotebook::DeleteAllPages()
wxASSERT_MSG( GetPageCount() == 0, wxT("all pages must have been deleted") );
InvalidateBestSize();
return wxNotebookBase::DeleteAllPages();
}

View File

@ -622,19 +622,11 @@ wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
// remove all pages
bool wxNotebook::DeleteAllPages()
{
size_t nPageCount = GetPageCount();
size_t nPage;
for ( nPage = 0; nPage < nPageCount; nPage++ )
delete m_pages[nPage];
m_pages.Clear();
wxBookCtrlBase::DeleteAllPages();
if ( !TabCtrl_DeleteAllItems(GetHwnd()) )
wxLogLastError(wxS("TabCtrl_DeleteAllItems()"));
m_selection = wxNOT_FOUND;
InvalidateBestSize();
return true;
}

View File

@ -199,11 +199,10 @@ wxNotebookPage* wxNotebook::DoRemovePage(size_t nPage)
// remove all pages
bool wxNotebook::DeleteAllPages()
{
WX_CLEAR_ARRAY(m_pages);
wxBookCtrlBase::DeleteAllPages();
m_images.clear();
MacSetupTabs();
m_selection = wxNOT_FOUND ;
InvalidateBestSize();
return true;
}