]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_scriptinset.C
float2string #4 (Spacing)
[lyx.git] / src / mathed / math_scriptinset.C
index 11f858c31a6b16a329471a8eeeaff9087edbc80c..cf23765572186e00b490bb7606b1210e4e5316e8 100644 (file)
@@ -47,8 +47,7 @@ MathScriptInset::MathScriptInset(MathAtom const & at, bool up)
 }
 
 
-
-auto_ptr<InsetBase> MathScriptInset::clone() const
+auto_ptr<InsetBase> MathScriptInset::doClone() const
 {
        return auto_ptr<InsetBase>(new MathScriptInset(*this));
 }
@@ -305,12 +304,12 @@ bool MathScriptInset::hasLimits() const
 
 void MathScriptInset::removeScript(bool up)
 {
-       lyxerr << "MathNestInset::removeScript: 1 up: " << up << endl;
+       lyxerr << "MathScriptInset::removeScript: 1 up: " << up << endl;
        if (nargs() == 2) {
-               lyxerr << "MathNestInset::removeScript: a up: " << up << endl;
+               lyxerr << "MathScriptInset::removeScript: a up: " << up << endl;
                if (up == cell_1_is_up_)
                        cells_.pop_back();
-               lyxerr << "MathNestInset::removeScript: b up: " << up << endl;
+               lyxerr << "MathScriptInset::removeScript: b up: " << up << endl;
        } else if (nargs() == 3) {
                if (up == true) {
                        swap(cells_[1], cells_[2]);
@@ -320,7 +319,7 @@ void MathScriptInset::removeScript(bool up)
                }
                cells_.pop_back();
        }
-       lyxerr << "MathNestInset::removeScript: 2 up: " << up << endl;
+       lyxerr << "MathScriptInset::removeScript: 2 up: " << up << endl;
 }
 
 
@@ -557,24 +556,24 @@ void MathScriptInset::notifyCursorLeaves(LCursor & cur)
 {
        MathNestInset::notifyCursorLeaves(cur);
 
+       lyxerr << "MathScriptInset::notifyCursorLeaves: 1 " << cur << endl;
+
        // remove empty scripts if possible
+if (1) {
        if (nargs() > 2 && cur.idx() == 2 && cell(2).empty()) {
                // must be a subscript...
                removeScript(false);
-               // sanitize cursor, even if this slice will be removed immediately
-               cur.idx() = 0;
-               cur.pos() = 0;
        } else if (nargs() > 1 && cur.idx() == 1 && cell(1).empty()) {
                // could be either subscript or super script
                removeScript(cell_1_is_up_);
-               // sanitize cursor, even if this slice will be removed immediately
-               cur.idx() = 0;
-               cur.pos() = 0;
        }
 }
 
+       lyxerr << "MathScriptInset::notifyCursorLeaves: 2 " << cur << endl;
+}
+
 
-void MathScriptInset::priv_dispatch(LCursor & cur, FuncRequest & cmd)
+void MathScriptInset::doDispatch(LCursor & cur, FuncRequest & cmd)
 {
        //lyxerr << "MathScriptInset: request: " << cmd << std::endl;
 
@@ -593,5 +592,5 @@ void MathScriptInset::priv_dispatch(LCursor & cur, FuncRequest & cmd)
                return;
        }
 
-       MathNestInset::priv_dispatch(cur, cmd);
+       MathNestInset::doDispatch(cur, cmd);
 }