From f7018c42c93bd823eedece87052dbb4aa565da1c Mon Sep 17 00:00:00 2001 From: Diadlo Date: Sun, 31 Jul 2016 12:56:25 +0300 Subject: [PATCH] fix(text): Using modified text, instead of raw Fix #3568. --- src/chatlog/content/text.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/chatlog/content/text.cpp b/src/chatlog/content/text.cpp index 532a61b2f..41a485f36 100644 --- a/src/chatlog/content/text.cpp +++ b/src/chatlog/content/text.cpp @@ -243,17 +243,17 @@ void Text::regenerate() { doc->setDefaultFont(defFont); - if (!elide) + if (elide) { - doc->setDefaultStyleSheet(defStyleSheet); - doc->setHtml(text); + QFontMetrics metrics = QFontMetrics(defFont); + QString elidedText = metrics.elidedText(text, Qt::ElideRight, qRound(width)); + + doc->setPlainText(elidedText); } else { - QFontMetrics metrics = QFontMetrics(defFont); - QString elidedText = metrics.elidedText(rawText, Qt::ElideRight, - qRound(width)); - doc->setPlainText(elidedText); + doc->setDefaultStyleSheet(defStyleSheet); + doc->setHtml(text); } // wrap mode