[LyX/master] Avoid pointless 'undefined flex inset' errors
Jean-Marc Lasgouttes
lasgouttes at lyx.org
Thu Mar 4 09:08:02 UTC 2021
commit 009efa195bf2837a007c0b070261b34a715b9b39
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
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.
---
src/CutAndPaste.cpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index 6ab73f4..4a93966 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
More information about the lyx-cvs
mailing list