New qt patch. Can it go into qt-copy?

Stephen Kelly steveire at
Thu Nov 6 20:13:46 GMT 2008


I have patched this bug:

The simple way to reproduce is to use demos/textedit to open a file

<br />

and it seems that you get two empty blocks between foo and bar instead of
just one. In fact, there is only one block between them, but it 
contains a QChar::LineSeparator, so you get a newline for that *and* a
newline at the end of the block.

It causes issues with kmail sending/saving with the wrong number of line
(I think kmail already has some workarounds, they don't seem to work well.)

If you use a textedit to create an empty, line qt outputs <p
style="-qt-paragraph-type:empty;" ></p> instead of <br />. That style gets
special treatment from qt so that when imported again, the correct number
of linebreaks appear in the QTextEdit.

My patch changes QTextHtmlParser to change a br element into an empty
paragraph node before insertion into the QTextEdit.

The unit test fails before patching and passes after patching. However, as
we don't have any other unit tests for html import, I don't know if it
causes any regressions. So, please comment if you think I can put it in to
qt-copy. The unit test has been added to kdereview/richtextbuilders as

This has also been sent to qt-bugs.

Best regards,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug227495.patch
Type: text/x-diff
Size: 1432 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug227495unittest.cpp
Type: text/x-objcsrc
Size: 638 bytes
Desc: not available
URL: <>

More information about the kde-core-devel mailing list