]> git.lyx.org Git - lyx.git/blobdiff - src/CutAndPaste.cpp
Fix bookmarks-goto inside insets.
[lyx.git] / src / CutAndPaste.cpp
index 6ab73f4be1334663f3456e9721e15a6e36c5a250..4a93966b1dab340b742a70067741a877c903dd10 100644 (file)
@@ -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