wxMacListCtrlItem* otherItem = (wxMacListCtrlItem*)itemTwoID;
itemOrder = item->GetOrder();
- otherItemOrder = item->GetOrder();
+ otherItemOrder = otherItem->GetOrder();
wxListCtrlCompare func = list->GetCompareFunc();
if (func != NULL)
{
+
long item1 = -1;
long item2 = -1;
if (item && item->HasColumnInfo(0))
void wxMacDataItemBrowserControl::MacInsert( unsigned int n, wxMacDataItem* item)
{
- SInt32 frontLineOrder = 0;
-
if ( m_sortOrder == SortOrder_None )
{
+
// increase the order of the lines to be shifted
unsigned int lines = MacGetCount();
for ( unsigned int i = n; i < lines; ++i)
wxMacDataItem* iter = (wxMacDataItem*) GetItemFromLine(i);
iter->SetOrder( iter->GetOrder() + 1 );
}
+
+#if 0
+ // I don't understand what this code is supposed to do, RR.
+ SInt32 frontLineOrder = 0;
if ( n > 0 )
{
wxMacDataItem* iter = (wxMacDataItem*) GetItemFromLine(n-1);
- frontLineOrder = iter->GetOrder();
+ frontLineOrder = iter->GetOrder()+1;
}
+#else
+ item->SetOrder( n );
+#endif
}
- wxArrayMacDataItemPtr ids;
- ids.SetCount( 1 );
-
- if ( m_sortOrder == SortOrder_None )
- item->SetOrder( frontLineOrder + 1 );
-
- ids[0] = item;
-
- AddItems( wxMacDataBrowserRootContainer, ids );
+ AddItem( wxMacDataBrowserRootContainer, item );
}
void wxMacDataItemBrowserControl::MacClear()