From: Eskil Abrahamsen Blomfeldt Date: Wed, 5 Oct 2011 11:50:07 +0000 (+0200) Subject: Don't overwrite block formats in QSGText X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=1c9e8db29e883328f78cd9ab668b066fddc54525;p=konrad%2Fqtdeclarative.git Don't overwrite block formats in QSGText 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 Reviewed-by: Jiang Jiang --- diff --git a/src/declarative/items/qsgtext.cpp b/src/declarative/items/qsgtext.cpp index 5b72eab..8e5ef7a 100644 --- a/src/declarative/items/qsgtext.cpp +++ b/src/declarative/items/qsgtext.cpp @@ -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); } }