From fbe77ceae546bdc9fc219ae01f6f0d12f37f1038 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 27 Oct 2001 22:26:14 +0000 Subject: [PATCH] fix for colspan or rowspan = 0 in HTML tables git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/m_tables.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/html/m_tables.cpp b/src/html/m_tables.cpp index a9c560ea44..b9fcc38bb2 100644 --- a/src/html/m_tables.cpp +++ b/src/html/m_tables.cpp @@ -291,7 +291,19 @@ void wxHtmlTableCell::AddCell(wxHtmlContainerCell *cell, const wxHtmlTag& tag) { tag.GetParamAsInt(wxT("COLSPAN"), &m_CellInfo[r][c].colspan); tag.GetParamAsInt(wxT("ROWSPAN"), &m_CellInfo[r][c].rowspan); - if ((m_CellInfo[r][c].colspan != 1) || (m_CellInfo[r][c].rowspan != 1)) + + // VS: the standard says this about col/rowspan: + // "This attribute specifies the number of rows spanned by the + // current cell. The default value of this attribute is one ("1"). + // The value zero ("0") means that the cell spans all rows from the + // current row to the last row of the table." All mainstream + // browsers act as if 0==1, though, and so does wxHTML. + if (m_CellInfo[r][c].colspan < 1) + m_CellInfo[r][c].colspan = 1; + if (m_CellInfo[r][c].rowspan < 1) + m_CellInfo[r][c].rowspan = 1; + + if ((m_CellInfo[r][c].colspan > 1) || (m_CellInfo[r][c].rowspan > 1)) { int i, j; @@ -335,8 +347,6 @@ void wxHtmlTableCell::AddCell(wxHtmlContainerCell *cell, const wxHtmlTag& tag) cell->SetIndent(m_Padding, wxHTML_INDENT_ALL, wxHTML_UNITS_PIXELS); } - - void wxHtmlTableCell::ComputeMinMaxWidths() { if (m_NumCols == 0 || m_ColsInfo[0].minWidth != -1) return; @@ -549,6 +559,7 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH") m_WParser->SetAlign(m_OldAlign); m_WParser->SetContainer(oldcont); m_WParser->CloseContainer(); + m_Table = oldt; return TRUE; } -- 2.45.2