X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/01325161d50f20b8c894397a6a70f9d788576343..848bc5ba1888bfa9fcbf5719b68a155ece28d7f6:/src/html/m_tables.cpp diff --git a/src/html/m_tables.cpp b/src/html/m_tables.cpp index af88b562d9..33e24919fb 100644 --- a/src/html/m_tables.cpp +++ b/src/html/m_tables.cpp @@ -169,19 +169,21 @@ void wxHtmlTableCell::ReallocCols(int cols) void wxHtmlTableCell::ReallocRows(int rows) { m_CellInfo = (cellStruct**) realloc(m_CellInfo, sizeof(cellStruct*) * rows); - if (m_NumCols != 0) { - int x = rows - 1; - m_CellInfo[x] = (cellStruct*) malloc(sizeof(cellStruct) * m_NumCols); - for (int i = 0; i < m_NumCols; i++) - m_CellInfo[x][i].flag = cellFree; + for (int row = m_NumRows; row < rows ; row++) + { + if (m_NumCols == 0) + m_CellInfo[row] = NULL; + else + { + m_CellInfo[row] = (cellStruct*) malloc(sizeof(cellStruct) * m_NumCols); + for (int col = 0; col < m_NumCols; col++) + m_CellInfo[row][col].flag = cellFree; + } } - else - m_CellInfo[rows - 1] = NULL; m_NumRows = rows; } - void wxHtmlTableCell::AddRow(const wxHtmlTag& tag) { if (m_ActualRow + 1 > m_NumRows - 1)