Review Request: Simplify / speed up table hit test by using qLowerBound() instead of looping

Elvis Stansvik elvstone at gmail.com
Fri Jul 22 15:27:19 BST 2011


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

Review request for Calligra and Casper Boemann.


Summary
-------

Simplify and speed up the hit test for table layout areas by using qLowerBound() instead of looping. Possible since rowPositions/columnPositions are sorted vectors. Complexity should now be O(log(N) + log(M)) instead of O(N + M) for a NxM table. There were some dead unfinished no-op code in there as well, which I've #if 0'ed out. Could Casper/Sebastian take a look what was intended with that?


Diffs
-----

  libs/textlayout/KoTextLayoutTableArea.cpp a11e24b 

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


Testing
-------

Checked that the behavior of the hit test is the same as before, i.e. that:

* Clicking left/right of table will select first/last cell in row.
* Works with merged cells.
* Works with header rows.
* Works for tables spanning multiple pages.


Thanks,

Elvis

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


More information about the calligra-devel mailing list