X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..bb69632a56a827bed4cfae842bfffa88259ac1aa:/src/osx/carbon/utils.cpp diff --git a/src/osx/carbon/utils.cpp b/src/osx/carbon/utils.cpp index 7030447039..1a5c28d144 100644 --- a/src/osx/carbon/utils.cpp +++ b/src/osx/carbon/utils.cpp @@ -62,7 +62,7 @@ void wxBell() else #endif #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 - SysBeep(30); + AlertSoundPlay(); #else { } @@ -679,11 +679,10 @@ bool wxMacDataItem::IsLessThan(wxMacDataItemBrowserControl *WXUNUSED(owner) , const wxMacDataItem* rhs, DataBrowserPropertyID sortProperty) const { - const wxMacDataItem* otherItem = wx_const_cast(wxMacDataItem*,rhs); bool retval = false; if ( sortProperty == kNumericOrderColumnId ) - retval = m_order < otherItem->m_order; + retval = m_order < rhs->m_order; return retval; } @@ -1038,10 +1037,9 @@ void wxMacDataItemBrowserControl::MacDelete( unsigned int n ) 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) @@ -1049,22 +1047,21 @@ void wxMacDataItemBrowserControl::MacInsert( unsigned int n, wxMacDataItem* item 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()