[LyX/master] Fix line breaking thinko with Qt4

Jean-Marc Lasgouttes lasgouttes at lyx.org
Mon Jun 27 13:29:10 UTC 2022


commit f2f0b3022254911ab2d5d382bc78590681b09d54
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Mon Jun 27 16:09:42 2022 +0200

    Fix line breaking thinko with Qt4
    
    The test on whether to keep trailing spaces was inverted.
---
 src/frontends/qt/GuiFontMetrics.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt/GuiFontMetrics.cpp b/src/frontends/qt/GuiFontMetrics.cpp
index b3d37ca..c227c28 100644
--- a/src/frontends/qt/GuiFontMetrics.cpp
+++ b/src/frontends/qt/GuiFontMetrics.cpp
@@ -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;


More information about the lyx-cvs mailing list