summaryrefslogtreecommitdiffstats
path: root/src/dotclassgraph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotclassgraph.cpp')
-rw-r--r--src/dotclassgraph.cpp61
1 files changed, 21 insertions, 40 deletions
diff --git a/src/dotclassgraph.cpp b/src/dotclassgraph.cpp
index 28967f4..84b7962 100644
--- a/src/dotclassgraph.cpp
+++ b/src/dotclassgraph.cpp
@@ -239,6 +239,25 @@ bool DotClassGraph::determineVisibleNodes(DotNode *rootNode,
// left to right order.
}
+static QCString joinLabels(const StringSet &ss)
+{
+ QCString label;
+ int count=1;
+ int maxLabels=10;
+ auto it = std::begin(ss), e = std::end(ss);
+ if (it!=e) // set not empty
+ {
+ label += (*it++).c_str();
+ for (; it!=e && count < maxLabels ; ++it,++count)
+ {
+ label += '\n';
+ label += (*it).c_str();
+ }
+ if (count==maxLabels) label+="\n...";
+ }
+ return label;
+}
+
void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int distance)
{
//printf("DocClassGraph::buildGraph(%s,distance=%d,base=%d)\n",
@@ -275,27 +294,8 @@ void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int dista
UsesClassDef *ucd;
for (;(ucd=ucdi.current());++ucdi)
{
- QCString label;
- QDictIterator<void> dvi(*ucd->accessors);
- const char *s;
- bool first=TRUE;
- int count=0;
- int maxLabels=10;
- for (;(s=dvi.currentKey()) && count<maxLabels;++dvi,++count)
- {
- if (first)
- {
- label=s;
- first=FALSE;
- }
- else
- {
- label+=QCString("\n")+s;
- }
- }
- if (count==maxLabels) label+="\n...";
//printf("addClass: %s templSpec=%s\n",ucd->classDef->name().data(),ucd->templSpecifiers.data());
- addClass(ucd->classDef,n,EdgeInfo::Purple,label,0,
+ addClass(ucd->classDef,n,EdgeInfo::Purple,joinLabels(ucd->accessors),0,
ucd->templSpecifiers,base,distance);
}
}
@@ -309,27 +309,8 @@ void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int dista
ConstraintClassDef *ccd;
for (;(ccd=ccdi.current());++ccdi)
{
- QCString label;
- QDictIterator<void> dvi(*ccd->accessors);
- const char *s;
- bool first=TRUE;
- int count=0;
- int maxLabels=10;
- for (;(s=dvi.currentKey()) && count<maxLabels;++dvi,++count)
- {
- if (first)
- {
- label=s;
- first=FALSE;
- }
- else
- {
- label+=QCString("\n")+s;
- }
- }
- if (count==maxLabels) label+="\n...";
//printf("addClass: %s templSpec=%s\n",ucd->classDef->name().data(),ucd->templSpecifiers.data());
- addClass(ccd->classDef,n,EdgeInfo::Orange2,label,0,
+ addClass(ccd->classDef,n,EdgeInfo::Orange2,joinLabels(ccd->accessors),0,
0,TRUE,distance);
}
}