From: Vadim Zeitlin Date: Thu, 21 Aug 2003 20:52:02 +0000 (+0000) Subject: no changes, just resolved conflicts (due to the fact that I had forgotten to commit... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/19c43a77ce8d061a162fdb04b0a6b1f7fbe51604?ds=sidebyside no changes, just resolved conflicts (due to the fact that I had forgotten to commit this file before) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23081 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp index 94f142fb03..3a45c336fa 100644 --- a/src/mac/carbon/notebmac.cpp +++ b/src/mac/carbon/notebmac.cpp @@ -31,7 +31,7 @@ // ---------------------------------------------------------------------------- // check that the page index is valid -#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount())) +#define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount()) // ---------------------------------------------------------------------------- @@ -296,7 +296,7 @@ int wxNotebook::GetPageImage(size_t nPage) const return m_images[nPage]; } -bool wxNotebook::SetPageImage(size_t nPage , int nImage) +bool wxNotebook::SetPageImage(size_t nPage, int nImage) { wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page") ); @@ -329,7 +329,7 @@ wxNotebookPage* wxNotebook::DoRemovePage(size_t nPage) MacSetupTabs(); - if(m_nSelection >= GetPageCount()) { + if(m_nSelection >= (int)GetPageCount()) { m_nSelection = GetPageCount() - 1; } if(m_nSelection >= 0) { @@ -357,14 +357,11 @@ bool wxNotebook::InsertPage(size_t nPage, bool bSelect, int imageId) { - wxASSERT( pPage != NULL ); - wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE ); + if ( !wxNotebookBase::InsertPage(nPage, pPage, strText, bSelect, imageId) ) + return false; pPage->SetLabel(strText); - // save the pointer to the page - m_pages.Insert(pPage, nPage); - m_images.Insert(imageId, nPage); MacSetupTabs(); @@ -375,7 +372,7 @@ bool wxNotebook::InsertPage(size_t nPage, else if ( m_nSelection == -1 ) { m_nSelection = 0; } - else if (m_nSelection >= nPage) { + else if ((size_t)m_nSelection >= nPage) { m_nSelection++; } // don't show pages by default (we'll need to adjust their size first) @@ -406,7 +403,8 @@ void wxNotebook::MacSetupTabs() wxNotebookPage *page; ControlTabInfoRec info; - for(int ii = 0; ii < GetPageCount(); ii++) + const size_t countPages = GetPageCount(); + for(size_t ii = 0; ii < countPages; ii++) { page = m_pages[ii]; info.version = 0; diff --git a/src/mac/notebmac.cpp b/src/mac/notebmac.cpp index 94f142fb03..3a45c336fa 100644 --- a/src/mac/notebmac.cpp +++ b/src/mac/notebmac.cpp @@ -31,7 +31,7 @@ // ---------------------------------------------------------------------------- // check that the page index is valid -#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount())) +#define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount()) // ---------------------------------------------------------------------------- @@ -296,7 +296,7 @@ int wxNotebook::GetPageImage(size_t nPage) const return m_images[nPage]; } -bool wxNotebook::SetPageImage(size_t nPage , int nImage) +bool wxNotebook::SetPageImage(size_t nPage, int nImage) { wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page") ); @@ -329,7 +329,7 @@ wxNotebookPage* wxNotebook::DoRemovePage(size_t nPage) MacSetupTabs(); - if(m_nSelection >= GetPageCount()) { + if(m_nSelection >= (int)GetPageCount()) { m_nSelection = GetPageCount() - 1; } if(m_nSelection >= 0) { @@ -357,14 +357,11 @@ bool wxNotebook::InsertPage(size_t nPage, bool bSelect, int imageId) { - wxASSERT( pPage != NULL ); - wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE ); + if ( !wxNotebookBase::InsertPage(nPage, pPage, strText, bSelect, imageId) ) + return false; pPage->SetLabel(strText); - // save the pointer to the page - m_pages.Insert(pPage, nPage); - m_images.Insert(imageId, nPage); MacSetupTabs(); @@ -375,7 +372,7 @@ bool wxNotebook::InsertPage(size_t nPage, else if ( m_nSelection == -1 ) { m_nSelection = 0; } - else if (m_nSelection >= nPage) { + else if ((size_t)m_nSelection >= nPage) { m_nSelection++; } // don't show pages by default (we'll need to adjust their size first) @@ -406,7 +403,8 @@ void wxNotebook::MacSetupTabs() wxNotebookPage *page; ControlTabInfoRec info; - for(int ii = 0; ii < GetPageCount(); ii++) + const size_t countPages = GetPageCount(); + for(size_t ii = 0; ii < countPages; ii++) { page = m_pages[ii]; info.version = 0;