X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/75f7af39d12e17eecf807ca65bffd19adce581ca..7ab0c3adb780464f2ee58f88d2443f5a79a2c401:/src/generic/grid.cpp?ds=sidebyside diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 45562e16be..068d735b61 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -3913,14 +3913,19 @@ bool wxGrid::SetTable( wxGridTableBase *table, bool takeOwnership, { if ( m_created ) { - if (m_ownTable) - delete m_table; + // stop all processing + m_created = FALSE; + + if (m_ownTable) + { + wxGridTableBase *t=m_table; + m_table=0; + delete t; + } delete m_selection; - // stop all processing m_table=0; m_selection=0; - m_created = FALSE; m_numRows=0; m_numCols=0; } @@ -9372,27 +9377,27 @@ void wxGrid::SetColSize( int col, int width ) void wxGrid::SetColMinimalWidth( int col, int width ) { if (width > GetColMinimalAcceptableWidth()) { - m_colMinWidths.Put(col, width); + m_colMinWidths[col] = width; } } void wxGrid::SetRowMinimalHeight( int row, int width ) { if (width > GetRowMinimalAcceptableHeight()) { - m_rowMinHeights.Put(row, width); + m_rowMinHeights[row] = width; } } int wxGrid::GetColMinimalWidth(int col) const { - long value = m_colMinWidths.Get(col); - return value != wxNOT_FOUND ? (int)value : m_minAcceptableColWidth; + wxLongToLongHashMap::const_iterator it = m_colMinWidths.find(col); + return it != m_colMinWidths.end() ? (int)it->second : m_minAcceptableColWidth; } int wxGrid::GetRowMinimalHeight(int row) const { - long value = m_rowMinHeights.Get(row); - return value != wxNOT_FOUND ? (int)value : m_minAcceptableRowHeight; + wxLongToLongHashMap::const_iterator it = m_rowMinHeights.find(row); + return it != m_rowMinHeights.end() ? (int)it->second : m_minAcceptableRowHeight; } void wxGrid::SetColMinimalAcceptableWidth( int width )