case LFUN_BIBTEX_DATABASE_DEL:
case LFUN_GRAPHICS_GROUPS_UNIFY:
case LFUN_NOTES_MUTATE:
+ case LFUN_ALL_INSETS_TOGGLE:
case LFUN_STATISTICS:
flag.setEnabled(true);
break;
processUpdateFlags(Update::Force);
break;
- // These Two could be rewriten using some command like forall <insetname> <command>
+ // These two could be rewriten using some command like forall <insetname> <command>
// once the insets refactoring is done.
case LFUN_GRAPHICS_GROUPS_UNIFY: {
if (cmd.argument().empty())
break;
}
+ 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->asInsetMath()
+ && (inset_code == NO_CODE
+ || inset_code == it->lyxCode())) {
+ Cursor tmpcur = cur;
+ tmpcur.pushBackward(*it);
+ it->dispatch(tmpcur, fr);
+ }
+ }
+ processUpdateFlags(Update::Force | Update::FitCursor);
+ break;
+ }
+
default:
return false;
}
case LFUN_PREFERENCES_SAVE:
case LFUN_MESSAGE:
case LFUN_INSET_EDIT:
- case LFUN_ALL_INSETS_TOGGLE:
case LFUN_BUFFER_LANGUAGE:
case LFUN_TEXTCLASS_APPLY:
case LFUN_TEXTCLASS_LOAD:
lyx_view_->message(from_utf8(argument));
break;
-
- case LFUN_ALL_INSETS_TOGGLE: {
- LASSERT(lyx_view_, /**/);
- string action;
- string const name = split(argument, action, ' ');
- InsetCode const inset_code = insetCode(name);
-
- Cursor & cur = view()->cursor();
- FuncRequest fr(LFUN_INSET_TOGGLE, action);
-
- Inset & inset = lyx_view_->buffer()->inset();
- InsetIterator it = inset_iterator_begin(inset);
- InsetIterator const end = inset_iterator_end(inset);
- for (; it != end; ++it) {
- if (!it->asInsetMath()
- && (inset_code == NO_CODE
- || inset_code == it->lyxCode())) {
- Cursor tmpcur = cur;
- tmpcur.pushBackward(*it);
- it->dispatch(tmpcur, fr);
- }
- }
- updateFlags = Update::Force | Update::FitCursor;
- break;
- }
-
case LFUN_BUFFER_LANGUAGE: {
LASSERT(lyx_view_, /**/);
Buffer & buffer = *lyx_view_->buffer();