]> git.lyx.org Git - features.git/commitdiff
Do not use English, but the context language, when pasting from LaTeX
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 6 Feb 2018 12:20:45 +0000 (13:20 +0100)
committerRichard Heck <rgheck@lyx.org>
Sat, 17 Mar 2018 19:44:05 +0000 (15:44 -0400)
Fixes: #9199
(cherry picked from commit e85704020ba613594a38e6f016ca7905c8f84c94)

src/CutAndPaste.cpp

index 7c158453eec512f7d9744fe98d1874237fa673a8..561e3e4b57c4e45c64fb7085e058877a44919c67 100644 (file)
@@ -1225,6 +1225,10 @@ 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()) {