X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04e044c4d6dab8b3164479f9b2d36d5b6a7c8610..c56ae04274fda26269c6d06be34cf59a45eb70ce:/src/gtk/listbox.cpp 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