From: Vadim Zeitlin Date: Thu, 29 Sep 2011 12:29:38 +0000 (+0000) Subject: VC6 compilation fixes for wxTreeListCtrl. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/276f3938c4ae6420a05ad2a7667fdf79261c33d6 VC6 compilation fixes for wxTreeListCtrl. For some reason comparing wxTreeListItem with its associated Type doesn't work when using VC6 ("error C2593: 'operator ==' is ambiguous") so help the compiler to do it. Also remove the unnecessary (and unsupported by VC6) return from void function. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/treelist.cpp b/src/generic/treelist.cpp index 6063ccf0a6..8672b6e611 100644 --- a/src/generic/treelist.cpp +++ b/src/generic/treelist.cpp @@ -671,16 +671,20 @@ wxTreeListModel::InsertItem(Node* parent, wxScopedPtr newItem(new Node(parent, text, imageClosed, imageOpened, data)); + // FIXME-VC6: This compiler refuses to compare "Node* previous" with + // wxTLI_XXX without some help. + const wxTreeListItem previousItem(previous); + // If we have no children at all, then inserting as last child is the same // as inserting as the first one so check for it here too. - if ( previous == wxTLI_FIRST || - (previous == wxTLI_LAST && !parent->GetChild()) ) + if ( previousItem == wxTLI_FIRST || + (previousItem == wxTLI_LAST && !parent->GetChild()) ) { parent->InsertChild(newItem.get()); } else // Not the first item, find the previous one. { - if ( previous == wxTLI_LAST ) + if ( previousItem == wxTLI_LAST ) { previous = parent->GetChild(); @@ -1148,7 +1152,7 @@ void wxTreeListCtrl::SetColumnWidth(unsigned col, int width) wxDataViewColumn* const column = m_view->GetColumn(col); wxCHECK_RET( column, "No such column?" ); - return column->SetWidth(width); + column->SetWidth(width); } int wxTreeListCtrl::GetColumnWidth(unsigned col) const