]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formulabase.C
Jean-Marc's fix for wrong descent
[lyx.git] / src / mathed / formulabase.C
index 22c0474580a660a1a1ff2b7a87a3d63f7eb1fd49..cca0e6f1c4fb964387eae4e1a02adccf851d64f3 100644 (file)
@@ -427,7 +427,7 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd)
                case LFUN_MOUSE_MOTION:
                        //return lfunMouseMotion(cmd);
                case LFUN_MOUSE_RELEASE:
-                       lyxerr << "Mouse single release\n";
+                       //lyxerr << "Mouse single release\n";
                        return lfunMouseRelease(cmd);
                case LFUN_MOUSE_DOUBLE:
                        //lyxerr << "Mouse double\n";
@@ -797,23 +797,25 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd)
        case LFUN_DIALOG_SHOW_NEW_INSET: {
                string const & name = argument;
                if (name == "ref") {
-                       string data = "LatexCommand \\ref{}\n\\end_inset\n\n";
+                       string data = "ref LatexCommand \\ref{}\n\\end_inset\n\n";
                        bv->owner()->getDialogs().show(name, data, 0);
                } else
                        result = UNDISPATCHED;
        }
        break;
 
-       case LFUN_REF_APPLY: {
+       case LFUN_INSET_APPLY: {
+               string const name = cmd.getArg(0);
                InsetBase * base =
-                       bv->owner()->getDialogs().getOpenInset("ref");
+                       bv->owner()->getDialogs().getOpenInset(name);
 
                if (base) {
-                       result = base->localDispatch(cmd);
+                       FuncRequest fr(bv, LFUN_INSET_MODIFY, cmd.argument);
+                       result = base->localDispatch(fr);
                } else {
                        // Turn 'argument' into a temporary RefInset.
                        MathArray ar;
-                       if (string2RefInset(argument, ar)) {
+                       if (string2RefInset(cmd.argument, ar)) {
                                mathcursor->insert(ar);
                        } else {
                                result = UNDISPATCHED;