X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fformulamacro.C;h=da8943bacf13f298adc8d319b81fd0868df95099;hb=92d522b7f1be6046adcac062c558bbf0bf021612;hp=42f8f19755e823b5f1b3c689b02d14fabd38517c;hpb=285952e13002efe5d69a890e6e2a924b0c294808;p=lyx.git diff --git a/src/mathed/formulamacro.C b/src/mathed/formulamacro.C index 42f8f19755..da8943bacf 100644 --- a/src/mathed/formulamacro.C +++ b/src/mathed/formulamacro.C @@ -36,6 +36,8 @@ #include "lyxtext.h" #include "Lsstream.h" +using namespace lyx::support; + using std::ostream; extern MathCursor * mathcursor; @@ -62,18 +64,12 @@ InsetFormulaMacro::InsetFormulaMacro(string const & s) } -Inset * InsetFormulaMacro::clone(Buffer const &) const +Inset * InsetFormulaMacro::clone() const { return new InsetFormulaMacro(*this); } -// Inset * InsetFormulaMacro::clone(Buffer const &, bool) const -// { -// return new InsetFormulaMacro(*this); -// } - - void InsetFormulaMacro::write(Buffer const *, ostream & os) const { os << "FormulaMacro "; @@ -132,9 +128,8 @@ string InsetFormulaMacro::prefix() const } -void InsetFormulaMacro::metrics(MetricsInfo & m, Dimension & dim) const +void InsetFormulaMacro::metrics(MetricsInfo & mi, Dimension & dim) const { - MetricsInfo mi = m; par()->metrics(mi, dim_); dim_.asc += 5; dim_.des += 5; @@ -171,15 +166,9 @@ void InsetFormulaMacro::draw(PainterInfo & p, int x, int y) const pi.base.style = LM_ST_TEXT; pi.base.font = font; - Dimension dim; - MetricsInfo mi; - mi.base.bv = pi.base.bv; - mi.base.font = pi.base.font; - metrics(mi, dim); - dim_ = dim; - int const a = y - dim.asc + 1; - int const w = dim.wid - 2; - int const h = dim.height() - 2; + int const a = y - dim_.asc + 1; + int const w = dim_.wid - 2; + int const h = dim_.height() - 2; // LColor::mathbg used to be "AntiqueWhite" but is "linen" now, too pi.pain.fillRectangle(x, a, w, h, LColor::mathmacrobg);