From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Sun, 11 Sep 2005 11:55:48 +0000 (+0000)
Subject: use given position for page insertion instead of trying to find the page to insert... 
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1c36a9d33598620bab2b8c90aa7f73ebd8dc7eed

use given position for page insertion instead of trying to find the page to insert before (bug 1287730)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35467 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp
index c1c1a2d9d3..6b0b569e00 100644
--- a/src/gtk/notebook.cpp
+++ b/src/gtk/notebook.cpp
@@ -654,7 +654,7 @@ bool wxNotebook::InsertPage( size_t position,
     if ( position == GetPageCount() )
         m_pagesData.Append( nb_page );
     else
-        m_pagesData.Insert( m_pagesData.Item( position ), nb_page );
+        m_pagesData.Insert( position, nb_page );
 
     m_pages.Insert(win, position);
 
diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp
index c1c1a2d9d3..6b0b569e00 100644
--- a/src/gtk1/notebook.cpp
+++ b/src/gtk1/notebook.cpp
@@ -654,7 +654,7 @@ bool wxNotebook::InsertPage( size_t position,
     if ( position == GetPageCount() )
         m_pagesData.Append( nb_page );
     else
-        m_pagesData.Insert( m_pagesData.Item( position ), nb_page );
+        m_pagesData.Insert( position, nb_page );
 
     m_pages.Insert(win, position);