Disable LFUN_LAYOUT when layout cannot be found

Fixes bug #8077
This commit is contained in:
Jean-Marc Lasgouttes 2015-11-10 18:42:24 +01:00
parent 5c85869304
commit 147abaf234
2 changed files with 6 additions and 5 deletions

View File

@ -2966,13 +2966,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;
}

View File

@ -103,6 +103,8 @@ What's new
- Disable setting vertical lines when using a formal table (bug 9816).
- Disable function "layout" when the layout cannot be found (bug 8077).
- Fix two bibliography related bugs: No default style shown in bibliography
dialog in certain cases, and bad enabling-disabling behavior in Document>
Settings> Bibliography (bugs 9797 and 9848).