]> git.lyx.org Git - features.git/commitdiff
another recordUndoFullDocument bits the dust
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Sep 2008 10:47:28 +0000 (10:47 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Sep 2008 10:47:28 +0000 (10:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26439 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/insets/InsetNote.cpp

index fc3163b7848302efbc0570d59d24af90050362c9..42420b92d191f468e1a7409cf0bbe33510c1cfe0 100644 (file)
@@ -1440,7 +1440,6 @@ bool BufferView::dispatch(FuncRequest const & cmd)
        case LFUN_NOTES_MUTATE: {
                if (cmd.argument().empty())
                        break;
-               cur.recordUndoFullDocument();
 
                if (mutateNotes(cur, cmd.getArg(0), cmd.getArg(1))) {
                        processUpdateFlags(Update::Force);
index 70278a9794a0156edd76e3040bd2f6591d4b7c3e..5431712447862e4eb43b5756321217729f5a89f8 100644 (file)
@@ -383,6 +383,7 @@ bool mutateNotes(Cursor & cur, string const & source, string const &target)
        // did we found some conforming inset?
        bool ret = false;
 
+       cur.beginUndoGroup();
        Inset & inset = cur.buffer().inset();
        InsetIterator it  = inset_iterator_begin(inset);
        InsetIterator const end = inset_iterator_end(inset);
@@ -390,12 +391,14 @@ bool mutateNotes(Cursor & cur, string const & source, string const &target)
                if (it->lyxCode() == NOTE_CODE) {
                        InsetNote & ins = static_cast<InsetNote &>(*it);
                        if (ins.params().type == typeSrc) {
+                               cur.buffer().undo().recordUndo(it);
                                FuncRequest fr(LFUN_INSET_MODIFY, "note Note " + target);
                                ins.dispatch(cur, fr);
                                ret = true;
                        }
                }
        }
+       cur.endUndoGroup();
 
        return ret;
 }