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
This commit is contained in:
Vadim Zeitlin
2011-09-29 12:29:38 +00:00
parent 423b9ba554
commit 276f3938c4

View File

@@ -671,16 +671,20 @@ wxTreeListModel::InsertItem(Node* parent,
wxScopedPtr<Node>
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