From 1ee284dca162184e1344e19b76db5e62010c65ce Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@qt.io>
Date: Fri, 11 Oct 2019 17:25:55 +0200
Subject: [PATCH] qdoc: Remove shared comment nodes from all members page

Shared comment nodes ended up in the 'all members' list for a type.
These showed up as empty list items in those pages.

Fixes: QTBUG-79065
Change-Id: Ia9040e051ef9454b38a04c816c3d8f74302478a4
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
---
 src/qdoc/sections.cpp | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/qdoc/sections.cpp b/src/qdoc/sections.cpp
index 0aa9f37e9..e91a1014e 100644
--- a/src/qdoc/sections.cpp
+++ b/src/qdoc/sections.cpp
@@ -934,8 +934,11 @@ void Sections::buildStdCppClassRefPageSections()
         documentAll = false;
     NodeList::ConstIterator c = aggregate_->constBegin();
     while (c != aggregate_->constEnd()) {
-        Node* n = *c;
-        if (!n->isPrivate() && !n->isProperty() && !n->isRelatedNonmember())
+        Node *n = *c;
+        if (!n->isPrivate()
+            && !n->isProperty()
+            && !n->isRelatedNonmember()
+            && !n->isSharedCommentNode())
             allMembers.insert(n);
         if (!documentAll && !n->hasDoc()) {
             ++c;
@@ -961,8 +964,11 @@ void Sections::buildStdCppClassRefPageSections()
         ClassNode *cn = stack.pop();
         c = cn->constBegin();
         while (c != cn->constEnd()) {
-            Node* n = *c;
-            if (!n->isPrivate() && !n->isProperty())
+            Node *n = *c;
+            if (!n->isPrivate()
+                && !n->isProperty()
+                && !n->isRelatedNonmember()
+                && !n->isSharedCommentNode())
                 allMembers.insert(n);
             if (!documentAll && !n->hasDoc()) {
                 ++c;
@@ -1001,7 +1007,9 @@ void Sections::buildStdQmlTypeRefPageSections()
                 ++c;
                 continue;
             }
-            allMembers.add(classMap, n);
+            if (!n->isSharedCommentNode())
+                allMembers.add(classMap, n);
+
             distributeQmlNodeInSummaryVector(sv, n);
             distributeQmlNodeInDetailsVector(dv, n);
             ++c;
@@ -1026,7 +1034,7 @@ void Sections::buildStdQmlTypeRefPageSections()
         NodeList::ConstIterator c = qtn->constBegin();
         while (c != qtn->constEnd()) {
             Node *n = *c;
-            if (n->isInternal()) {
+            if (n->isInternal() || n->isSharedCommentNode()) {
                 ++c;
                 continue;
             }
-- 
GitLab