]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_nestinset.C
fix #1073
[lyx.git] / src / mathed / math_nestinset.C
index 120462bfca9cfd22531f67f95bdcac068dc1f951..44649e2cdcb29defba2526ed0afea3d0e1345744 100644 (file)
@@ -1,6 +1,3 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "math_nestinset.h"
 #include "math_cursor.h"
@@ -45,6 +42,7 @@ void MathNestInset::getPos(idx_type idx, pos_type pos, int & x, int & y) const
                x += 2;
 }
 
+
 void MathNestInset::substitute(MathMacro const & m)
 {
        for (idx_type i = 0; i < nargs(); ++i)
@@ -52,9 +50,9 @@ void MathNestInset::substitute(MathMacro const & m)
 }
 
 
-void MathNestInset::metrics(MathMetricsInfo const & mi) const
+void MathNestInset::metrics(MetricsInfo const & mi) const
 {
-       MathMetricsInfo m = mi;
+       MetricsInfo m = mi;
        for (idx_type i = 0; i < nargs(); ++i)
                cell(i).metrics(m);
 }
@@ -158,8 +156,8 @@ void MathNestInset::dump() const
 }
 
 
-//void MathNestInset::draw(MathPainterInfo & pi, int x, int y) const
-void MathNestInset::draw(MathPainterInfo &, int, int) const
+//void MathNestInset::draw(PainterInfo & pi, int x, int y) const
+void MathNestInset::draw(PainterInfo &, int, int) const
 {
 #if 0
        if (lock_)
@@ -169,7 +167,7 @@ void MathNestInset::draw(MathPainterInfo &, int, int) const
 }
 
 
-void MathNestInset::drawSelection(MathPainterInfo & pi,
+void MathNestInset::drawSelection(PainterInfo & pi,
                idx_type idx1, pos_type pos1, idx_type idx2, pos_type pos2) const
 {
        if (idx1 == idx2) {
@@ -194,7 +192,7 @@ void MathNestInset::drawSelection(MathPainterInfo & pi,
 }
 
 
-void MathNestInset::drawMarkers(MathPainterInfo & pi, int x, int y) const
+void MathNestInset::drawMarkers(PainterInfo & pi, int x, int y) const
 {
        if (!editing())
                return;
@@ -207,7 +205,7 @@ void MathNestInset::drawMarkers(MathPainterInfo & pi, int x, int y) const
 }
 
 
-void MathNestInset::drawMarkers2(MathPainterInfo & pi, int x, int y) const
+void MathNestInset::drawMarkers2(PainterInfo & pi, int x, int y) const
 {
        if (!editing())
                return;
@@ -311,11 +309,13 @@ void MathNestInset::normalize(NormalStream & os) const
 }
 
 
-void MathNestInset::notifyCursorLeaves()
-{}
+void MathNestInset::notifyCursorLeaves(idx_type idx)
+{
+       cell(idx).notifyCursorLeaves();
+}
 
 
-MathInset::result_type MathNestInset::dispatch
+dispatch_result MathNestInset::dispatch
        (FuncRequest const & cmd, idx_type & idx, pos_type & pos)
 {
        BufferView * bv = cmd.view();
@@ -323,11 +323,8 @@ MathInset::result_type MathNestInset::dispatch
        switch (cmd.action) {
 
                case LFUN_PASTE: {
-                       lyxerr << "pasting '" << cmd.argument << "'\n";
                        MathArray ar;
                        mathed_parse_cell(ar, cmd.argument);
-                       lyxerr << "pasting '" << ar << "'\n";
-                       lyxerr << "cell(idx) '" << cell(idx) << "'\n";
                        cell(idx).insert(pos, ar);
                        pos += ar.size();
                        return DISPATCHED;
@@ -335,14 +332,15 @@ MathInset::result_type MathNestInset::dispatch
 
                case LFUN_PASTESELECTION:
                        return
-                               dispatch(FuncRequest(bv, LFUN_PASTE, bv->getClipboard()), idx, pos);
-                       
+                               dispatch(
+                                       FuncRequest(bv, LFUN_PASTE, bv->getClipboard()), idx, pos);
+
                case LFUN_MOUSE_PRESS:
                        if (cmd.button() == mouse_button::button2)
                                return dispatch(FuncRequest(bv, LFUN_PASTESELECTION), idx, pos);
                        return UNDISPATCHED;
 
-               default:        
+               default:
                        return MathInset::dispatch(cmd, idx, pos);
        }
        return UNDISPATCHED;