diff --git a/src/Text3.cpp b/src/Text3.cpp index 8efec47202..9edda1b652 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -3108,13 +3108,12 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, break; case LFUN_LAYOUT: { - enable = !cur.inset().forcePlainLayout(); - + DocumentClass const & tclass = cur.buffer()->params().documentClass(); docstring layout = cmd.argument(); - if (layout.empty()) { - DocumentClass const & tclass = cur.buffer()->params().documentClass(); + if (layout.empty()) layout = tclass.defaultLayoutName(); - } + enable = !cur.inset().forcePlainLayout() && tclass.hasLayout(layout); + flag.setOnOff(layout == cur.paragraph().layout().name()); break; }