Don't overwrite block formats in QSGText
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Wed, 5 Oct 2011 11:50:07 +0000 (13:50 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 5 Oct 2011 14:25:17 +0000 (16:25 +0200)
When QSGText has rich text, we need to retain the block formats
already in the document instead of overwriting them. E.g. lists
would not work because of this bug.

Change-Id: I4cdae55e2358950a330c61613b5fd41e1986dc13
Reviewed-on: http://codereview.qt-project.org/6059
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
src/declarative/items/qsgtext.cpp

index 5b72eab..8e5ef7a 100644 (file)
@@ -258,7 +258,7 @@ void QSGTextPrivate::updateLayout()
         blockFormat.setLineHeight((lineHeightMode == QSGText::FixedHeight ? lineHeight : lineHeight * 100), type);
         for (QTextBlock it = doc->begin(); it != doc->end(); it = it.next()) {
             QTextCursor cursor(it);
-            cursor.setBlockFormat(blockFormat);
+            cursor.mergeBlockFormat(blockFormat);
         }
     }