- m_strings.insert( insertPoint, item );
-#else
- size_t index = m_strings.Add( item ) ;
-#endif
- m_datas.Insert( NULL , index ) ;
- UMAInsertMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item, m_font.GetEncoding() , index );
- DoSetItemClientData( index , NULL ) ;
- m_peer->SetMaximum( GetCount() ) ;
- return index ;
-}
+#if wxUSE_STL
+ if ( IsSorted() )
+ {
+ wxArrayString::iterator
+ insertPoint = std::lower_bound( m_strings.begin(), m_strings.end(), items[i] );
+ idx = insertPoint - m_strings.begin();
+ m_strings.insert( insertPoint, items[i] );
+ }
+ else
+#endif // wxUSE_STL
+ {
+ idx = pos;
+ m_strings.Insert( items[i], idx );
+ }