commit 2089fa7fa07ec38704529302aa8d620c1fc11018
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Tue Mar 2 09:12:47 2021 +0100

    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 009efa195bf2837a007c0b070261b34a715b9b39)
---
 src/CutAndPaste.cpp |    5 ++++-
 status.23x          |    3 +++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index e31151b..b436167 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -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
diff --git a/status.23x b/status.23x
index 8296a85..2e3615d 100644
--- a/status.23x
+++ b/status.23x
@@ -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
 
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to