X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finseterror.C;h=b1a879cfaa531a2959cc8b80029722a9af58f07a;hb=3c8aba3b556871fb1100a2f98cd93d5d4e3f70c9;hp=ff1a09a306bca063b449333c8798331c01331016;hpb=85798535a19919e82cc94a177a8414c542a9c5bf;p=lyx.git diff --git a/src/insets/inseterror.C b/src/insets/inseterror.C index ff1a09a306..b1a879cfaa 100644 --- a/src/insets/inseterror.C +++ b/src/insets/inseterror.C @@ -18,6 +18,9 @@ #include "gettext.h" #include "lyx_gui_misc.h" // CancelCloseBoxCB #include "Painter.h" +#include "font.h" + +using std::ostream; /* Error, used for the LaTeX-Error Messages */ @@ -48,7 +51,7 @@ int InsetError::ascent(Painter &, LyXFont const & font) const { LyXFont efont; efont.setSize(font.size()).decSize(); - return efont.maxAscent() + 1; + return lyxfont::maxAscent(efont) + 1; } @@ -56,7 +59,7 @@ int InsetError::descent(Painter &, LyXFont const & font) const { LyXFont efont; efont.setSize(font.size()).decSize(); - return efont.maxDescent() + 1; + return lyxfont::maxDescent(efont) + 1; } @@ -64,7 +67,7 @@ int InsetError::width(Painter &, LyXFont const & font) const { LyXFont efont; efont.setSize(font.size()).decSize(); - return 6 + efont.textWidth(_("Error"), strlen(_("Error"))); + return 6 + lyxfont::width(_("Error"), efont); } @@ -102,7 +105,13 @@ void InsetError::Read(LyXLex &) int InsetError::Latex(ostream &, - signed char /*fragile*/, bool /*fs*/) const + bool /*fragile*/, bool /*fs*/) const +{ + return 0; +} + + +int InsetError::Ascii(ostream &) const { return 0; } @@ -150,6 +159,12 @@ extern "C" void C_InsetError_CloseErrorCB(FL_OBJECT * ob, long data) } +char const * InsetError::EditMessage() const +{ + return _("Opened error"); +} + + void InsetError::Edit(BufferView *, int, int, unsigned int) { static int ow = 400, oh = 240;