Applied patch [ 746203 ] xwGrid::SetTable may be called multiple times

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-06-01 12:51:06 +00:00
parent 12491c1f8e
commit 233a54f6af

View File

@@ -3913,16 +3913,18 @@ bool wxGrid::SetTable( wxGridTableBase *table, bool takeOwnership,
{ {
if ( m_created ) if ( m_created )
{ {
// RD: Actually, this should probably be allowed. I think it would be if (m_ownTable)
// nice to be able to switch multiple Tables in and out of a single delete m_table;
// View at runtime. Is there anything in the implementation that delete m_selection;
// would prevent this?
// At least, you now have to cope with m_selection // stop all processing
wxFAIL_MSG( wxT("wxGrid::CreateGrid or wxGrid::SetTable called more than once") ); m_table=0;
return FALSE; m_selection=0;
m_created = FALSE;
m_numRows=0;
m_numCols=0;
} }
else if (table)
{ {
m_numRows = table->GetNumberRows(); m_numRows = table->GetNumberRows();
m_numCols = table->GetNumberCols(); m_numCols = table->GetNumberCols();