bool wxRichTextTable::DeleteRows(int startRow, int noRows)
{
- wxASSERT((startRow + noRows) < m_rowCount);
- if ((startRow + noRows) >= m_rowCount)
+ wxASSERT((startRow + noRows) <= m_rowCount);
+ if ((startRow + noRows) > m_rowCount)
return false;
int i, j;
bool wxRichTextTable::DeleteColumns(int startCol, int noCols)
{
- wxASSERT((startCol + noCols) < m_colCount);
- if ((startCol + noCols) >= m_colCount)
+ wxASSERT((startCol + noCols) <= m_colCount);
+ if ((startCol + noCols) > m_colCount)
return false;
bool deleteRows = (noCols == m_colCount);
for (i = 0; i < m_rowCount; i++)
{
wxRichTextObjectPtrArray& colArray = m_cells[deleteRows ? 0 : i];
- for (j = startCol; j < (startCol+noCols); j++)
+ for (j = 0; j < noCols; j++)
{
- wxRichTextObject* cell = colArray[j];
+ wxRichTextObject* cell = colArray[startCol];
RemoveChild(cell, true);
+ colArray.RemoveAt(startCol);
}
if (deleteRows)