Fix crash with LFUN_LAYOUT with multicell selection

This lfun (like several others) does not work with multicell
selection. Disable the lfun in this this case for now, until a nice
solution is found.

Fixes bug #12530.
This commit is contained in:
Jean-Marc Lasgouttes 2022-05-09 10:23:54 +02:00
parent 441b0eab23
commit e6f5f428d7
2 changed files with 5 additions and 2 deletions

View File

@ -162,6 +162,7 @@ void Text::setInsetFont(BufferView const & bv, pit_type pit,
void Text::setLayout(pit_type start, pit_type end, void Text::setLayout(pit_type start, pit_type end,
docstring const & layout) docstring const & layout)
{ {
// FIXME: make this work in multicell selection case
LASSERT(start != end, return); LASSERT(start != end, return);
Buffer const & buffer = owner_->buffer(); Buffer const & buffer = owner_->buffer();

View File

@ -3575,8 +3575,10 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
docstring const req_layout = ignoreautonests ? from_utf8(cmd.getArg(0)) : cmd.argument(); docstring const req_layout = ignoreautonests ? from_utf8(cmd.getArg(0)) : cmd.argument();
docstring const layout = resolveLayout(req_layout, cur); docstring const layout = resolveLayout(req_layout, cur);
enable = !owner_->forcePlainLayout() && !layout.empty(); // FIXME: make this work in multicell selection case
status.setOnOff(!owner_->forcePlainLayout() && isAlreadyLayout(layout, cur)); enable = !owner_->forcePlainLayout() && !layout.empty() && !cur.selIsMultiCell();
status.setOnOff(!owner_->forcePlainLayout() && !cur.selIsMultiCell()
&& isAlreadyLayout(layout, cur));
break; break;
} }