Review Request: Fix text clipping

Sebastian Sauer mail at dipe.org
Wed Jul 27 18:16:08 BST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102100/
-----------------------------------------------------------

Review request for Calligra and Casper Boemann.


Summary
-------

A while ago Hanzes tried to fix https://bugs.kde.org/show_bug.cgi?id=273177 with commit 0568afff328a7b1d1f471d8b62f5e82f559bcc93 but back then the patch had side-effects and therefore was reverted. To the bugreport I attached a ODP document that demonstrates the problem.

This patch solves the problem with the particular ODP document by also adjusting the m_blockRects if we are moving the QTextLine cause of line-spacing.

Now this isn't a 100% fix as demonstrated with the ODT I attached to the bugreport. The problem is that we still draw over text-lines if a paragraph defines a background-color what is so cause now QRect's in m_blockRects can overlap and if we are calling 

    QBrush bg = paintStrategy->background(block.blockFormat().background());
    if (bg != Qt::NoBrush) {
        painter->fillRect(br, bg);
    }

in KoTextLayoutArea_paint.cpp:203 which then draws over the content another line may have drawn before. But then the patch at least improves the situation in that we don't clip the text away any longer. For the remaining problem we would need to either allow and deal with overlapping m_blockRects during drawing or proper shrink the m_blockRects (e.g. remove margins) if they overlap till they not overlap any longer...


Diffs
-----

  libs/textlayout/KoTextLayoutArea.cpp 0fb69f3 

Diff: http://git.reviewboard.kde.org/r/102100/diff


Testing
-------


Thanks,

Sebastian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20110727/f2cae0c8/attachment.htm>


More information about the calligra-devel mailing list