From 3a13f3f16e45288f7717dcfe3e968e5cccc05d90 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 12 Sep 2012 12:13:35 +0200 Subject: Fix regression in QTextDocument::toHtml() with font pixel size Introduced by 2e0003eda4783f69a40fb4b31e7084c761d9640d. We were missing a attributesEmitted=true which caused the output from toHtml() to sometimes be invalid when using pixel sizes to specify the font size. This is a back-port of e640ebacb97f6eea9614925b1da3b97a0ff51409 from Qt 5. Task-number: QTBUG-25778 Change-Id: Ied61fcaef425a590d71c0b52292ac676cb88ba52 Reviewed-by: Jiang Jiang --- src/gui/text/qtextdocument.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui/text') diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index a1cae54cfe..5d8ff97d80 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2187,6 +2187,7 @@ bool QTextHtmlExporter::emitCharFormatStyle(const QTextCharFormat &format) html += QLatin1String(" font-size:"); html += QString::number(format.intProperty(QTextFormat::FontPixelSize)); html += QLatin1String("px;"); + attributesEmitted = true; } if (format.hasProperty(QTextFormat::FontWeight) -- cgit v1.2.3