From d361bbff1734da4fc1728551d068fd04819c6770 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 1 Jul 2001 15:07:26 +0000 Subject: [PATCH] fixed handling of HTML tables with empty row(s) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/m_tables.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/html/m_tables.cpp b/src/html/m_tables.cpp index 27be34a21b..01d149d748 100644 --- a/src/html/m_tables.cpp +++ b/src/html/m_tables.cpp @@ -194,21 +194,35 @@ void wxHtmlTableCell::ReallocRows(int rows) void wxHtmlTableCell::AddRow(const wxHtmlTag& tag) { - if (m_ActualRow + 1 > m_NumRows - 1) - ReallocRows(m_ActualRow + 2); - m_ActualRow++; m_ActualCol = -1; + // VS: real allocation of row entry is done in AddCell in order + // to correctly handle empty rows (i.e. "") + // m_ActualCol == -1 indicates that AddCell has to allocate new row. - /* scan params: */ + // scan params: m_rBkg = m_tBkg; - if (tag.HasParam(wxT("BGCOLOR"))) tag.ScanParam(wxT("BGCOLOR"), wxT("#%lX"), &m_rBkg); - if (tag.HasParam(wxT("VALIGN"))) m_rValign = tag.GetParam(wxT("VALIGN")); else m_rValign = m_tValign; + if (tag.HasParam(wxT("BGCOLOR"))) + tag.ScanParam(wxT("BGCOLOR"), wxT("#%lX"), &m_rBkg); + if (tag.HasParam(wxT("VALIGN"))) + m_rValign = tag.GetParam(wxT("VALIGN")); + else + m_rValign = m_tValign; } void wxHtmlTableCell::AddCell(wxHtmlContainerCell *cell, const wxHtmlTag& tag) { + // Is this cell in new row? + // VS: we can't do it in AddRow, see my comment there + if (m_ActualCol == -1) + { + if (m_ActualRow + 1 > m_NumRows - 1) + ReallocRows(m_ActualRow + 2); + m_ActualRow++; + } + + // cells & columns: do { m_ActualCol++; -- 2.45.2