]> git.lyx.org Git - features.git/commitdiff
Try to finally fix #6930. All the paths that did not come from context
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 8 Dec 2010 09:24:04 +0000 (09:24 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 8 Dec 2010 09:24:04 +0000 (09:24 +0000)
menus were (intentionally) missing, and it turns out they were needed.

Normally all invocations of INSET_MODIFY should trigger a recordUndo now.
Of course all cases have not been tested, but it should be working.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36770 a592a061-630c-0410-9148-cb99ea01b6c8

18 files changed:
src/insets/InsetBibitem.cpp
src/insets/InsetBibtex.cpp
src/insets/InsetBox.cpp
src/insets/InsetBranch.cpp
src/insets/InsetCommand.cpp
src/insets/InsetERT.cpp
src/insets/InsetExternal.cpp
src/insets/InsetFloat.cpp
src/insets/InsetGraphics.cpp
src/insets/InsetInclude.cpp
src/insets/InsetIndex.cpp
src/insets/InsetLabel.cpp
src/insets/InsetLine.cpp
src/insets/InsetListings.cpp
src/insets/InsetNomencl.cpp
src/insets/InsetTabular.cpp
src/insets/InsetWrap.cpp
src/mathed/InsetMathRef.cpp

index 11ba38c7e86fad29bab4706c7523845ba7d81f40..d3a10ae63c645bb653a161109434dc75047e42ac 100644 (file)
@@ -122,6 +122,9 @@ void InsetBibitem::doDispatch(Cursor & cur, FuncRequest & cmd)
                        cur.noScreenUpdate();
                        break;
                }
+
+               cur.recordUndo();
+
                docstring const & old_key = params()["key"];
                docstring const & old_label = params()["label"];
                docstring label = p["label"];
index 88ff6649676b3c9bfc5ec5a4038d82bb054e9d4c..f61e1661a55fe1778887f679e8d97611a2c16788 100644 (file)
@@ -103,7 +103,8 @@ void InsetBibtex::doDispatch(Cursor & cur, FuncRequest & cmd)
                                throw message;
                        break;
                }
-               //
+
+               cur.recordUndo();
                setParams(p);
                buffer().invalidateBibfileCache();
                cur.forceBufferUpdate();
index 6b409200bf19f3309f00943c48963675e3092263..16839b01cb70c256bc09609961f95b4184aaad30 100644 (file)
@@ -192,8 +192,8 @@ void InsetBox::doDispatch(Cursor & cur, FuncRequest & cmd)
 
        case LFUN_INSET_MODIFY: {
                //lyxerr << "InsetBox::dispatch MODIFY" << endl;
+               cur.recordUndoInset(ATOMIC_UNDO, this);
                if (cmd.getArg(0) == "changetype") {
-                       cur.recordUndoInset(ATOMIC_UNDO, this);
                        params_.type = cmd.getArg(1);
                } else
                        string2params(to_utf8(cmd.argument()), params_);
index 7bb1b655554875d9dd8dac027eb004a5a80a8cc1..4bcd711c1bbcfbd63cff6cf9793bf191d863ab7b 100644 (file)
@@ -116,6 +116,8 @@ void InsetBranch::doDispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_INSET_MODIFY: {
                InsetBranchParams params;
                InsetBranch::string2params(to_utf8(cmd.argument()), params);
+
+               cur.recordUndoInset(ATOMIC_UNDO, this);
                params_.branch = params.branch;
                // what we really want here is a TOC update, but that means
                // a full buffer update
index 4da3f19b2bb5bdf515e9489256e0c9d04b4b680b..601e5a7b4788a9b1ac318fa846d461f13c3a211d 100644 (file)
@@ -156,8 +156,10 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
                InsetCommand::string2params(to_utf8(cmd.argument()), p);
                if (p.getCmdName().empty())
                        cur.noScreenUpdate();
-               else
+               else {
+                       cur.recordUndo();
                        setParams(p);
+               }
                // FIXME We might also want to check here if this one is in the TOC.
                // But I think most of those are labeled.
                if (isLabeled())
index 61b3128ffb82451f6935e3b5d325f7a05c22c8af..c65b54b977756aee33d2fb11b2adfb7e71aad20c 100644 (file)
@@ -114,6 +114,7 @@ void InsetERT::doDispatch(Cursor & cur, FuncRequest & cmd)
        switch (cmd.action()) {
        case LFUN_INSET_MODIFY:
                if (cmd.getArg(0) == "ert") {
+                       cur.recordUndoInset(ATOMIC_UNDO, this);
                        setStatus(cur, string2params(to_utf8(cmd.argument())));
                        break;
                }
index f8b8a9bd65b1a33b8c2725945a66e53d628777f8..78d7de47a23f0a539f5fbbb5b8eb23c54585b366 100644 (file)
@@ -420,6 +420,7 @@ void InsetExternal::doDispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_INSET_MODIFY: {
                InsetExternalParams p;
                string2params(to_utf8(cmd.argument()), buffer(), p);
+               cur.recordUndo();
                setParams(p);
                break;
        }
index 6654123dab16015ebcdc6856289989390f291bf1..2292d175c99b88a8046f6995fe3dfe6f438a5478 100644 (file)
@@ -142,6 +142,7 @@ void InsetFloat::doDispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_INSET_MODIFY: {
                InsetFloatParams params;
                string2params(to_utf8(cmd.argument()), params);
+               cur.recordUndoInset(ATOMIC_UNDO, this);
 
                // placement, wide and sideways are not used for subfloats
                if (!params_.subfloat) {
index 25abe040d6f9f166d24a1f06b278139ff4becc7f..3bbf19f3b1810385710bc56ef07c28230258056f 100644 (file)
@@ -210,6 +210,7 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
                        break;
                }
 
+               cur.recordUndo();
                setParams(p);
                // if the inset is part of a graphics group, all the
                // other members should be updated too.
index b852f4b2591a520eda0684a8a67c421ad3a725db..c91a70eeb5d5358a91c680f33cc8f7c477a79116 100644 (file)
@@ -277,6 +277,7 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
                                        }
                                }
                        }
+                       cur.recordUndo();
                        setParams(p);
                        cur.forceBufferUpdate();
                } else
index 455f683c647e3ea43c4c0276da947b3c8552056a..32419a408a9e7d64cee5a8ea5dd0197202ee746e 100644 (file)
@@ -213,6 +213,7 @@ void InsetIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
                }
                InsetIndexParams params;
                InsetIndex::string2params(to_utf8(cmd.argument()), params);
+               cur.recordUndoInset(ATOMIC_UNDO, this);
                params_.index = params.index;
                // what we really want here is a TOC update, but that means
                // a full buffer update
index 926297e56fc1a2078502a6e521597b82b5a02c60..62476dea7654005539e31811436b53fec312dc68 100644 (file)
@@ -196,8 +196,10 @@ void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd)
                        cur.noScreenUpdate();
                        break;
                }
-               if (p["name"] != params()["name"])
+               if (p["name"] != params()["name"]) {
+                       // undo is handled in updateCommand
                        updateCommand(p["name"]);
+               }
                cur.forceBufferUpdate();
                break;
        }
index 5c12d37e09539a23430ffc21be0020fd3d4eaf9d..a91a31ed5e88da95f9ade9f90cc444c32ec12eb5 100644 (file)
@@ -77,6 +77,7 @@ void InsetLine::doDispatch(Cursor & cur, FuncRequest & cmd)
                        cur.noScreenUpdate();
                        break;
                }
+               cur.recordUndo();
                setParams(p);
                break;
        }
index f03cace45f55e1a12cfb8e3e1e1abab58f1a9473..7b37e05941cb3622e89222fc5eb110639b18b51b 100644 (file)
@@ -320,6 +320,7 @@ void InsetListings::doDispatch(Cursor & cur, FuncRequest & cmd)
        switch (cmd.action()) {
 
        case LFUN_INSET_MODIFY: {
+               cur.recordUndoInset(ATOMIC_UNDO, this);
                InsetListings::string2params(to_utf8(cmd.argument()), params());
                break;
        }
index 1a44ccd5f826dc455044e42a94291874e64073ba..a596691aa36662268de8e4399dcd6264447cf3af 100644 (file)
@@ -175,6 +175,8 @@ void InsetPrintNomencl::doDispatch(Cursor & cur, FuncRequest & cmd)
                        cur.noScreenUpdate();
                        break;
                }
+
+               cur.recordUndo();
                setParams(p);
                break;
        }
index 0a0a9097b383a76bc1ae197eeb04e31defa44522..c41cea76c1c4b0a7e1085105b4eeec92c8bedec0 100644 (file)
@@ -5114,7 +5114,7 @@ void InsetTabular::tabularFeatures(Cursor & cur,
                break;
        }
 
-       cur.recordUndoInset(ATOMIC_UNDO);
+       cur.recordUndoInset(ATOMIC_UNDO, this);
 
        getSelection(cur, sel_row_start, sel_row_end, sel_col_start, sel_col_end);
        row_type const row = tabular.cellRow(cur.idx());
index f29c06ee97c891c2c620fe42a44b2a0e7f7bc81e..a3eca3c5a2f57f7fb1f19cbcde5beeb772ab4f36 100644 (file)
@@ -80,6 +80,7 @@ void InsetWrap::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action()) {
        case LFUN_INSET_MODIFY: {
+               cur.recordUndoInset(ATOMIC_UNDO, this);
                InsetWrapParams params;
                InsetWrap::string2params(to_utf8(cmd.argument()), params);
                params_.lines = params.lines;
index 4485304a9fc36fa48a7dad263cb35b9e8ddde545..ae1768351c426d20af4ab680e98282ad9c864222 100644 (file)
@@ -66,6 +66,7 @@ void InsetMathRef::doDispatch(Cursor & cur, FuncRequest & cmd)
                if (cmd.getArg(0) == "ref") {
                        MathData ar;
                        if (createInsetMath_fromDialogStr(cmd.argument(), ar)) {
+                               cur.recordUndo();
                                *this = *ar[0].nucleus()->asRefInset();
                                break;
                        }