X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCutAndPaste.cpp;h=f79d4ace7c7dc8533df839c169e3e0ab8cc35c8b;hb=bca1b63d89e27b31b089ab48c63368640084b3a6;hp=6ab73f4be1334663f3456e9721e15a6e36c5a250;hpb=946d112ee6b5a8b341f81d5954f2d45dbb185268;p=lyx.git diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 6ab73f4be1..f79d4ace7c 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 @@ -1260,6 +1263,7 @@ bool pasteClipboardText(Cursor & cur, ErrorList & errorList, bool asParagraphs, string lyx = theClipboard().getAsLyX(); if (!lyx.empty()) { Buffer buffer(string(), false); + buffer.setInternal(true); buffer.setUnnamed(true); if (buffer.readString(lyx)) { cur.recordUndo(); @@ -1293,6 +1297,7 @@ bool pasteClipboardText(Cursor & cur, ErrorList & errorList, bool asParagraphs, available = !text.empty(); if (available) { Buffer buffer(string(), false); + buffer.setInternal(true); buffer.setUnnamed(true); available = buffer.importString(names[i], text, errorList); if (available)