]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/FontMetrics.h
Fix up 'Reduce metrics updates from 4 to 1 when loading file'
[lyx.git] / src / frontends / FontMetrics.h
index b78bc2dbcd083c6c62443133173bf7b3c5809e5e..c9a1d86cda4112a58a52a27e1ef24b504884f2b5 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef FONT_METRICS_H
 #define FONT_METRICS_H
 
+
+#include "support/mute_warning.h"
 #include "support/strfwd.h"
 
 #include <vector>
@@ -126,9 +128,14 @@ public:
 
        // The places where to break a string and the width of the resulting lines.
        struct Break {
-               Break(int l, int w) : len(l), wid(w) {}
+               Break(int l, int w, int nsw) : len(l), wid(w), nspc_wid(nsw) {}
+               // Number of characters
                int len = 0;
+               // text width
                int wid = 0;
+               // text width when trailing spaces are removed; only makes a
+               // difference for the last break.
+               int nspc_wid = 0;
        };
        typedef std::vector<Break> Breaks;
        /**
@@ -163,10 +170,6 @@ public:
                int & width,
                int & ascent,
                int & descent) const = 0;
-
-       /// return the number of expanding characters taken into account for
-       /// increased inter-word spacing during justification
-       virtual int countExpanders(docstring const & str) const = 0;
 };
 
 
@@ -176,8 +179,12 @@ class Font;
 class FontInfo;
 
 /// Implementation is in Application.cpp
+
+LYX_BEGIN_MUTE_GCC_WARNING(dangling-reference)
 frontend::FontMetrics const & theFontMetrics(Font const & f);
 frontend::FontMetrics const & theFontMetrics(FontInfo const & fi);
+LYX_END_MUTE_GCC_WARNING
+
 
 } // namespace lyx