diff options
author | corvid <corvid@lavabit.com> | 2011-06-11 22:17:53 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2011-06-11 22:17:53 +0000 |
commit | 988480437fbc89955ef4f08c283ce1f193972420 (patch) | |
tree | 73e6744c5a5ead518e29ce7eb0c68d0692e59a3b | |
parent | 437800a02d8f3b89e1bb87e2dd8018b4aa8fbd6f (diff) |
fix table leak with overlapping spans
-rw-r--r-- | dw/table.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/dw/table.cc b/dw/table.cc index 6708b3f0..8a46ce7c 100644 --- a/dw/table.cc +++ b/dw/table.cc @@ -320,11 +320,19 @@ void Table::addCell (Widget *widget, int colspan, int rowspan) for (int col = 0; col < colspanEff; col++) for (int row = 0; row < rowspan; row++) if (!(col == 0 && row == 0)) { + int i = (curRow + row) * numCols + curCol + col; + + child = children->get(i); + if (child) { + MSG("Overlapping spans in table.\n"); + assert(child->type == Child::SPAN_SPACE); + delete child; + } child = new Child (); child->type = Child::SPAN_SPACE; child->spanSpace.startCol = curCol; child->spanSpace.startRow = curRow; - children->set ((curRow + row) * numCols + curCol + col, child); + children->set (i, child); } // Set the "root" cell. |