diff options
author | Thibaut Cuvelier <cuvelier.thibaut@gmail.com> | 2022-07-22 02:25:26 +0200 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2022-11-04 12:47:49 +0100 |
commit | 4ccb0dffab80e8128c5738aa453518abd8045daa (patch) | |
tree | 34acc7b6eff70ad0dbbbe1ca4644c4f44ff90bc7 /src/qdoc/xmlgenerator.cpp | |
parent | 2c71bb2979220588d46337be6d5879bbb7012eaf (diff) | |
download | qttools-4ccb0dffab80e8128c5738aa453518abd8045daa.tar.gz |
In ATOM_LIST_VALUE, don't generate two columns when only one is filled
The DocBook file is not valid in this case. HTML is not nice to see
either (like in https://doc.qt.io/qt-6/qtquickcontrols2-material.html):
a column is empty. This doesn't fix the HTML output, though.
Change-Id: I5c3c6ce4caeeabf1bea959aad4e8269204d41b60
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qdoc/xmlgenerator.cpp')
-rw-r--r-- | src/qdoc/xmlgenerator.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/qdoc/xmlgenerator.cpp b/src/qdoc/xmlgenerator.cpp index 5df638b97..ff74ce2e4 100644 --- a/src/qdoc/xmlgenerator.cpp +++ b/src/qdoc/xmlgenerator.cpp @@ -39,6 +39,27 @@ bool XmlGenerator::isThreeColumnEnumValueTable(const Atom *atom) } /*! + Determines whether the list atom should be shown with just one column (value). + */ +bool XmlGenerator::isOneColumnValueTable(const Atom *atom) +{ + if (atom->type() != Atom::ListLeft || atom->string() != ATOM_LIST_VALUE) + return false; + + while (atom && atom->type() != Atom::ListTagRight) + atom = atom->next(); + + if (atom) { + if (!matchAhead(atom, Atom::ListItemLeft)) + return false; + if (!atom->next()) + return false; + return matchAhead(atom->next(), Atom::ListItemRight); + } + return false; +} + +/*! Header offset depending on the type of the node */ int XmlGenerator::hOffset(const Node *node) |