]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formulamacro.C
introduce namespace lyx::support
[lyx.git] / src / mathed / formulamacro.C
index 42f8f19755e823b5f1b3c689b02d14fabd38517c..da8943bacf13f298adc8d319b81fd0868df95099 100644 (file)
@@ -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);