From e6f5f428d7fbb10dde24aca79fca7623af5f7749 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 9 May 2022 10:23:54 +0200 Subject: [PATCH] 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. --- src/Text2.cpp | 1 + src/Text3.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Text2.cpp b/src/Text2.cpp index 902674060a..82cc994be5 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -162,6 +162,7 @@ void Text::setInsetFont(BufferView const & bv, pit_type pit, void Text::setLayout(pit_type start, pit_type end, docstring const & layout) { + // FIXME: make this work in multicell selection case LASSERT(start != end, return); Buffer const & buffer = owner_->buffer(); diff --git a/src/Text3.cpp b/src/Text3.cpp index f871bb31d1..8143f39daa 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -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 layout = resolveLayout(req_layout, cur); - enable = !owner_->forcePlainLayout() && !layout.empty(); - status.setOnOff(!owner_->forcePlainLayout() && isAlreadyLayout(layout, cur)); + // FIXME: make this work in multicell selection case + enable = !owner_->forcePlainLayout() && !layout.empty() && !cur.selIsMultiCell(); + status.setOnOff(!owner_->forcePlainLayout() && !cur.selIsMultiCell() + && isAlreadyLayout(layout, cur)); break; } -- 2.39.5