Avoid pointless 'undefined flex inset' errors

When switching class, it does not make sense to flag flex insets that
are undefined if they were already undefined before.

Part of bug #12163.

(cherry picked from commit 009efa195b)
This commit is contained in:
Jean-Marc Lasgouttes 2021-03-02 09:12:47 +01:00
parent 8c00556d57
commit 2089fa7fa0
2 changed files with 7 additions and 1 deletions

View File

@ -835,7 +835,10 @@ void switchBetweenClasses(DocumentClassConstPtr oldone,
docstring const & n = newone->insetLayout(layoutName).name();
bool const is_undefined = n.empty() ||
n == DocumentClass::plainInsetLayout().name();
if (!is_undefined)
docstring const & oldn = oldone->insetLayout(layoutName).name();
bool const was_undefined = oldn.empty() ||
oldn == DocumentClass::plainInsetLayout().name();
if (!is_undefined || was_undefined)
continue;
// The flex inset is undefined in newtc

View File

@ -103,6 +103,9 @@ What's new
- Fix wrap-around of spellchecker (#10383).
- Avoid pointless 'undefined flex inset' errors when changing document
settings (bug 12163).
* INTERNALS