summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/qdoc/docbookgenerator.cpp10
-rw-r--r--src/qdoc/xmlgenerator.cpp21
-rw-r--r--src/qdoc/xmlgenerator.h1
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/headerfile-docbook/testheader.xml1
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml1
5 files changed, 28 insertions, 6 deletions
diff --git a/src/qdoc/docbookgenerator.cpp b/src/qdoc/docbookgenerator.cpp
index 9ef3810bc..4e429e440 100644
--- a/src/qdoc/docbookgenerator.cpp
+++ b/src/qdoc/docbookgenerator.cpp
@@ -666,19 +666,21 @@ qsizetype DocBookGenerator::generateAtom(const Atom *atom, const Node *relative)
m_threeColumnEnumValueTable = isThreeColumnEnumValueTable(atom);
if (m_threeColumnEnumValueTable && relative->nodeType() == Node::Enum) {
- // If not in \enum topic, skip the value column
+ // With three columns, if not in \enum topic, skip the value column
m_writer->writeTextElement(dbNamespace, "th", "Value");
newLine();
}
- m_writer->writeTextElement(dbNamespace, "th", "Description");
- newLine();
+ if (!isOneColumnValueTable(atom)) {
+ m_writer->writeTextElement(dbNamespace, "th", "Description");
+ newLine();
+ }
m_writer->writeEndElement(); // tr
newLine();
m_writer->writeEndElement(); // thead
newLine();
- } else {
+ } else { // No recognized list type.
m_writer->writeStartElement(dbNamespace, "orderedlist");
if (atom->next() != nullptr && atom->next()->string().toInt() > 1)
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)
diff --git a/src/qdoc/xmlgenerator.h b/src/qdoc/xmlgenerator.h
index f791185a5..5f7ba67fd 100644
--- a/src/qdoc/xmlgenerator.h
+++ b/src/qdoc/xmlgenerator.h
@@ -24,6 +24,7 @@ protected:
static bool hasBrief(const Node *node);
static bool isThreeColumnEnumValueTable(const Atom *atom);
+ static bool isOneColumnValueTable(const Atom *atom);
static int hOffset(const Node *node);
static void rewritePropertyBrief(const Atom *atom, const Node *relative);
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/headerfile-docbook/testheader.xml b/tests/auto/qdoc/generatedoutput/expected_output/headerfile-docbook/testheader.xml
index 13dbe6aab..5131d74b6 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/headerfile-docbook/testheader.xml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/headerfile-docbook/testheader.xml
@@ -41,7 +41,6 @@
<db:thead>
<db:tr>
<db:th>Constant</db:th>
-<db:th>Description</db:th>
</db:tr>
</db:thead>
<db:tr>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml
index 16caf5a24..319ec6f3e 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml
@@ -76,7 +76,6 @@
<db:thead>
<db:tr>
<db:th>Constant</db:th>
-<db:th>Description</db:th>
</db:tr>
</db:thead>
<db:tr>