]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/GuiFontMetrics.cpp
Make code a bit easier to read
[lyx.git] / src / frontends / qt / GuiFontMetrics.cpp
index b00816d912b5084d0aaf2de6ae2a4cfd35eed491..0e69ffd998d09dafeb16240ead15c8c013455a80 100644 (file)
@@ -117,7 +117,7 @@ inline QChar const ucs4_to_qchar(char_type const ucs4)
 
 
 GuiFontMetrics::GuiFontMetrics(QFont const & font)
-       : font_(font), metrics_(font, 0),
+       : font_(font), metrics_(font, 0), xheight_(metrics_.xHeight()),
          strwidth_cache_(strwidth_cache_max_cost),
          breakstr_cache_(breakstr_cache_max_cost),
          qtextlayout_cache_(qtextlayout_cache_max_size)
@@ -167,7 +167,7 @@ int GuiFontMetrics::em() const
 int GuiFontMetrics::xHeight() const
 {
 //     LATTEST(metrics_.xHeight() == ascent('x'));
-       return metrics_.xHeight();
+       return xheight_;
 }
 
 
@@ -257,7 +257,7 @@ int GuiFontMetrics::width(docstring const & s) const
                return *wid_p;
        PROFILE_CACHE_MISS(width);
        /* Several problems have to be taken into account:
-        * * QFontMetrics::width does not returns a wrong value with Qt5 with
+        * * QFontMetrics::width returns a wrong value with Qt5 with
         *   some arabic text, since the glyph-shaping operations are not
         *   done (documented in Qt5).
         * * QTextLayout is broken for single characters with null width