X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FPainter.C;h=6c0b271bfe2d82aaea56d72b67bca0e12ecbab7c;hb=00d24ec87650e4ac7db77ad54cb4aa2f688100f3;hp=99f3aa442af16ab5acd1a2a1f092b6369d0a9832;hpb=313252eb8bafdba6d934786fd89c988902a0b4d7;p=lyx.git diff --git a/src/Painter.C b/src/Painter.C index 99f3aa442a..6c0b271bfe 100644 --- a/src/Painter.C +++ b/src/Painter.C @@ -1,4 +1,3 @@ -// -*- C++ -*- /* This file is part of * ====================================================== * @@ -20,11 +19,11 @@ #include -#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" @@ -42,7 +41,7 @@ using std::max; Painter::Painter(WorkArea & wa) : PainterBase(wa) { - display = fl_get_display(); + display = GUIRunTime::x11Display(); } @@ -56,7 +55,7 @@ PainterBase & Painter::point(int x, int y, LColor::color c) if (!Lgb_bug_find_hack) lyxerr << "point not called from " "workarea::workhandler\n"; - lyxerr.debug() << "Painter drawable: " + lyxerr[Debug::INFO] << "Painter drawable: " << owner.getPixmap() << endl; } @@ -75,7 +74,7 @@ PainterBase & Painter::line(int x1, int y1, int x2, int y2, if (!Lgb_bug_find_hack) lyxerr << "line not called from " "workarea::workhandler\n"; - lyxerr.debug() << "Painter drawable: " + lyxerr[Debug::INFO] << "Painter drawable: " << owner.getPixmap() << endl; } @@ -95,7 +94,7 @@ PainterBase & Painter::lines(int const * xp, int const * yp, int np, if (!Lgb_bug_find_hack) lyxerr << "lines not called from " "workarea::workhandler\n"; - lyxerr.debug() << "Painter drawable: " + lyxerr[Debug::INFO] << "Painter drawable: " << owner.getPixmap() << endl; } @@ -267,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); } @@ -333,8 +332,11 @@ PainterBase & Painter::text(int x, int y, char const * s, size_t ls, } } } - if (f.underbar() == LyXFont::ON && f.latex() != LyXFont::ON) + + if (f.underbar() == LyXFont::ON) { underline(f, x, y, lyxfont::width(s, ls, f)); + } + return *this; } @@ -372,8 +374,11 @@ PainterBase & Painter::text(int x, int y, XChar2b const * s, int ls, } } } - if (f.underbar() == LyXFont::ON && f.latex() != LyXFont::ON) + + if (f.underbar() == LyXFont::ON) { underline(f, x, y, lyxfont::width(s, ls, f)); + } + return *this; }