X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/66a77a748e5c8002f3f9ebd66f5457aca5aabad8..1d62a8b4251a2ca0d3057cef3c082d45e4e71bdd:/src/html/m_tables.cpp?ds=sidebyside diff --git a/src/html/m_tables.cpp b/src/html/m_tables.cpp index 73c1fd651e..33e24919fb 100644 --- a/src/html/m_tables.cpp +++ b/src/html/m_tables.cpp @@ -11,7 +11,7 @@ #pragma implementation #endif -#include +#include "wx/wxprec.h" #include "wx/defs.h" #if wxUSE_HTML @@ -20,7 +20,7 @@ #endif #ifndef WXPRECOMP -#include +#include "wx/wx.h" #endif @@ -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) @@ -411,8 +413,8 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH") TAG_HANDLER_CONSTR(TABLE) { m_Table = NULL; - m_tAlign = m_rAlign = wxEmptyString; - m_OldAlign = wxHTML_ALIGN_LEFT; + m_tAlign = m_rAlign = wxEmptyString; + m_OldAlign = wxHTML_ALIGN_LEFT; }