]> git.lyx.org Git - lyx.git/blobdiff - src/FontInfo.C
Dekels tabular/textinset patches
[lyx.git] / src / FontInfo.C
index 1ccb10816fa43395193a6edd6ea7d85bff603117..a9117e6f946d7b7bb487afbfe4f9859392ea9224 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <config.h>
 #include <cmath>       // fabs()
-#include <cstdlib>     // atoi()
 
 #include FORMS_H_LOCATION
 
@@ -33,7 +32,7 @@ string const FontInfo::getFontname(int size)
                return string();
 
        int closestind = -1;
-       double error = 100000;
+       double error = 100000.0;
 
        for (int i = 0; i < matches; ++i) {
                if (sizes[i] == 0) {
@@ -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) {