]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiFontLoader.C
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / GuiFontLoader.C
index 3f9fe409c9a37e790ed5e66929c7e176cf1bd91e..e75bbad8490eddc3ed7a2aa976ee8ddcac5845c1 100644 (file)
@@ -289,12 +289,9 @@ QLFontInfo::QLFontInfo(LyXFont const & f)
        metrics = QFontMetrics(font);
 }
 
-
+#ifdef USE_LYX_FONTCACHE
 int QLFontInfo::width(Uchar val)
 {
-// Starting with version 3.1.0, Qt/X11 does its own caching of
-// character width, so it is not necessary to provide ours.
-#if defined (USE_LYX_FONTCACHE)
        QLFontInfo::WidthCache::const_iterator cit = widthcache.find(val);
        if (cit != widthcache.end())
                return cit->second;
@@ -302,10 +299,8 @@ int QLFontInfo::width(Uchar val)
        int const w = metrics.width(QChar(val));
        widthcache[val] = w;
        return w;
-#else
-       return metrics.width(QChar(val));
-#endif
 }
+#endif
 
 
 bool GuiFontLoader::available(LyXFont const & f)