X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1944ebcd065d61011e2a9187064089c3aef16aa..6ba636000f13b4bf7d3e7dcfad429713085f6700:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index d643c0ff7c..5e8559b6c4 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -1189,7 +1189,10 @@ void wxGridCellBoolEditor::BeginEdit(int row, int col, wxGrid* grid) if (grid->GetTable()->CanGetValueAs(row, col, wxGRID_VALUE_BOOL)) m_startValue = grid->GetTable()->GetValueAsBool(row, col); else - m_startValue = !!grid->GetTable()->GetValue(row, col); + { + wxString cellval( grid->GetTable()->GetValue(row, col) ); + m_startValue = !( !cellval || (cellval == "0") ); + } CBox()->SetValue(m_startValue); CBox()->SetFocus(); } @@ -1795,7 +1798,10 @@ void wxGridCellBoolRenderer::Draw(wxGrid& grid, if ( grid.GetTable()->CanGetValueAs(row, col, wxGRID_VALUE_BOOL) ) value = grid.GetTable()->GetValueAsBool(row, col); else - value = !!grid.GetTable()->GetValue(row, col); + { + wxString cellval( grid.GetTable()->GetValue(row, col) ); + value = !( !cellval || (cellval == "0") ); + } if ( value ) { @@ -3825,8 +3831,9 @@ bool wxGrid::Redimension( wxGridTableMessage& msg ) wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider(); if (attrProvider) { attrProvider->UpdateAttrRows( pos, -((int)numRows) ); -// ifdef'd out following patch from Paul Gammans -#if 0 +// ifdef'd out following patch from Paul Gammans +#if 0 + // No need to touch column attributes, unless we // removed _all_ rows, in this case, we remove // all column attributes. // I hate to do this here, but the @@ -3961,7 +3968,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg ) if (attrProvider) { attrProvider->UpdateAttrCols( pos, -((int)numCols) ); // ifdef'd out following patch from Paul Gammans -#if 0 +#if 0 // No need to touch row attributes, unless we // removed _all_ columns, in this case, we remove // all row attributes. @@ -5595,7 +5602,7 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords ) HideCellEditControl(); DisableCellEditControl(); - if ( IsVisible( m_currentCellCoords, FALSE ) ) // zzz + if ( IsVisible( m_currentCellCoords, FALSE ) ) { wxRect r; r = BlockToDeviceRect(m_currentCellCoords, m_currentCellCoords); @@ -6417,7 +6424,7 @@ void wxGrid::ShowCellEditControl() { if ( !IsVisible( m_currentCellCoords ) ) { - m_cellEditCtrlEnabled = false; + m_cellEditCtrlEnabled = FALSE; return; } else