summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextlayout.cpp
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2010-09-22 08:11:41 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2010-09-22 09:05:57 (GMT)
commit37b0988dcebb6a44a2e50194e78540bf4dd71bc0 (patch)
tree351adbb6d4f478b38b8b638a611f270640fa90dd /src/gui/text/qtextlayout.cpp
parent9ca64357d6ad9a2a9dd212fc5962169ed2c4bbc1 (diff)
downloadQt-37b0988dcebb6a44a2e50194e78540bf4dd71bc0.zip
Qt-37b0988dcebb6a44a2e50194e78540bf4dd71bc0.tar.gz
Qt-37b0988dcebb6a44a2e50194e78540bf4dd71bc0.tar.bz2
Keep other text format with QTextOption::SuppressColors tag on
Setting the QTextOption::SuppressColors tag on a QTextDocument breaks all text format, not just colors. This patch fix this by selectively ignoring color properties in the format and keeping other properties. Task-number: QTBUG-13090 Reviewed-by: Eskil
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r--src/gui/text/qtextlayout.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 3f83aee..fad6c3b2 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2438,8 +2438,12 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
QTextCharFormat format;
if (eng->hasFormats() || selection) {
- if (!suppressColors)
- format = eng->format(&si);
+ format = eng->format(&si);
+ if (suppressColors) {
+ format.clearForeground();
+ format.clearBackground();
+ format.clearProperty(QTextFormat::TextUnderlineColor);
+ }
if (selection)
format.merge(selection->format);