]> git.lyx.org Git - lyx.git/commit
Avoid row breaking at inconvenient places.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 25 Sep 2023 10:35:40 +0000 (12:35 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 25 Sep 2023 10:46:54 +0000 (12:46 +0200)
commit71d9f6e90d52d8f85c9e8b530027a9fd59c697e8
tree6ab4e373571b5184834bc7775a2a25564f8b4053
parent1ca43e1938e172e6f5a48eb353b0cb678b31f43d
Avoid row breaking at inconvenient places.

When it turns out that breaking a STRING row element was not
sufficient in Row::shortenIfNeeded, we still remember the shortest
width that one can obtain. Later, when we try to split a previous
element of the row, we have a better idea of how much of the row
remains after it.

To this end, change the signature of Element::splitAt to use an enum:
FIT (was: force=false), FORCE (was: force= true) and BEST_EFFORT
(split at max_width, but do not return an error if the string is too
large).

Fixes bug #12660.
src/Row.cpp
src/Row.h
src/TextMetrics.cpp