]> git.saurik.com Git - wxWidgets.git/commitdiff
Apply patch #1443819 from Paul Cornett - move the GtkTreeIter to the outer scope...
authorMart Raudsepp <leio@gentoo.org>
Tue, 7 Mar 2006 06:55:26 +0000 (06:55 +0000)
committerMart Raudsepp <leio@gentoo.org>
Tue, 7 Mar 2006 06:55:26 +0000 (06:55 +0000)
auto variable to an outer scope variable (now both are in the outer (function) scope).

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

src/gtk/listbox.cpp

index b49029ab73c4359fe9e24848612cd04f24d2220a..439946ad050d0aed579ee2bf5563dcd8c479f48b 100644 (file)
@@ -615,14 +615,10 @@ void wxListBox::GtkInsertItems(const wxArrayString& items,
     int nCurCount = wxListBox::GetCount();
     wxASSERT_MSG(pos <= nCurCount, wxT("Invalid index passed to wxListBox"));
 
-    GtkTreeIter* pIter;
-    if (pos == nCurCount)
-    {
-        pIter = NULL; // append
-    }
-    else
+    GtkTreeIter* pIter = NULL; // append by default
+    GtkTreeIter iter;
+    if (pos != nCurCount)
     {
-        GtkTreeIter iter;
         gboolean res = gtk_tree_model_iter_nth_child(
                         GTK_TREE_MODEL(m_liststore),
                         &iter, NULL, //NULL = parent = get first