]> git.lyx.org Git - lyx.git/commitdiff
Fix line breaking thinko with Qt4
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 27 Jun 2022 14:09:42 +0000 (16:09 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 27 Jun 2022 14:12:02 +0000 (16:12 +0200)
The test on whether to keep trailing spaces was inverted.

src/frontends/qt/GuiFontMetrics.cpp

index b3d37caaf153336e3ac5f23b1a4838f36d927bbd..c227c28d2528fab293579be1f47729a4b68bcdc7 100644 (file)
@@ -603,7 +603,7 @@ GuiFontMetrics::breakString_helper(docstring const & s, int first_wid, int wid,
                // FIXME: this is slower than it could be but we'll get rid of Qt4 anyway
                docstring const ss = s.substr(pos, epos - pos);
                int const wid = width(ss);
-               int const nspc_wid = i + 1 < tl.lineCount() ? wid : width(rtrim(ss));
+               int const nspc_wid = i + 1 < tl.lineCount() ? width(rtrim(ss)) : wid;
 #endif
                breaks.emplace_back(epos - pos, wid, nspc_wid);
                pos = epos;