]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
typo
[lyx.git] / src / BufferView.cpp
index da3a721b48bd8b52573cd045eee15dd07cf9c40a..9daa2aaa55ec5bfae5aca6f79438a45dc443f8db 100644 (file)
@@ -1221,7 +1221,7 @@ bool BufferView::dispatch(FuncRequest const & cmd)
 
        case LFUN_MARK_ON:
                cur.clearSelection();
-               cur.mark() = true;
+               cur.setMark(true);
                cur.resetAnchor();
                cur.message(from_utf8(N_("Mark on")));
                break;
@@ -1229,10 +1229,10 @@ bool BufferView::dispatch(FuncRequest const & cmd)
        case LFUN_MARK_TOGGLE:
                cur.clearSelection();
                if (cur.mark()) {
-                       cur.mark() = false;
+                       cur.setMark(false);
                        cur.message(from_utf8(N_("Mark removed")));
                } else {
-                       cur.mark() = true;
+                       cur.setMark(true);
                        cur.message(from_utf8(N_("Mark set")));
                }
                cur.resetAnchor();
@@ -1432,7 +1432,6 @@ bool BufferView::dispatch(FuncRequest const & cmd)
        case LFUN_GRAPHICS_GROUPS_UNIFY: {
                if (cmd.argument().empty())
                        break;
-               //view()->cursor().recordUndoFullDocument(); let inset-apply do that job
                graphics::unifyGraphicsGroups(cur.buffer(), to_utf8(cmd.argument()));
                processUpdateFlags(Update::Force | Update::FitCursor);
                break;
@@ -1441,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);
@@ -1572,7 +1570,7 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
        Cursor old = cursor();
        Cursor cur(*this);
        cur.push(buffer_.inset());
-       cur.selection() = d->cursor_.selection();
+       cur.setSelection(d->cursor_.selection());
 
        // Either the inset under the cursor or the
        // surrounding Text will handle this event.
@@ -1619,6 +1617,8 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
        // Put anchor at the same position.
        cur.resetAnchor();
 
+       cur.beginUndoGroup();
+
        // Try to dispatch to an non-editable inset near this position
        // via the temp cursor. If the inset wishes to change the real
        // cursor it has to do so explicitly by using
@@ -1631,6 +1631,8 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
        if (!inset || !cur.result().dispatched())
                cur.dispatch(cmd);
 
+       cur.endUndoGroup();
+
        // Notify left insets
        if (cur != old) {
                old.fixIfBroken();
@@ -1814,7 +1816,7 @@ void BufferView::setCursor(DocIterator const & dit)
                dit[i].inset().edit(d->cursor_, true);
 
        d->cursor_.setCursor(dit);
-       d->cursor_.selection() = false;
+       d->cursor_.setSelection(false);
 }