From: Juergen Spitzmueller Date: Fri, 9 Mar 2018 11:15:19 +0000 (+0100) Subject: Reset buffer language only if we have something to reset. X-Git-Tag: lyx-2.4.0dev-acb2ca7b~3733 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=599b1222f7da0222cd1802af69abefb81145f566;p=features.git Reset buffer language only if we have something to reset. Fixes: #11063 --- diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 1d4299ad6c..e27de0d18b 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -1239,13 +1239,13 @@ bool pasteClipboardText(Cursor & cur, ErrorList & errorList, bool asParagraphs, Buffer buffer("", false); buffer.setUnnamed(true); available = buffer.importString(names[i], text, errorList); - // TeX2lyx (also used in the HTML chain) assumes English as document language - // if no language is explicitly set (as is the case here). - // We thus reset the temp buffer's language to the context language - buffer.changeLanguage(buffer.language(), cur.getFont().language()); if (available) available = !buffer.paragraphs().empty(); if (available && !buffer.paragraphs()[0].empty()) { + // TeX2lyx (also used in the HTML chain) assumes English as document language + // if no language is explicitly set (as is the case here). + // We thus reset the temp buffer's language to the context language + buffer.changeLanguage(buffer.language(), cur.getFont().language()); cur.recordUndo(); pasteParagraphList(cur, buffer.paragraphs(), buffer.params().documentClassPtr(), errorList);