Allow arguments in PassThru environments (bug #7646)

This commit is contained in:
Juergen Spitzmueller 2012-11-20 16:58:51 +01:00
parent 0f866762b2
commit 99e611b2d8

View File

@ -2321,6 +2321,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
FontInfo const & fontinfo = cur.real_current_font.fontInfo(); FontInfo const & fontinfo = cur.real_current_font.fontInfo();
bool enable = true; bool enable = true;
bool allow_in_passthru = false;
InsetCode code = NO_CODE; InsetCode code = NO_CODE;
switch (cmd.action()) { switch (cmd.action()) {
@ -2517,6 +2518,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
break; break;
case LFUN_ARGUMENT_INSERT: { case LFUN_ARGUMENT_INSERT: {
code = ARG_CODE; code = ARG_CODE;
allow_in_passthru = true;
string const arg = cmd.getArg(0); string const arg = cmd.getArg(0);
if (arg.empty()) { if (arg.empty()) {
enable = false; enable = false;
@ -2913,7 +2915,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
if (code != NO_CODE if (code != NO_CODE
&& (cur.empty() && (cur.empty()
|| !cur.inset().insetAllowed(code) || !cur.inset().insetAllowed(code)
|| cur.paragraph().layout().pass_thru)) || (cur.paragraph().layout().pass_thru && !allow_in_passthru)))
enable = false; enable = false;
flag.setEnabled(enable); flag.setEnabled(enable);