]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
Get rid of all-insets-toggle and explain how to replace it with inset-forall.
[lyx.git] / src / BufferView.cpp
index 68b6047138282acf9168caf2027c84869fdb5583..d5e4a016e40884907883ff5063c5d5f4d1f24d91 100644 (file)
@@ -970,7 +970,7 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
 
        switch (cmd.action) {
 
-       // FIXME: This is a bit problematic because we don't check is if this is
+       // FIXME: This is a bit problematic because we don't check if this is
        // a document BufferView or not for these LFUNs. We probably have to
        // dispatch both to currentBufferView() and, if that fails,
        // to documentBufferView(); same as we do know for current Buffer and
@@ -1020,7 +1020,6 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
        case LFUN_SCREEN_SHOW_CURSOR:
        case LFUN_BIBTEX_DATABASE_ADD:
        case LFUN_BIBTEX_DATABASE_DEL:
-       case LFUN_ALL_INSETS_TOGGLE:
        case LFUN_STATISTICS:
        case LFUN_BRANCH_ADD_INSERT:
        case LFUN_KEYMAP_OFF:
@@ -1714,7 +1713,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        while (!insname.empty()) {
                                if (insname == name || name == from_utf8("*")) {
                                        cur.recordUndo();
-                                       lyx::dispatch(fr);
+                                       lyx::dispatch(fr, dr);
                                        ++iterations;
                                        break;
                                }
@@ -1739,29 +1738,6 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
        }
 
 
-       case LFUN_ALL_INSETS_TOGGLE: {
-               string action;
-               string const name = split(to_utf8(cmd.argument()), action, ' ');
-               InsetCode const inset_code = insetCode(name);
-
-               FuncRequest fr(LFUN_INSET_TOGGLE, action);
-
-               Inset & inset = cur.buffer()->inset();
-               InsetIterator it  = inset_iterator_begin(inset);
-               InsetIterator const end = inset_iterator_end(inset);
-               for (; it != end; ++it) {
-                       if (it->asInsetCollapsable()
-                           && (inset_code == NO_CODE
-                           || inset_code == it->lyxCode())) {
-                               Cursor tmpcur = cur;
-                               tmpcur.pushBackward(*it);
-                               it->dispatch(tmpcur, fr);
-                       }
-               }
-               dr.update(Update::Force | Update::FitCursor);
-               break;
-       }
-
        case LFUN_BRANCH_ADD_INSERT: {
                docstring branch_name = from_utf8(cmd.getArg(0));
                if (branch_name.empty())