Skip to content

Commit f01cfee

Browse files
committed
Flexibility of number of labels along edges in UNL_LOOK diagram
Based on https://stackoverflow.com/questions/79338813/how-to-make-doxygen-generate-full-list-of-fields-in-class-diagram making the fixed number of 10 labels along the edge of a UNL_LOOK diagram more flexible.
1 parent 791bcf8 commit f01cfee

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/config.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3921,6 +3921,18 @@ 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_LIMIT_EDGE_FIELDS' 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, fields are shown along
3931+
the edge between 2 clas nodes.
3932+
If there are many fields and many nodes the
3933+
graph may become too big to be useful. The \c UML_LIMIT_EDGE_FIELDS
3934+
threshold limits the number of items to make the size more
3935+
manageable. Set this to 0 for no limit.
39243936
]]>
39253937
</docs>
39263938
</option>

src/dotclassgraph.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,17 @@ static QCString joinLabels(const StringSet &ss)
231231
{
232232
QCString label;
233233
int count=1;
234-
int maxLabels=10;
234+
int maxLabels = Config_getInt(UML_LIMIT_EDGE_FIELDS);
235235
auto it = std::begin(ss), e = std::end(ss);
236236
if (it!=e) // set not empty
237237
{
238238
label += (*it++).c_str();
239-
for (; it!=e && count < maxLabels ; ++it,++count)
239+
for (; it!=e && (maxLabels == 0 || count < maxLabels) ; ++it,++count)
240240
{
241241
label += '\n';
242242
label += (*it).c_str();
243243
}
244-
if (count==maxLabels) label+="\n...";
244+
if (maxLabels != 0 && count==maxLabels) label+="\n...";
245245
}
246246
return label;
247247
}

0 commit comments

Comments
 (0)