X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathMacroTemplate.cpp;h=2ac8703cb0cfa6fc4c8ebe470b7a61a266dcd165;hb=2de30c62f8d671a8c8d4d52a6a7310e2c5ca84de;hp=5c7ae707131a1095bc4d1478f67af5453e779580;hpb=b2b8733096543b80b918375cc8a0e1fa6c5fd8b8;p=lyx.git diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp index 5c7ae70713..2ac8703cb0 100644 --- a/src/mathed/MathMacroTemplate.cpp +++ b/src/mathed/MathMacroTemplate.cpp @@ -269,7 +269,7 @@ Inset * InsetMathWrapper::clone() const void InsetMathWrapper::metrics(MetricsInfo & mi, Dimension & dim) const { value_->metrics(mi, dim); - //metricsMarkers2(dim); + //metricsMarkers2(mi, dim); } @@ -544,7 +544,7 @@ void MathMacroTemplate::createLook(int args) const void MathMacroTemplate::metrics(MetricsInfo & mi, Dimension & dim) const { Changer dummy1 = mi.base.changeFontSet("mathnormal"); - Changer dummy2 = mi.base.changeStyle(LM_ST_TEXT); + Changer dummy2 = mi.base.font.changeStyle(LM_ST_TEXT); // valid macro? MacroData const * macro = 0; @@ -578,8 +578,6 @@ void MathMacroTemplate::metrics(MetricsInfo & mi, Dimension & dim) const dim.wid += 6; dim.des += 2; dim.asc += 2; - - setDimCache(mi, dim); } @@ -588,16 +586,15 @@ void MathMacroTemplate::draw(PainterInfo & pi, int x, int y) const // FIXME: Calling Changer on the same object repeatedly is inefficient. Changer dummy0 = pi.base.font.changeColor(Color_math); Changer dummy1 = pi.base.changeFontSet("mathnormal"); - Changer dummy2 = pi.base.changeStyle(LM_ST_TEXT); + Changer dummy2 = pi.base.font.changeStyle(LM_ST_TEXT); - setPosCache(pi, x, y); Dimension const dim = dimension(*pi.base.bv); // draw outer frame int const a = y - dim.asc + 1; int const w = dim.wid - 2; int const h = dim.height() - 2; - pi.pain.rectangle(x, a, w, h, Color_mathframe); + pi.pain.rectangle(x + 1, a, w, h, Color_mathframe); // just to be sure: set some dummy values for coord cache for (idx_type i = 0; i < nargs(); ++i) @@ -1172,8 +1169,7 @@ void MathMacroTemplate::read(Lexer & lex) void MathMacroTemplate::write(ostream & os) const { odocstringstream oss; - TexRow texrow(false); - otexrowstream ots(oss,texrow); + otexrowstream ots(oss); WriteStream wi(ots, false, false, WriteStream::wsDefault); oss << "FormulaMacro\n"; write(wi);