diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-08-20 13:15:40 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-08-21 08:26:49 +0000 |
commit | 275da7f3749d99426ad107398f6f71e9c8db16c3 (patch) | |
tree | 15226ad9643dceb75d0447dfa0428631d1d873ed /sources | |
parent | ac683793d7d0575f3f70f7b73dcaf1c29032a99b (diff) |
shiboken/doc generator: Fix crash when normalizing tables
Do not rely on row 0 to obtain the maximum number of columns,
search all instead.
Change-Id: I6ddda89c191d1823b346e9e564f31a61de523426
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp index e8f09df4a..b492ea49f 100644 --- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp +++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp @@ -1323,7 +1323,13 @@ void QtXmlToSphinx::Table::normalize() //QDoc3 generates tables with wrong number of columns. We have to //check and if necessary, merge the last columns. - int maxCols = self.at(0).count(); + int maxCols = -1; + for (const auto &row : qAsConst(self)) { + if (row.count() > maxCols) + maxCols = row.count(); + } + if (maxCols <= 0) + return; // add col spans for (row = 0; row < count(); ++row) { for (col = 0; col < at(row).count(); ++col) { |