]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_mboxinset.C
Make Helge happy: no more crash on arrow up/down in math macro
[lyx.git] / src / mathed / math_mboxinset.C
index 083860cfa35e290f81d28b4cd3d3e523127a97ab..9fcce755dd7600eb3cc90ba8ff3d21ef5365e2d8 100644 (file)
@@ -17,6 +17,7 @@
 #include "BufferView.h"
 #include "buffer.h"
 #include "bufferparams.h"
+#include "cursor.h"
 #include "debug.h"
 #include "metricsinfo.h"
 #include "output_latex.h"
@@ -39,7 +40,7 @@ MathMBoxInset::MathMBoxInset(BufferView & bv)
 }
 
 
-auto_ptr<InsetBase> MathMBoxInset::clone() const
+auto_ptr<InsetBase> MathMBoxInset::doClone() const
 {
        return auto_ptr<InsetBase>(new MathMBoxInset(*this));
 }
@@ -55,7 +56,7 @@ void MathMBoxInset::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void MathMBoxInset::draw(PainterInfo & pi, int x, int y) const
 {
-       text_.draw(pi, x + 1, y - text_.ascent());
+       text_.draw(pi, x + 1, y);
        drawMarkers(pi, x, y);
 }
 
@@ -89,7 +90,7 @@ int MathMBoxInset::latex(Buffer const & buf, std::ostream & os,
 }
 
 
-void MathMBoxInset::priv_dispatch(LCursor & cur, FuncRequest & cmd)
+void MathMBoxInset::doDispatch(LCursor & cur, FuncRequest & cmd)
 {
        text_.dispatch(cur, cmd);
 }
@@ -101,8 +102,15 @@ LyXText * MathMBoxInset::getText(int) const
 }
 
 
-void MathMBoxInset::getCursorPos(CursorSlice const & cur, int & x, int & y) const
+void MathMBoxInset::getCursorPos(CursorSlice const & sl, int & x, int & y) const
 {
-       x = text_.cursorX(cur);
-       y = text_.cursorY(cur);
+       x = text_.cursorX(sl);
+       y = text_.cursorY(sl);
 }
+
+
+void MathMBoxInset::drawSelection(PainterInfo & pi, int x, int y) const
+{
+       text_.drawSelection(pi, x, y);
+}
+