]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathMacroTemplate.cpp
* the old cursor is stored before dispatch and then used after moving
[lyx.git] / src / mathed / MathMacroTemplate.cpp
index 5650b4012fff701a61af964c3b079cbff10e8bb5..e6e439163bf92d7aef97763e76ef97fb95bdb26c 100644 (file)
@@ -15,6 +15,7 @@
 #include "MathParser.h"
 #include "MathSupport.h"
 
+#include "Buffer.h"
 #include "Cursor.h"
 #include "debug.h"
 #include "gettext.h"
@@ -72,9 +73,9 @@ MathMacroTemplate::MathMacroTemplate(docstring const & str)
 }
 
 
-auto_ptr<InsetBase> MathMacroTemplate::doClone() const
+auto_ptr<Inset> MathMacroTemplate::doClone() const
 {
-       return auto_ptr<InsetBase>(new MathMacroTemplate(*this));
+       return auto_ptr<Inset>(new MathMacroTemplate(*this));
 }
 
 
@@ -122,10 +123,10 @@ bool MathMacroTemplate::metrics(MetricsInfo & mi, Dimension & dim) const
                + theFontMetrics(mi.base.font).width(dp);
        dim.asc = std::max(cell(0).ascent(),  cell(1).ascent())  + 7;
        dim.des = std::max(cell(0).descent(), cell(1).descent()) + 7;
-       
+
        if (lockMacro)
                MacroTable::globalMacros().get(name_).unlock();
-       
+
        if (dim_ == dim)
                return false;
        dim_ = dim;
@@ -138,11 +139,11 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const
        bool lockMacro = MacroTable::globalMacros().has(name_);
        if (lockMacro)
                MacroTable::globalMacros().get(name_).lock();
-       
+
        setPosCache(p, x, y);
 
        // label
-       LyXFont font = p.base.font;
+       Font font = p.base.font;
        font.setColor(Color::math);
 
        PainterInfo pi(p.base.bv, p.pain);
@@ -179,7 +180,7 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const
        cell(1).draw(pi, x + 8 + w0, y + 1);
        pi.pain.rectangle(x + w0 + 6, y - dim_.ascent() + 3,
                w1 + 4, dim_.height() - 6, Color::mathline);
-       
+
        if (lockMacro)
                MacroTable::globalMacros().get(name_).unlock();
 }
@@ -234,10 +235,10 @@ void MathMacroTemplate::write(WriteStream & os) const
 }
 
 
-int MathMacroTemplate::plaintext(Buffer const &, odocstream & os,
-                                 OutputParams const &) const
+int MathMacroTemplate::plaintext(Buffer const & buf, odocstream & os,
+                                OutputParams const &) const
 {
-       static docstring const str = '[' + _("math macro") + ']';
+       static docstring const str = '[' + buf.B_("math macro") + ']';
 
        os << str;
        return str.size();