[LyX/master] Compilation fix for Qt4

Jean-Marc Lasgouttes lasgouttes at lyx.org
Thu Jan 13 18:05:07 UTC 2022


commit c638caddd84e281235cb9941940829d015a671aa
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Thu Jan 13 19:34:46 2022 +0100

    Compilation fix for Qt4
---
 src/frontends/qt/GuiFontMetrics.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt/GuiFontMetrics.cpp b/src/frontends/qt/GuiFontMetrics.cpp
index 0dc0de5..d827f2f 100644
--- a/src/frontends/qt/GuiFontMetrics.cpp
+++ b/src/frontends/qt/GuiFontMetrics.cpp
@@ -19,6 +19,7 @@
 
 #include "support/convert.h"
 #include "support/lassert.h"
+#include "support/lstrings.h" // for breakString_helper with qt4
 #include "support/lyxlib.h"
 #include "support/debug.h"
 
@@ -624,7 +625,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(trim(ss));
+		int const nspc_wid = i + 1 < tl.lineCount() ? wid : width(rtrim(ss));
 #endif
 		breaks.emplace_back(epos - pos, wid, nspc_wid);
 		pos = epos;


More information about the lyx-cvs mailing list