KoTextFormatter patch: CustomItems that are smaller than their line

David Faure david at mandrakesoft.com
Sat May 18 20:55:48 BST 2002


On Saturday 18 May 2002 21:09, Ulrich Kuettler wrote:
> 
> Hi,
> 
> attached you'll find a small patch to kotext that I wasn't confident enough to 
> apply without approval. It enables kword to contain CustomItems (formula 
> frames) that are smaller that the line they are in but still are aligned at 
> the base line. Please see the kword document for an example.

Looks good, well done for figuring this out.

I have committed a slightly modified version, which sets customItemOffY also
in the "char is breakable" code. Can't be triggered right now, but could be if
we change the customitem char back to a space again.
For security I also reset customItemOffY after use, to avoid using an older
value by mistake. The first if() block (line 198) can continue to the ->move() code
if we're breaking at the current char because no space exists in the line at all.
I think the value of customItemOffY will be correct in that case, but this should
be tested (try a line with no space, just letters, and a formula at the end).

BTW: I think koffice-devel is more appropriate, only kotext is concerned ;)
(Qt's QRichText doesn't even have this belowBaseline code, although I sent
a patch long ago IIRC, but that's not relevant to -core-devel anyway).

-- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
KDE, Making The Future of Computing Available Today





More information about the kde-core-devel mailing list