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

Stephen Kelly steveire at
Sat Nov 8 14:16:11 GMT 2008

Stephen Kelly wrote:

> Hi,
> I have patched this bug:
> The simple way to reproduce is to use demos/textedit to open a file
> containing
> <p>Foo</p>
> <br />
> <p>Bar</p>
> 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
> breaks:
> (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
> testImportWithHorizontalTraversal.
> This has also been sent to qt-bugs.

FYI I have updated the patch an added another unit test and sent it to qt
bugs to handle the case of br elements inside p elements.

Any comment on the patch?


> Best regards,
> Steve.

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

More information about the kde-core-devel mailing list