check the item index inside Item() itself instead of checking it inside some callers of this function

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55591 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-09-14 00:04:23 +00:00
parent 6bce2ad919
commit 99774d589d

View File

@@ -2142,13 +2142,12 @@ public:
// Delete all entries
void Clear();
size_t GetCount() const
{
return m_items.size();
}
size_t GetCount() const { return m_items.size(); }
wxPGChoiceEntry* Item( unsigned int i ) const
{
wxCHECK_MSG( i < GetCount(), NULL, "invalid index" );
return (wxPGChoiceEntry*) m_items[i];
}
@@ -2291,7 +2290,6 @@ public:
const wxString& GetLabel( size_t ind ) const
{
wxASSERT( ind >= 0 && ind < GetCount() );
return Item(ind).GetText();
}
@@ -2321,7 +2319,7 @@ public:
bool HasValues() const;
bool HasValue( unsigned int i ) const
{ return (m_data->GetCount() > i && m_data->Item(i)->HasValue()); }
{ return (i < m_data->GetCount()) && m_data->Item(i)->HasValue(); }
int Index( const wxString& str ) const;
int Index( int val ) const;