From efa14cf20a6fb94b2d3099cb1b884a2c3d8c2b8f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 6 Apr 2003 17:46:48 +0000 Subject: [PATCH] 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 --- include/wx/msw/notebook.h | 7 +------ src/msw/notebook.cpp | 11 ++--------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/include/wx/msw/notebook.h b/include/wx/msw/notebook.h index 14ae37fb0e..b6941fe64e 100644 --- a/include/wx/msw/notebook.h +++ b/include/wx/msw/notebook.h @@ -91,13 +91,8 @@ public: // ---------- // remove all pages bool DeleteAllPages(); - // adds a new page to the notebook (it will be deleted ny the notebook, + // inserts a new page to the notebook (it will be deleted ny the notebook, // don't delete it yourself). If bSelect, this page becomes active. - bool AddPage(wxNotebookPage *pPage, - const wxString& strText, - bool bSelect = FALSE, - int imageId = -1); - // the same as AddPage(), but adds it at the specified position bool InsertPage(int nPage, wxNotebookPage *pPage, const wxString& strText, diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 84c156cb33..05b4f2c0b5 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -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 // ---------------------------- -- 2.47.2