When displaying a comment, an additional linebreak was inserted right
after the ";;" mark and before the first comment. This linebreak is
removed here.
}
QString BasicBlockWidget::formatComments(Instruction* inst) {
- QString comments;
+ QStringList comments;
for (Comment* c: inst->comments()) {
- comments += "<br />";
- comments += QString(c->getText().c_str()).toHtmlEscaped();
+ comments << QString(c->getText().c_str()).toHtmlEscaped();
}
- return (comments == "" ? "" : ";; ") + comments.trimmed();
+ return (comments.empty() ? "" : ";; ") + comments.join("<br />").trimmed();
}
void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem*,