commit 147abaf234b788a820b0d5caad0d5d149d3f8aad
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Tue Nov 10 18:42:24 2015 +0100
Disable LFUN_LAYOUT when layout cannot be found
Fixes bug #8077
diff --git a/src/Text3.cpp b/src/Text3.cpp
index 372009b..59fe8b1 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -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;
}
diff --git a/status.21x b/status.21x
index 4db3824..86748d3 100644
--- a/status.21x
+++ b/status.21x
@@ -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).