@@ -175,7 +175,7 @@ static void writeBoxMemberList(TextStream &t,
175175 label+=" ()" ;
176176 }
177177 }
178- t << DotNode::convertLabel (label,true );
178+ t << DotNode::convertLabel (label,DotNode::LabelStyle::List );
179179 t << br << tr_end;
180180 lineWritten = true ;
181181 count++;
@@ -193,7 +193,7 @@ static void writeBoxMemberList(TextStream &t,
193193 }
194194}
195195
196- QCString DotNode::convertLabel (const QCString &l, bool htmlLike )
196+ QCString DotNode::convertLabel (const QCString &l, LabelStyle style )
197197{
198198 QCString bBefore (" \\ _/<({[: =-+@%#~?$" ); // break before character set
199199 QCString bAfter (" >]),:;|" ); // break after character set
@@ -206,16 +206,30 @@ QCString DotNode::convertLabel(const QCString &l, bool htmlLike)
206206 int sinceLast=0 ;
207207 int foldLen = Config_getInt (DOT_WRAP_THRESHOLD); // ideal text length
208208 QCString br;
209- if (htmlLike)
209+ QCString br1;
210+ if (style==LabelStyle::Table)
211+ {
212+ result += " <<TABLE CELLBORDER=\" 0\" BORDER=\" 0\" ><TR><TD VALIGN=\" top\" ALIGN=\" LEFT\" CELLPADDING=\" 1\" CELLSPACING=\" 0\" >" ;
213+ }
214+ if (style==LabelStyle::List)
215+ {
210216 br = " <BR ALIGN=\" LEFT\" />" ;
211- else
217+ }
218+ else if (style==LabelStyle::Table)
219+ {
220+ br1 = " </TD></TR>\n <TR><TD VALIGN=\" top\" ALIGN=\" LEFT\" CELLPADDING=\" 1\" CELLSPACING=\" 0\" >" ;
221+ br = br1 + " " ;
222+ }
223+ else // style==LabelStyle::Plain
224+ {
212225 br = " \\ l" ;
226+ }
213227 while (idx < p.length ())
214228 {
215229 char c = p[idx++];
216230 char cs[2 ] = { c, 0 };
217231 const char *replacement = cs;
218- if (htmlLike )
232+ if (style!=LabelStyle::Plain )
219233 {
220234 switch (c)
221235 {
@@ -228,7 +242,7 @@ QCString DotNode::convertLabel(const QCString &l, bool htmlLike)
228242 case ' &' : replacement=" &" ; break ;
229243 }
230244 }
231- else
245+ else // style==LabelStyle::Plain
232246 {
233247 switch (c)
234248 {
@@ -246,7 +260,14 @@ QCString DotNode::convertLabel(const QCString &l, bool htmlLike)
246260 // boxes and at the same time prevent ugly breaks
247261 if (c==' \n ' )
248262 {
249- result+=replacement;
263+ if (style==LabelStyle::Table)
264+ {
265+ result+=br1;
266+ }
267+ else
268+ {
269+ result+=replacement;
270+ }
250271 foldLen = (3 *foldLen+sinceLast+2 )/4 ;
251272 sinceLast=1 ;
252273 }
@@ -280,10 +301,14 @@ QCString DotNode::convertLabel(const QCString &l, bool htmlLike)
280301 charsLeft--;
281302 pc=c;
282303 }
283- if (htmlLike )
304+ if (style==LabelStyle::List )
284305 {
285306 result = result.stripWhiteSpace ();
286307 }
308+ if (style==LabelStyle::Table)
309+ {
310+ result += " </TD></TR>\n </TABLE>>" ;
311+ }
287312 return result;
288313}
289314
@@ -422,7 +447,7 @@ void DotNode::writeLabel(TextStream &t, GraphType gt) const
422447 constexpr auto empty_line = " <TR><TD COLSPAN=\" 2\" CELLPADDING=\" 1\" CELLSPACING=\" 0\" > </TD></TR>\n " ;
423448 // printf("DotNode::writeBox for %s\n",qPrint(m_classDef->name()));
424449 t << " <<TABLE CELLBORDER=\" 0\" BORDER=\" 1\" >" ;
425- t << hr_start << convertLabel (m_label,true ) << hr_end;
450+ t << hr_start << convertLabel (m_label,LabelStyle::List ) << hr_end;
426451 auto dotUmlDetails = Config_getEnum (DOT_UML_DETAILS);
427452 if (dotUmlDetails!=DOT_UML_DETAILS_t::NONE)
428453 {
@@ -479,11 +504,11 @@ void DotNode::writeLabel(TextStream &t, GraphType gt) const
479504 else if (m_truncated == Truncated)
480505 t << " <<i>" << convertToXML (m_label) << " </i>>" ;
481506 else
482- t << ' "' << convertLabel (m_label) << ' "' ;
507+ t << ' "' << convertLabel (m_label,LabelStyle::Plain ) << ' "' ;
483508 }
484509 else // standard look
485510 {
486- t << " label=" << ' "' << convertLabel (m_label) << ' "' ;
511+ t << " label=" << ' "' << convertLabel (m_label,LabelStyle::Plain ) << ' "' ;
487512 }
488513}
489514
@@ -609,7 +634,7 @@ void DotNode::writeArrow(TextStream &t,
609634 t << " ,tooltip=\" \" " ; // space in tooltip is required otherwise still something like 'Node0 -> Node1' is used
610635 if (!ei->label ().isEmpty ())
611636 {
612- t << " ,label=\" " << convertLabel (ei->label ()) << " \" ,fontcolor=\" grey\" " ;
637+ t << " ,label=" << convertLabel (ei->label (),LabelStyle::Table ) << " ,fontcolor=\" grey\" " ;
613638 }
614639 if (Config_getBool (UML_LOOK) &&
615640 eProps->arrowStyleMap [ei->color ()] &&
0 commit comments