Reset Styled/PlainText specific state when switching between formats.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Tue, 31 Jul 2012 02:54:42 +0000 (12:54 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 31 Jul 2012 03:04:45 +0000 (05:04 +0200)
Fixes markup being displayed when switching from a multilength string
to styled text and formatting of elided text when switching from
elided styled text to elided plain text.

Change-Id: Id1e1834d81cb6142d92433a8bc571e05d226b7b3
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
src/quick/items/qquicktext.cpp

index 87d389b..16cf6ac 100644 (file)
@@ -361,8 +361,11 @@ void QQuickTextPrivate::updateLayout()
                 bool fontSizeModified = false;
                 QQuickStyledText::parse(text, layout, imgTags, q->baseUrl(), qmlContext(q), !maximumLineCountValid, &fontSizeModified);
                 formatModifiesFontSize = fontSizeModified;
+                multilengthEos = -1;
             } else {
                 layout.clearAdditionalFormats();
+                if (elideLayout)
+                    elideLayout->clearAdditionalFormats();
                 QString tmp = text;
                 multilengthEos = tmp.indexOf(QLatin1Char('\x9c'));
                 if (multilengthEos != -1) {