diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-03-21 14:30:52 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-03-21 16:59:10 +0000 |
commit | 94032d89686c0b0a08df266cc07af707689dafc3 (patch) | |
tree | beb98bda05c32783d36a3ad05da4159bf67dbcba /sources/shiboken2 | |
parent | 6abcec77bce4ddbaa02984f4033b3d3b595d4723 (diff) |
QtXmlToSphinx::Table: Fix crash when having a rowspan > 1 in the last row
Limit the number of added cells to the rowcount.
Task-number: PYSIDE-363
Change-Id: I2b05ce97962d56650112b66fe99de0f5ea693abb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2')
-rw-r--r-- | sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp index 3568080df..842c68b90 100644 --- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp +++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp @@ -1141,11 +1141,12 @@ void QtXmlToSphinx::Table::normalize() if (cell.rowSpan > 0) { QtXmlToSphinx::TableCell newCell; newCell.rowSpan = -1; - int max = std::min(cell.rowSpan - 1, count()); + int targetRow = row + 1; + const int targetEndRow = + std::min(targetRow + cell.rowSpan - 1, count()); cell.rowSpan = 0; - for (int i = 0; i < max; ++i) { - self[row+i+1].insert(col, newCell); - } + for ( ; targetRow < targetEndRow; ++targetRow) + self[targetRow].insert(col, newCell); row++; } } |