Fix wxChoice on Mac whith STL when using wxCB_SORT.
Should have done this yesterday instead of hacking a compilation fix. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33867 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
70949ed554
commit
9c707f80c0
@ -80,7 +80,6 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
m_peer->SetValueAndRange( n > 0 ? 1 : 0 , 0 , 0 ) ;
|
||||
MacPostControlCreate(pos,size) ;
|
||||
|
||||
// FIXME: STL version of wxArrayString doesn't have the same args
|
||||
#if !wxUSE_STL
|
||||
if ( style & wxCB_SORT )
|
||||
{
|
||||
@ -101,10 +100,22 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
// ----------------------------------------------------------------------------
|
||||
int wxChoice::DoAppend(const wxString& item)
|
||||
{
|
||||
// FIXME: STL version of wxArrayString doesn't have the same args
|
||||
#if wxUSE_STL
|
||||
size_t index = m_strings.size();
|
||||
m_strings.Add( item );
|
||||
wxArrayString::iterator insertPoint;
|
||||
size_t index;
|
||||
|
||||
if (GetWindowStyle() & wxCB_SORT)
|
||||
{
|
||||
insertPoint = std::lower_bound( m_strings.begin(), m_strings.end(), item );
|
||||
index = insertPoint - m_strings.begin();
|
||||
}
|
||||
else
|
||||
{
|
||||
insertPoint = m_strings.end();
|
||||
index = m_strings.size();
|
||||
}
|
||||
|
||||
m_strings.insert( insertPoint, item );
|
||||
#else
|
||||
size_t index = m_strings.Add( item ) ;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user