From konq-bugs Sat Oct 06 23:23:44 2007 From: Germain Garand Date: Sat, 06 Oct 2007 23:23:44 +0000 To: konq-bugs Subject: [Bug 93791] [test case] displays a table that appears to have empty Message-Id: <20071006232344.2343.qmail () ktown ! kde ! org> X-MARC-Message: https://marc.info/?l=konq-bugs&m=119171302827609 ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=93791 germain ebooksfrance com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Additional Comments From germain ebooksfrance com 2007-10-07 01:23 ------- SVN commit 722231 by ggarand: RenderTable::columns array can sometimes be out of sync after a table section removal. fix transposed from a patch by Alexey Proskuryakov M +29 -1 render_table.cpp M +2 -0 render_table.h --- trunk/KDE/kdelibs/khtml/rendering/render_table.cpp #722230:722231 @ -738,6 +738,20 @ } child = child->nextSibling(); } + + int maxCols = 0; + for (RenderObject *child = firstChild(); child; child = child->nextSibling()) { + if (child->isTableSection()) { + RenderTableSection *section = static_cast(child); + int sectionCols = section->numColumns(); + if (sectionCols > maxCols) + maxCols = sectionCols; + } + } + + columns.resize(maxCols); + columnPos.resize(maxCols+1); + needSectionRecalc = false; setNeedsLayout(true); } @ -1774,6 +1788,20 @ } } +int RenderTableSection::numColumns() const +{ + int result = 0; + + for (int r = 0; r < numRows(); ++r) { + for (int c = result; c < table()->numEffCols(); ++c) { + if (cellAt(r, c)) + result = c; + } + } + + return result + 1; +} + void RenderTableSection::recalcCells() { cCol = 0; @ -2902,7 +2930,7 @ void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& pI, int _tx, int _ty, RenderObject* bgObj) { - if (!bgObj) + if (!bgObj || style()->visibility() != VISIBLE) return; RenderTable* tableElt = table(); --- trunk/KDE/kdelibs/khtml/rendering/render_table.h #722230:722231 @ -271,6 +271,8 @ QVector grid; QVector rowPos; + int numColumns() const; + signed short cRow; ushort cCol; bool needCellRecalc; _______________________________________________ Konq-bugs mailing list Konq-bugs@mail.kde.org https://mail.kde.org/mailman/listinfo/konq-bugs