added assert to check that notebook page does have notebook as parent; removed duplicated AddPage()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20035 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -385,15 +385,6 @@ bool wxNotebook::DeleteAllPages()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// add a page to the notebook
|
||||
bool wxNotebook::AddPage(wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect,
|
||||
int imageId)
|
||||
{
|
||||
return InsertPage(GetPageCount(), pPage, strText, bSelect, imageId);
|
||||
}
|
||||
|
||||
// same as AddPage() but does it at given position
|
||||
bool wxNotebook::InsertPage(int nPage,
|
||||
wxNotebookPage *pPage,
|
||||
@@ -405,6 +396,8 @@ bool wxNotebook::InsertPage(int nPage,
|
||||
wxCHECK_MSG( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE,
|
||||
_T("invalid index in wxNotebook::InsertPage") );
|
||||
|
||||
wxASSERT_MSG( pPage->GetParent() == this,
|
||||
_T("notebook pages must have notebook as parent") );
|
||||
|
||||
// add a new tab to the control
|
||||
// ----------------------------
|
||||
|
Reference in New Issue
Block a user