#include "support/LOstream.h"
#include "debug.h"
#include "lyxlex.h"
+#include "lyxtext.h"
#include "lyxfont.h"
using std::ostream;
{
string name = mathed_parse_macro(s);
setInsetName(name);
- metrics();
+#ifdef WITH_WARNINGS
+#warning "metrics disabled"
+#endif
+ //metrics();
}
}
-void InsetFormulaMacro::write(Buffer const *, ostream & os) const
+void InsetFormulaMacro::write(Buffer const * buf, ostream & os) const
{
os << "FormulaMacro ";
- par()->write(os, false);
+ MathWriteInfo wi(buf, os, false);
+ par()->write(wi);
}
-int InsetFormulaMacro::latex(Buffer const *, ostream & os, bool fragile,
+int InsetFormulaMacro::latex(Buffer const * buf, ostream & os, bool fragile,
bool /*free_spacing*/) const
{
- par()->write(os, fragile);
+ MathWriteInfo wi(buf, os, fragile);
+ par()->write(wi);
return 2;
}
-int InsetFormulaMacro::ascii(Buffer const *, ostream & os, int) const
+
+int InsetFormulaMacro::ascii(Buffer const * buf, ostream & os, int) const
{
- par()->write(os, false);
+ MathWriteInfo wi(buf, os, false);
+ par()->write(wi);
return 0;
}
{
string name = mathed_parse_macro(lex);
setInsetName(name);
+ lyxerr << "metrics disabled";
metrics();
}
}
-int InsetFormulaMacro::width(BufferView *, LyXFont const & f) const
+int InsetFormulaMacro::width(BufferView * bv, LyXFont const & f) const
{
- metrics();
+ metrics(bv, &f);
return 10 + lyxfont::width(prefix(), f) + par()->width();
}
break;
}
- default:
+ default: {
result = InsetFormulaBase::localDispatch(bv, action, arg);
+ // force redraw if anything happened
+ if (result != UNDISPATCHED) {
+ bv->text->status(bv, LyXText::NEED_MORE_REFRESH);
+ bv->updateInset(this, false);
+ }
+ }
}
return result;
}
}
-void InsetFormulaMacro::metrics() const
-{
- par()->metrics(LM_ST_TEXT);
-}
-
-
void InsetFormulaMacro::draw(BufferView * bv, LyXFont const & f,
int baseline, float & x, bool /*cleared*/) const
{