X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finseterror.C;h=b1a879cfaa531a2959cc8b80029722a9af58f07a;hb=3c8aba3b556871fb1100a2f98cd93d5d4e3f70c9;hp=c2c873cf9082ebb3d5500e8ebc343f1d57506edc;hpb=def72111a5ac739cf8c5377a67adeee64c37e1ab;p=lyx.git diff --git a/src/insets/inseterror.C b/src/insets/inseterror.C index c2c873cf90..b1a879cfaa 100644 --- a/src/insets/inseterror.C +++ b/src/insets/inseterror.C @@ -4,7 +4,7 @@ * LyX, The Document Processor * * Copyright 1995 Matthias Ettrich - * Copyright 1995-1999 The LyX Team. + * Copyright 1995-2000 The LyX Team. * * ====================================================== */ @@ -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); } @@ -101,31 +104,18 @@ void InsetError::Read(LyXLex &) } -int InsetError::Latex(ostream &, signed char /*fragile*/) const -{ - return 0; -} - - -#ifndef USE_OSTREAM_ONLY -int InsetError::Latex(string &, signed char /*fragile*/) const -{ - return 0; -} - - -int InsetError::Linuxdoc(string &) const +int InsetError::Latex(ostream &, + bool /*fragile*/, bool /*fs*/) const { return 0; } -int InsetError::DocBook(string &) const +int InsetError::Ascii(ostream &) const { return 0; } -#else int InsetError::Linuxdoc(ostream &) const { @@ -137,7 +127,6 @@ int InsetError::DocBook(ostream &) const { return 0; } -#endif bool InsetError::AutoDelete() const @@ -146,9 +135,9 @@ bool InsetError::AutoDelete() const } -unsigned char InsetError::Editable() const +Inset::EDITABLE InsetError::Editable() const { - return 1; + return IS_EDITABLE; } @@ -170,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;