InsetFormula::InsetFormula(string const & s)
- : InsetFormulaBase(0)
+ : InsetFormulaBase(mathed_parse(s))
{
- istringstream is(s.c_str());
- par(mathed_parse(is));
Metrics();
}
mathcursor->GetPos(x, y);
mathcursor->breakLine();
mathcursor->normalize();
- updateLocal(bv);
+ updateLocal(bv, true);
break;
case LFUN_MATH_NUMBER:
for (int row = 0; row < par()->nrows(); ++row)
par()->numbered(row, !old);
bv->owner()->message(old ? _("No number") : _("Number"));
- updateLocal(bv);
+ updateLocal(bv, true);
}
break;
}
bool old = par()->numbered(row);
bv->owner()->message(old ? _("No number") : _("Number"));
par()->numbered(row, !old);
- updateLocal(bv);
+ updateLocal(bv, true);
}
break;
}
par()->label(row, new_label);
- updateLocal(bv);
+ updateLocal(bv, true);
break;
}
case LFUN_MATH_EXTERN:
bv->lockedInsetStoreUndo(Undo::EDIT);
handleExtern(arg, bv);
- updateLocal(bv);
+ updateLocal(bv, true);
break;
case LFUN_MATH_MUTATE:
par()->mutate(arg);
mathcursor->SetPos(x, y);
mathcursor->normalize();
- updateLocal(bv);
+ updateLocal(bv, true);
break;
}
par()->mutate(LM_OT_SIMPLE);
mathcursor->SetPos(x, y);
mathcursor->normalize();
- updateLocal(bv);
+ updateLocal(bv, true);
break;
}
par()->Validate(features);
}
+bool InsetFormula::insetAllowed(Inset::Code code) const
+{
+ return code == Inset::LABEL_CODE;
+}
+
int InsetFormula::ascent(BufferView *, LyXFont const &) const
{
int InsetFormula::width(BufferView *, LyXFont const &) const
{
Metrics();
- return par()->width() + 2;
+ return par()->width();
}