diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> | 2014-01-31 15:00:59 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-05 09:10:25 +0100 |
commit | 35579f6fe73edcc61a266ba16d25d6c97f1dd225 (patch) | |
tree | 0223933e35cae256e0a842a210ca45333bef0119 /src/gui/text | |
parent | 11189af016c1deeefed476c5cc3a408f6ee79a2d (diff) |
Support empty inline elements in block tags in QTextDocument
This fixes the following case:
<blockquote>
<span />Foobar
</blockquote>
Qt would see the end of <span>, and consider the current block
tag as closed, thus resetting the block format, thus losing the
margin set for the current block (due to blockquote).
If you do
<blockquote>
<span>Foo</span>Foobar
</blockquote>
instead, then the same would not happen, since hasBlock is set
to false when we append text to the current inline node.
[ChangeLog][QTextDocument] Add support for empty inline elements
in block tags.
Task-number: QTBUG-33336
Change-Id: Ic566edfec96cb8d44d1c02932bb195bc921d1580
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextdocumentfragment.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp index df67fb581a..3bd1e2a801 100644 --- a/src/gui/text/qtextdocumentfragment.cpp +++ b/src/gui/text/qtextdocumentfragment.cpp @@ -489,7 +489,7 @@ void QTextHtmlImporter::import() && currentNode->id != Html_unknown) { hasBlock = false; - } else if (hasBlock) { + } else if (blockTagClosed && hasBlock) { // when collapsing subsequent block tags we need to clear the block format QTextBlockFormat blockFormat = currentNode->blockFormat; blockFormat.setIndent(indent); |