Skip to content

Commit dc20deb

Browse files
committed
Merge branch 'albert-github-feature/bug_uml_edge_fields'
2 parents 5a15f25 + 9d8f87f commit dc20deb

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/config.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3921,6 +3921,16 @@ where `loc1` and `loc2` can be relative or absolute paths or URLs.
39213921
exceeded by 50% before the limit is enforced. So when you set the threshold
39223922
to 10, up to 15 fields may appear, but if the number exceeds 15, the
39233923
total amount of fields shown is limited to 10.
3924+
]]>
3925+
</docs>
3926+
</option>
3927+
<option type='int' id='UML_MAX_EDGE_LABELS' defval='10' minval='0' maxval='100' depends='UML_LOOK'>
3928+
<docs>
3929+
<![CDATA[
3930+
If the \ref cfg_uml_look "UML_LOOK" tag is enabled, field labels are shown along
3931+
the edge between two class nodes. If there are many fields and many nodes the
3932+
graph may become too cluttered. The \c UML_MAX_EDGE_LABELS threshold limits
3933+
the number of items to make the size more manageable. Set this to 0 for no limit.
39243934
]]>
39253935
</docs>
39263936
</option>

src/dotclassgraph.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,20 @@ static QCString joinLabels(const StringSet &ss)
231231
{
232232
QCString label;
233233
int count=1;
234-
int maxLabels=10;
234+
int maxLabels = Config_getInt(UML_MAX_EDGE_LABELS);
235235
auto it = std::begin(ss), e = std::end(ss);
236236
if (it!=e) // set not empty
237237
{
238-
label += (*it++).c_str();
239-
for (; it!=e && count < maxLabels ; ++it,++count)
238+
label = *it++;
239+
for (; it!=e && (maxLabels==0 || count<maxLabels) ; ++it,++count)
240240
{
241241
label += '\n';
242-
label += (*it).c_str();
242+
label += *it;
243+
}
244+
if (maxLabels!=0 && count==maxLabels)
245+
{
246+
label+="\n...";
243247
}
244-
if (count==maxLabels) label+="\n...";
245248
}
246249
return label;
247250
}

0 commit comments

Comments
 (0)