From cc3cb095a035db0037604dca2109c927e3ba7df3 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 1 Nov 2018 16:04:41 +0100 Subject: issue_6589 anchor after test command in a namespace produces duplicate tests Not only should be checked whether the item to be inserted is the main item but also if it is not one of the extra items --- src/reflist.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/reflist.cpp b/src/reflist.cpp index e551743..dae6801 100644 --- a/src/reflist.cpp +++ b/src/reflist.cpp @@ -131,7 +131,15 @@ void RefList::insertIntoList(const char *key,RefItem *item) { if (ri!=item) { - ri->extraItems.append(item); + // We also have to check if the item is not already in the "extra" list + QListIterator li(ri->extraItems); + RefItem *extraItem; + bool doubleItem = false; + for (li.toFirst();(extraItem=li.current());++li) + { + if (item == extraItem) doubleItem = true; + } + if (!doubleItem) ri->extraItems.append(item); } } } -- cgit v0.12