]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathNest.cpp
* InsetTabular cleanup:
[features.git] / src / mathed / InsetMathNest.cpp
index d49b9af500e7202f4fbf128dcc4aecd02568a479..0a7810784acb6520c0380ce029f6ef7a23588263 100644 (file)
@@ -48,7 +48,7 @@
 #include "Encoding.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "LyXFunc.h"
+#include "LyX.h"
 #include "LyXRC.h"
 #include "OutputParams.h"
 #include "Text.h"
@@ -173,6 +173,14 @@ void InsetMathNest::metrics(MetricsInfo const & mi) const
 }
 
 
+void InsetMathNest::updateLabels(ParIterator const & it, UpdateType utype)
+{
+       for (idx_type i = 0, n = nargs(); i != n; ++i)
+               cell(i).updateLabels(it, utype);
+}
+
+
+
 bool InsetMathNest::idxNext(Cursor & cur) const
 {
        LASSERT(&cur.inset() == this, /**/);
@@ -530,7 +538,7 @@ void InsetMathNest::handleFont2(Cursor & cur, docstring const & arg)
 
 void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
-       //lyxerr << "InsetMathNest: request: " << cmd << endl;
+       //LYXERR0("InsetMathNest: request: " << cmd);
 
        Parse::flags parseflg = Parse::QUIET | Parse::USETEXT;
 
@@ -554,8 +562,10 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                        is >> n;
                        topaste = cap::selection(n);
                }
-               cur.niceInsert(topaste, parseflg);
+               cur.niceInsert(topaste, parseflg, false);
                cur.clearSelection(); // bug 393
+               // FIXME audit setBuffer/updateLabels calls
+               cur.buffer()->updateLabels();
                cur.finishUndo();
                break;
        }
@@ -567,6 +577,8 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                // Prevent stale position >= size crash
                // Probably not necessary anymore, see eraseSelection (gb 2005-10-09)
                cur.normalize();
+               // FIXME audit setBuffer/updateLabels calls
+               cur.buffer()->updateLabels();
                break;
 
        case LFUN_COPY:
@@ -976,6 +988,8 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.posBackward();
                cur.pushBackward(*cur.nextInset());
                cur.niceInsert(save_selection);
+               // FIXME audit setBuffer/updateLabels calls
+               cur.buffer()->updateLabels();
 #else
                if (currentMode() == Inset::TEXT_MODE) {
                        cur.recordUndoSelection();
@@ -992,7 +1006,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_REGEXP_MODE: {
                InsetMathHull * i = dynamic_cast<InsetMathHull *>(cur.inset().asInsetMath());
                if (i && i->getType() == hullRegexp) {
-                       cur.message(_("Already in regexp mode"));
+                       cur.message(_("Already in regular expression mode"));
                        break;
                }
                cur.macroModeClose();
@@ -1002,7 +1016,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.posBackward();
                cur.pushBackward(*cur.nextInset());
                cur.niceInsert(save_selection);
-               cur.message(_("Regexp editor mode"));
+               cur.message(_("Regular expression editor mode"));
                break;
        }
 
@@ -1190,6 +1204,8 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                if (createInsetMath_fromDialogStr(cmd.argument(), ar)) {
                        cur.recordUndoSelection();
                        cur.insert(ar);
+                       // FIXME audit setBuffer/updateLabels calls
+                       cur.buffer()->updateLabels();
                } else
                        cur.undispatched();
                break;
@@ -1250,11 +1266,11 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd,
        bool ret = true;
        string const arg = to_utf8(cmd.argument());
        switch (cmd.action) {
-       case LFUN_TABULAR_FEATURE:
+       case LFUN_INSET_MODIFY:
                flag.setEnabled(false);
                break;
 #if 0
-       case LFUN_TABULAR_FEATURE:
+       case LFUN_INSET_MODIFY:
                // FIXME: check temporarily disabled
                // valign code
                char align = mathcursor::valign();