]> git.lyx.org Git - lyx.git/commit
Break multi-row strings in one pass
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 6 Sep 2021 12:52:42 +0000 (14:52 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 7 Dec 2021 16:04:47 +0000 (17:04 +0100)
commitd723b90344c0e56b26fc69aa00cb3001e074a723
treee7fdf89c86af5d25d67c11a88e2c00eeeab09a6c
parent71c2e2fda6f241a63c1a67569db5f7fbae6fe4a9
Break multi-row strings in one pass

Replace FontMetrics::breakAt, which returned the next break point,
with FontMetrics::breakString, which returns a vector of break points.
To this end, an additional parameter gives the available width for
next rows.

Rename various variables and methods accordingly. Factor the code in
breakString_helper to be more manageable.

Adapt Row::Element::splitAt to return a bool on sucess and provide
remaining row elements in a vector. The width noted above has been
added as parameters.

Rename the helper function splitFrom to moveElements and rewrite the
code to be more efficient.

Remove type of row element INVALID, which is not needed anymore.

The code in TextMetrics::breakParagraph is now much simpler.

In Row::finalize, remove the code that computed inconditionnally the
current element size, and make sure that this width will be computed
in all code paths of Row::Element::splitAt.
src/Row.cpp
src/Row.h
src/RowPainter.cpp
src/TextMetrics.cpp
src/frontends/FontMetrics.h
src/frontends/qt/GuiFontMetrics.cpp
src/frontends/qt/GuiFontMetrics.h