mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Check layout type when inserting inset over selection
When inserting inset over a selection, the layout is transferred if the inset covers full paragraphs. This is not the right policy in the case of environments. Until proper code is written and tested, limit ourselves to command layouts. Fixes bug #12251.
This commit is contained in:
parent
6c98ac5a7b
commit
2da183bf4f
@ -299,8 +299,11 @@ static bool doInsertInset(Cursor & cur, Text * text,
|
||||
* paragraph and the inset allows setting layout
|
||||
* FIXME: this does not work as expected when change tracking is on
|
||||
* However, we do not really know what to do in this case.
|
||||
* FIXME: figure out a good test in the environment case (see #12251).
|
||||
*/
|
||||
if (cur.paragraph().empty() && !inset->forcePlainLayout()) {
|
||||
if (cur.paragraph().layout().isCommand()
|
||||
&& cur.paragraph().empty()
|
||||
&& !inset->forcePlainLayout()) {
|
||||
cur.paragraph().setPlainOrDefaultLayout(bparams.documentClass());
|
||||
move_layout = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user