]> git.lyx.org Git - lyx.git/blobdiff - src/Painter.C
Herbert's patch, part 1
[lyx.git] / src / Painter.C
index 7b4f1160fa6dc85076b30406ada1b5a5aa0362da..6c0b271bfe2d82aaea56d72b67bca0e12ecbab7c 100644 (file)
 
 #include <cmath>
 
-#include FORMS_H_LOCATION
 #include "Painter.h"
 #include "LString.h"
 #include "debug.h"
 #include "lyxfont.h"
+#include "frontends/GUIRunTime.h"
 #include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "WorkArea.h"
@@ -41,7 +41,7 @@ using std::max;
 Painter::Painter(WorkArea & wa)
        : PainterBase(wa)
 {
-       display = fl_get_display();
+       display = GUIRunTime::x11Display();
 }
 
 
@@ -266,7 +266,7 @@ PainterBase & Painter::image(int x, int y, int w, int h, LyXImage const * image)
 
 PainterBase & Painter::text(int x, int y, string const & s, LyXFont const & f)
 {
-       return text(x, y, s.c_str(), s.length(), f);
+       return text(x, y, s.data(), s.length(), f);
 }
 
 
@@ -332,12 +332,11 @@ PainterBase & Painter::text(int x, int y, char const * s, size_t ls,
                        }
                }
        }
-       if (f.underbar() == LyXFont::ON
-#ifndef NO_LATEX
-           && f.latex() != LyXFont::ON
-#endif
-               )
+
+       if (f.underbar() == LyXFont::ON) {
                underline(f, x, y, lyxfont::width(s, ls, f));
+       }
+       
        return *this;
 }
 
@@ -375,12 +374,11 @@ PainterBase & Painter::text(int x, int y, XChar2b const * s, int ls,
                        }
                }
        }
-       if (f.underbar() == LyXFont::ON
-#ifndef NO_LATEX
-           && f.latex() != LyXFont::ON
-#endif
-               )
+       
+       if (f.underbar() == LyXFont::ON) {
                underline(f, x, y, lyxfont::width(s, ls, f));
+       }
+       
        return *this;
 }