commit d4ff3a295959d27e21fb914d78505cebd96732ad
Author: Scott Kostyshak <[email protected]>
Date:   Thu Mar 19 12:20:16 2020 -0400

    Fix Qt dep warn and remove XLFD font workaround
    
    This commit fixes a few warnings from Qt 5.14 regarding
    QFont::setRawName() and QFont::rawName() like the following one:
    
      error: ‘void QFont::setRawName(const QString&)’ is deprecated 
[-Werror=deprecated-declarations]
    
    These methods were deprecated in Qt 5.3. [1]
    
    This commit removes code from 2002 (539ce478) that worked around a
    problem in Qt's handling of XLFD fonts that no longer seems relevant
    since XLFD is no longer supported in Qt 5 [2]. Even if the problem
    were relevant, setRawName() would not fix anything since it is now
    an empty method. [3]
    
    I tested that compilation with Qt 4.8.7 works without error.
    
    [1] https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.3.0/?h=v5.14.0
    [2] 
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=3a8d7b0b9a4db91415b7bda2582a59a76b3754dc
    [3] https://codereview.qt-project.org/c/qt/qtbase/+/100292/
---
 src/frontends/qt/GuiFontLoader.cpp |   20 ++------------------
 1 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/src/frontends/qt/GuiFontLoader.cpp 
b/src/frontends/qt/GuiFontLoader.cpp
index 9ea8e18..c6c0ecb 100644
--- a/src/frontends/qt/GuiFontLoader.cpp
+++ b/src/frontends/qt/GuiFontLoader.cpp
@@ -126,17 +126,6 @@ GuiFontInfo & fontinfo(FontInfo const & f)
 }
 
 
-QString rawName(QString const & family)
-{
-       for (size_t i = 0; i < nr_symbol_fonts; ++i)
-               if (family == symbol_fonts[i].family)
-                       return symbol_fonts[i].xlfd;
-
-       LYXERR(Debug::FONT, "BUG: family not found !");
-       return QString();
-}
-
-
 QString symbolFamily(FontFamily family)
 {
        for (size_t i = 0; i < nr_symbol_fonts; ++i) {
@@ -215,11 +204,8 @@ QFont symbolFont(QString const & family, bool * ok)
                return font;
        }
 
-       // A simple setFamily() fails on Qt 2
-
-       QString const raw = rawName(family);
-       LYXERR(Debug::FONT, "Trying " << raw << " ... ");
-       font.setRawName(raw);
+       LYXERR(Debug::FONT, "Trying " << family << " ... ");
+       font.setFamily(family);
 
        if (isChosenFont(font, family, QString())) {
                LYXERR(Debug::FONT, "raw version!");
@@ -359,8 +345,6 @@ QFont makeQFont(FontInfo const & f)
        else
                LYXERR(Debug::FONT, "This font is NOT an exact match");
 
-       LYXERR(Debug::FONT, "XFLD: " << font.rawName());
-
        font.setPointSizeF(f.realSize() * lyxrc.currentZoom / 100.0);
 
        LYXERR(Debug::FONT, "The font has size: " << font.pointSizeF());
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to