diff --git a/src/frontends/qt4/GuiFontLoader.cpp b/src/frontends/qt4/GuiFontLoader.cpp index d72f0cbab7..496c56b387 100644 --- a/src/frontends/qt4/GuiFontLoader.cpp +++ b/src/frontends/qt4/GuiFontLoader.cpp @@ -202,19 +202,17 @@ pair const getSymbolFont(string const & family) GuiFontLoader::GuiFontLoader() { #if QT_VERSION >= 0x040200 - fontID = new int[num_math_fonts]; - string const fonts_dir = addPath(package().system_support().absFilename(), "fonts"); for (int i = 0 ; i < num_math_fonts; ++i) { string const font_file = lyx::support::os::external_path( addName(fonts_dir, math_fonts[i] + ".ttf")); - fontID[i] = QFontDatabase::addApplicationFont(toqstr(font_file)); + int fontID = QFontDatabase::addApplicationFont(toqstr(font_file)); LYXERR(Debug::FONT) << "Adding font " << font_file << static_cast - (fontID[i] < 0 ? " FAIL" : " OK") + (fontID < 0 ? " FAIL" : " OK") << endl; } #endif @@ -227,19 +225,6 @@ GuiFontLoader::GuiFontLoader() } -GuiFontLoader::~GuiFontLoader() -{ -#if QT_VERSION >= 0x040200 - for (int i = 0 ; i < num_math_fonts; ++i) { - if (fontID[i] >= 0) - QFontDatabase::removeApplicationFont(fontID[i]); - } - - delete [] fontID; -#endif -} - - void GuiFontLoader::update() { for (int i1 = 0; i1 < Font::NUM_FAMILIES; ++i1) diff --git a/src/frontends/qt4/GuiFontLoader.h b/src/frontends/qt4/GuiFontLoader.h index 92c5511f93..8cd017e580 100644 --- a/src/frontends/qt4/GuiFontLoader.h +++ b/src/frontends/qt4/GuiFontLoader.h @@ -47,7 +47,7 @@ public: GuiFontLoader(); /// Destructor - ~GuiFontLoader(); + virtual ~GuiFontLoader() {} virtual void update(); virtual bool available(Font const & f); @@ -73,9 +73,6 @@ public: } private: -#if QT_VERSION >= 0x040200 - int * fontID; -#endif /// BUTT ugly ! QLFontInfo * fontinfo_[Font::NUM_FAMILIES][2][4][10]; };