]> git.lyx.org Git - features.git/commitdiff
Compilation fix for Qt4
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 13 Jan 2022 18:34:46 +0000 (19:34 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 13 Jan 2022 18:35:12 +0000 (19:35 +0100)
src/frontends/qt/GuiFontMetrics.cpp

index 0dc0de5cb47a3eee6e88cece84bf04c1ca2015bc..d827f2f9b894adac5205ab03b134dfe6073e4a62 100644 (file)
@@ -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;