X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFontInfo.C;h=a9117e6f946d7b7bb487afbfe4f9859392ea9224;hb=664eb7ff45dbb4fabc22ec0b56798031a82335b1;hp=c61d6662bb8ff680209ea98e5ecfb94ac6104245;hpb=77e706c44175f3cf71473a42d5db890c77b3b7b3;p=lyx.git diff --git a/src/FontInfo.C b/src/FontInfo.C index c61d6662bb..a9117e6f94 100644 --- a/src/FontInfo.C +++ b/src/FontInfo.C @@ -11,7 +11,6 @@ #include #include // fabs() -#include // atoi() #include FORMS_H_LOCATION @@ -27,13 +26,13 @@ using std::endl; /// Load font close to this size -string FontInfo::getFontname(int size) +string const FontInfo::getFontname(int size) { if (!exist()) return string(); int closestind = -1; - double error = 100000; + double error = 100000.0; for (int i = 0; i < matches; ++i) { if (sizes[i] == 0) { @@ -71,7 +70,7 @@ string FontInfo::getFontname(int size) /// Build newly sized font string -string FontInfo::resize(string const & font, int size) const +string const FontInfo::resize(string const & font, int size) const { string ret(font); // Find the position of the size spec @@ -117,7 +116,7 @@ void FontInfo::query() char ** list = 0; if (lyxrc.use_gui) - list = XListFonts(fl_display, pattern.c_str(), 100, &matches); + list = XListFonts(fl_get_display(), pattern.c_str(), 100, &matches); if (list == 0) { // No fonts matched @@ -129,9 +128,9 @@ void FontInfo::query() strings = new string[matches]; // We have matches. Run them through - for(int i = 0; i < matches; ++i) { + for (int i = 0; i < matches; ++i) { string name(list[i]); - sizes[i] = atoi(token(name, '-', 7).c_str()); + sizes[i] = lyx::atoi(token(name, '-', 7)); strings[i] = name; if (sizes[i] == 0) { if (scaleindex == -1) {