X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04e044c4d6dab8b3164479f9b2d36d5b6a7c8610..8d5ff32d33ad07acb9c1824368fbbe954b601bbb:/src/gtk/listbox.cpp?ds=sidebyside diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index b49029ab73..439946ad05 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -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