Switch to wxCHECK so the bad code isn't still executed if the assert

dialog is ignored.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22811 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-08-13 19:45:53 +00:00
parent e71fd398b8
commit 3e13956a1f

View File

@@ -3138,23 +3138,25 @@ int wxGridStringTable::GetNumberCols()
wxString wxGridStringTable::GetValue( int row, int col ) wxString wxGridStringTable::GetValue( int row, int col )
{ {
wxASSERT_MSG( (row < GetNumberRows()) && (col < GetNumberCols()), wxCHECK_MSG( (row < GetNumberRows()) && (col < GetNumberCols()),
_T("invalid row or column index in wxGridStringTable") ); wxEmptyString,
_T("invalid row or column index in wxGridStringTable") );
return m_data[row][col]; return m_data[row][col];
} }
void wxGridStringTable::SetValue( int row, int col, const wxString& value ) void wxGridStringTable::SetValue( int row, int col, const wxString& value )
{ {
wxASSERT_MSG( (row < GetNumberRows()) && (col < GetNumberCols()), wxCHECK_RET( (row < GetNumberRows()) && (col < GetNumberCols()),
_T("invalid row or column index in wxGridStringTable") ); _T("invalid row or column index in wxGridStringTable") );
m_data[row][col] = value; m_data[row][col] = value;
} }
bool wxGridStringTable::IsEmptyCell( int row, int col ) bool wxGridStringTable::IsEmptyCell( int row, int col )
{ {
wxASSERT_MSG( (row < GetNumberRows()) && (col < GetNumberCols()), wxCHECK_MSG( (row < GetNumberRows()) && (col < GetNumberCols()),
true,
_T("invalid row or column index in wxGridStringTable") ); _T("invalid row or column index in wxGridStringTable") );
return (m_data[row][col] == wxEmptyString); return (m_data[row][col] == wxEmptyString);
@@ -3916,21 +3918,21 @@ bool wxGrid::SetTable( wxGridTableBase *table, bool takeOwnership,
{ {
if ( m_created ) if ( m_created )
{ {
// stop all processing // stop all processing
m_created = FALSE; m_created = FALSE;
if (m_ownTable) if (m_ownTable)
{ {
wxGridTableBase *t=m_table; wxGridTableBase *t=m_table;
m_table=0; m_table=0;
delete t; delete t;
} }
delete m_selection; delete m_selection;
m_table=0; m_table=0;
m_selection=0; m_selection=0;
m_numRows=0; m_numRows=0;
m_numCols=0; m_numCols=0;
} }
if (table) if (table)
{ {
@@ -9339,13 +9341,13 @@ void wxGrid::SetColSize( int col, int width )
// should we check that it's bigger than GetColMinimalWidth(col) here? // should we check that it's bigger than GetColMinimalWidth(col) here?
// (VZ) // (VZ)
// No, because it is reasonable to assume the library user know's // No, because it is reasonable to assume the library user know's
// what he is doing. However whe should test against the weaker // what he is doing. However whe should test against the weaker
// constariant of minimalAcceptableWidth, as this breaks rendering // constariant of minimalAcceptableWidth, as this breaks rendering
// //
// This test then fixes sf.net bug #645734 // This test then fixes sf.net bug #645734
if ( width < GetColMinimalAcceptableWidth()) { return; } if ( width < GetColMinimalAcceptableWidth()) { return; }
if ( m_colWidths.IsEmpty() ) if ( m_colWidths.IsEmpty() )
{ {
// need to really create the array // need to really create the array