]> git.lyx.org Git - features.git/commit
Remember the last used QTextLayout object
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 7 Dec 2015 09:32:34 +0000 (10:32 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 9 Dec 2015 10:57:52 +0000 (11:57 +0100)
commitf3cdf74e68bd44074ed985106361552161efde2c
tree2d10c217bdc4f65998a4acc444d33a3b9e962e34
parentd42bd065948c2c4b16535f6f6c96a2469efbdd89
Remember the last used QTextLayout object

This crude caching mecanism is useful in the particular case of a screen with many misspelling dotted lines. In this case, it is necessary to build a QTextLayout in order to know where to put the start/end of the spell line. Since rows typically contains text snippets longer than a word, we may be in a situation where the same QTextLayout is constructed repeatedly.

This commit is useful in this particular use case, and should not be costly in other cases. A better fix would be to remember the QTextLayout associated to each row element. This is a bit more work, so this fix should be sufficient for now.

Additionally, do not paint misspelled marks when painting is disabled.

Fixes bug #9890.
src/RowPainter.cpp
src/frontends/qt4/GuiFontMetrics.cpp