diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-06-20 10:40:01 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-06-20 10:46:30 +0200 |
commit | cb760eaef631abd49836ae5c8dc12a61ef5eff0d (patch) | |
tree | f0c48c2f9a6b543592c7998a5663ea11c8232376 /src/gui/text/qtextdocument.cpp | |
parent | ee77ee5c25f58271e6f2863225d08573da86c3ee (diff) |
Fix empty lines in Qt HTML when displayed in external browsers (again)
This redoes f541c78e1bc5b293466b40e6f10496199a4a5d73 in a way which
should be more compliant with different browsers. In particular,
Outlook didn't support the CSS trick in the last fix, so we need the
somewhat larger patch which adds an extra line break node to the tree
and then ignores it when re-importing the document.
Task-number: QTBUG-3669
Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 74b1c69243..b9f0b24470 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2553,7 +2553,7 @@ void QTextHtmlExporter::emitBlockAttributes(const QTextBlock &block) const bool emptyBlock = block.begin().atEnd(); if (emptyBlock) { - html += QLatin1String("-qt-paragraph-type:empty; height:1em;"); + html += QLatin1String("-qt-paragraph-type:empty;"); } emitMargins(QString::number(format.topMargin()), @@ -2709,6 +2709,8 @@ void QTextHtmlExporter::emitBlock(const QTextBlock &block) emitBlockAttributes(block); html += QLatin1Char('>'); + if (block.begin().atEnd()) + html += "<br />"; QTextBlock::Iterator it = block.begin(); if (fragmentMarkers && !it.atEnd() && block == doc->begin()) |