diff options
author | Martin Smith <martin.smith@qt.io> | 2019-07-17 12:42:25 +0200 |
---|---|---|
committer | Martin Smith <martin.smith@qt.io> | 2019-07-17 13:32:17 +0200 |
commit | 1b9972cde24a8d8bb7f24ddbb196666456a1ce6b (patch) | |
tree | 8b18ec2343cf5d3aaff28f2725ee37ae08c0af7e | |
parent | 5ac3f3843a265a5d7dc083e3c4c48bf458022413 (diff) | |
download | qttools-1b9972cde24a8d8bb7f24ddbb196666456a1ce6b.tar.gz |
qdoc: Add hasDoc() test to findOverriddenFunction()
When qdoc finds \reimp in a function node comment, it searches the parent class
node's base classes to find the function node for the function that is overridden.
When it finds this node it prints the "Reimpliments: xxx()" line in the current
function node's documentation. But the search for the overridden function is meant
to be recursive. It was working recursively, but the search was ending prematurely
on a function node that had no documentation. In that case, the search should go
higher in the inheritance tree to find an overridden function that is documented.
This update adds the hasDoc() test to that search function to ensure that the final
matching function does have documentation.
Change-Id: Iaf6481f8b3aa98df0d0ef188912f1338316f079a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r-- | src/qdoc/node.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp index 0c4e57f6f..c664aea63 100644 --- a/src/qdoc/node.cpp +++ b/src/qdoc/node.cpp @@ -1856,7 +1856,7 @@ FunctionNode* ClassNode::findOverriddenFunction(const FunctionNode* fn) } if (cn != nullptr) { FunctionNode *result = cn->findFunctionChild(fn); - if (result != nullptr && !result->isNonvirtual()) + if (result != nullptr && !result->isNonvirtual() && result->hasDoc()) return result; result = cn->findOverriddenFunction(fn); if (result != nullptr && !result->isNonvirtual()) |