]> git.lyx.org Git - lyx.git/commitdiff
Avoid pointless 'undefined flex inset' errors
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 2 Mar 2021 08:12:47 +0000 (09:12 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 6 Mar 2021 18:39:29 +0000 (19:39 +0100)
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
status.23x

index e31151b8f2abf4dc93c2b8489c59498d3abe8b5a..b436167308f11299235f710c29842f167cf65ab4 100644 (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
index 8296a854e618d7c28b765cd36daa5cf41ac44705..2e3615dd2ff2d78322f900e8d1970a6d460a9611 100644 (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