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
int nCurCount = wxListBox::GetCount();
wxASSERT_MSG(pos <= nCurCount, wxT("Invalid index passed to wxListBox"));
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)
gboolean res = gtk_tree_model_iter_nth_child(
GTK_TREE_MODEL(m_liststore),
&iter, NULL, //NULL = parent = get first
gboolean res = gtk_tree_model_iter_nth_child(
GTK_TREE_MODEL(m_liststore),
&iter, NULL, //NULL = parent = get first