]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formulabase.C
fix typo that put too many include paths for most people
[lyx.git] / src / mathed / formulabase.C
index 8b02a4715455346526abf60fe912ff6b38e2dddc..5bd77093ddeb9de73603d3a8c3756926f5348f90 100644 (file)
@@ -667,11 +667,12 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
                MathInset::idx_type idx = 0;
                MathGridInset * p = mathcursor ? mathcursor->enclosingGrid(idx) : 0;
                if (p) {
+                       mathcursor->popToEnclosingGrid();
                        bv->lockedInsetStoreUndo(Undo::EDIT);
-                       char al = arg.size() ? arg[0] : 'c';
+                       char align = arg.size() ? arg[0] : 'c';
                        switch (action) {
-                               case LFUN_MATH_HALIGN: p->halign(al, p->col(idx)); break;
-                               case LFUN_MATH_VALIGN: p->valign(al); break;
+                               case LFUN_MATH_HALIGN: p->halign(align, p->col(idx)); break;
+                               case LFUN_MATH_VALIGN: p->valign(align); break;
                                case LFUN_MATH_ROW_INSERT: p->addRow(p->row(idx)); break;
                                case LFUN_MATH_ROW_DELETE: p->delRow(p->row(idx)); break;
                                case LFUN_MATH_COLUMN_INSERT: p->addCol(p->col(idx)); break;
@@ -893,7 +894,8 @@ void mathDispatchCreation(BufferView * bv, string const & arg, bool display)
                } else {
                        // create a macro if we see "\\newcommand" somewhere, and an ordinary
                        // formula otherwise
-                       if (sel.find("\\newcommand") == string::npos)
+                       if (sel.find("\\newcommand") == string::npos &&
+                                 sel.find("\\def") == string::npos)
                                f = new InsetFormula(sel);
                        else {
                                string name;
@@ -933,7 +935,7 @@ void mathDispatchMathMacro(BufferView * bv, string const & arg)
                if (arg.empty())
                        bv->owner()->getLyXFunc()->setErrorMessage(N_("Missing argument"));
                else {
-                       string s(arg);
+                       string s = arg;
                        string const s1 = token(s, ' ', 1);
                        int const na = s1.empty() ? 0 : lyx::atoi(s1);
                        openNewInset(bv, new InsetFormulaMacro(token(s, ' ', 0), na));