From 009efa195bf2837a007c0b070261b34a715b9b39 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 2 Mar 2021 09:12:47 +0100 Subject: [PATCH] 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. --- src/CutAndPaste.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 6ab73f4be1..4a93966b1d 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -853,7 +853,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