]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathMacroTemplate.cpp
Remove hardcoded values
[lyx.git] / src / mathed / MathMacroTemplate.cpp
index 31250e29df547156c91d650e72659e832fe95ad9..2ac8703cb0cfa6fc4c8ebe470b7a61a266dcd165 100644 (file)
@@ -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,7 +1169,7 @@ void MathMacroTemplate::read(Lexer & lex)
 void MathMacroTemplate::write(ostream & os) const
 {
        odocstringstream oss;
-       otexrowstream ots(oss, false);
+       otexrowstream ots(oss);
        WriteStream wi(ots, false, false, WriteStream::wsDefault);
        oss << "FormulaMacro\n";
        write(wi);