summaryrefslogtreecommitdiff
path: root/src/groupdef.cpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-15 10:52:33 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-15 10:52:33 +0900
commit0efe600d6f0659af7bae9047301dd60983e18a6e (patch)
tree50131a4bf60e38149cccd2a84086c675b8533e9d /src/groupdef.cpp
parentb3e03c958bd4534210bdb8d87ab0b56ada4562fb (diff)
downloaddoxygen-0efe600d6f0659af7bae9047301dd60983e18a6e.tar.gz
doxygen-0efe600d6f0659af7bae9047301dd60983e18a6e.tar.bz2
doxygen-0efe600d6f0659af7bae9047301dd60983e18a6e.zip
Imported Upstream version 1.8.10upstream/1.8.10
Diffstat (limited to 'src/groupdef.cpp')
-rw-r--r--src/groupdef.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/groupdef.cpp b/src/groupdef.cpp
index 5c08048..2d7674d 100644
--- a/src/groupdef.cpp
+++ b/src/groupdef.cpp
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2014 by Dimitri van Heesch.
+ * Copyright (C) 1997-2015 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
@@ -508,29 +508,21 @@ void GroupDef::removeMember(MemberDef *md)
}
}
-bool GroupDef::containsGroup(const GroupDef *def)
+bool GroupDef::findGroup(const GroupDef *def) const
{
if (this==def)
{
return TRUE;
}
- else if (groupList->find(def)>=0)
+ else if (groupList)
{
- return TRUE;
- }
- else // look for subgroups as well
- {
- GroupList *groups = partOfGroups();
- if (groups)
+ GroupListIterator it(*groupList);
+ GroupDef *gd;
+ for (;(gd=it.current());++it)
{
- GroupListIterator it(*groups);
- GroupDef *gd;
- for (;(gd=it.current());++it)
+ if (gd->findGroup(def))
{
- if (gd->containsGroup(def))
- {
- return TRUE;
- }
+ return TRUE;
}
}
}
@@ -1377,12 +1369,12 @@ void addGroupToGroups(Entry *root,GroupDef *subGroup)
warn(root->fileName,root->startLine,"Refusing to add group %s to itself",
gd->name().data());
}
- else if (gd->containsGroup(subGroup))
+ else if (subGroup->findGroup(gd))
{
warn(root->fileName,root->startLine,"Refusing to add group %s to group %s, since the latter is already a "
"subgroup of the former\n", subGroup->name().data(),gd->name().data());
}
- else
+ else if (!gd->findGroup(subGroup))
{
gd->addGroup(subGroup);
subGroup->makePartOfGroup(gd);