1
0
Fork 0

Fix a potential infinite loop when computing StructWidget layout

This commit is contained in:
Duncan Ogilvie 2024-07-07 15:19:47 +02:00
parent 6524c125c3
commit efdd2c708d
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ void RichTextItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem &
#else
int postfixWidth = metric.width(elidedPostfix);
#endif
while(doc.size().width() > option.rect.width() - postfixWidth)
while(!doc.isEmpty() && doc.size().width() > option.rect.width() - postfixWidth)
{
cursor.deletePreviousChar();
doc.adjustSize();