revert unintented patch part

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32621 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-12-23 14:29:13 +00:00
parent e5376bd800
commit 8bab525eda
3 changed files with 0 additions and 70 deletions

View File

@ -1090,7 +1090,6 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
case LFUN_SCROLL:
case LFUN_SCREEN_UP_SELECT:
case LFUN_SCREEN_DOWN_SELECT:
case LFUN_INSET_FORALL:
flag.setEnabled(true);
break;
@ -1730,53 +1729,6 @@ bool BufferView::dispatch(FuncRequest const & cmd)
break;
}
// This would be in Buffer class if only Cursor did not
// require a bufferview
case LFUN_INSET_FORALL: {
docstring const name = from_utf8(cmd.getArg(0));
string const commandstr = cmd.getLongArg(1);
FuncRequest const fr = lyxaction.lookupFunc(commandstr);
// an arbitrary number to limit number of iterations
const int max_iter = 1000;
int iterations = 0;
Cursor & cur = d->cursor_;
cur.reset();
if (!cur.nextInset())
cur.forwardInset();
cur.beginUndoGroup();
while(cur && iterations < max_iter) {
Inset * ins = cur.nextInset();
if (!ins)
break;
docstring insname = ins->name();
while (!insname.empty()) {
if (insname == name || name == from_utf8("*")) {
cur.recordUndo();
lyx::dispatch(fr);
++iterations;
break;
}
size_t const i = insname.rfind(':');
if (i == string::npos)
break;
insname = insname.substr(0, i);
}
cur.forwardInset();
}
cur.endUndoGroup();
cur.reset();
processUpdateFlags(Update::Force);
if (iterations >= max_iter)
cur.errorMessage(bformat(_("inset-forall interrupted because number of actions is larger than %1$s"), max_iter));
else
cur.message(bformat(_("Applied \"%1$s\" to %2$d insets"), from_utf8(commandstr), iterations));
break;
}
case LFUN_ALL_INSETS_TOGGLE: {
string action;
string const name = split(to_utf8(cmd.argument()), action, ' ');

View File

@ -443,7 +443,6 @@ enum FuncCode
LFUN_GRAPHICS_RELOAD, // vfr 20090810
LFUN_SCREEN_SHOW_CURSOR, // vfr, 20090325
LFUN_CURSOR_FOLLOWS_SCROLLBAR_TOGGLE, // ARRae 971202
LFUN_INSET_FORALL, // lasgouttes, 20091127
LFUN_LASTACTION // end of the table
};

View File

@ -3434,27 +3434,6 @@ void LyXAction::init()
{ LFUN_GRAPHICS_RELOAD, "graphics-reload", ReadOnly | AtPoint, Edit },
/*!
* \var lyx::FuncCode lyx::LFUN_INSET_FORALL
* \li Action: Apply the given commands on insets of a given name. WARNING: use
at your own risks; this function gives you too many ways of
shooting yourself in the foot. A typical example is
inset-forall Note note-insert
which starts an infinite loop. This is mitigated by the fact
that the number of actions is arbitrarily limited to 1000.
* \li Syntax: inset-forall <NAME> <LFUN-COMMAND>
If <NAME> is *, all insets are matched.
* \li Sample: The name is used like for InsetLayout in layout files: "Note"
matches all note insets, while "Note:Note" only matches LyX
yellow note insets. The following command closes all note insets
inset-forall Note inset-toggle close
* \li Origin: lasgouttes, 27 Nov 2009
* \endvar
*/
{ LFUN_INSET_FORALL, "inset-forall", ReadOnly, Edit },
{ LFUN_NOACTION, "", Noop, Hidden }
#ifndef DOXYGEN_SHOULD_SKIP_THIS
};