X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCutAndPaste.cpp;h=4a93966b1dab340b742a70067741a877c903dd10;hb=447a1056b4f97b102db9666a131ce85001c0676c;hp=6ab73f4be1334663f3456e9721e15a6e36c5a250;hpb=946d112ee6b5a8b341f81d5954f2d45dbb185268;p=lyx.git 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