mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 19:59:46 +00:00
Reset buffer language only if we have something to reset.
Fixes: #11063
This commit is contained in:
parent
74d9277909
commit
599b1222f7
@ -1239,13 +1239,13 @@ bool pasteClipboardText(Cursor & cur, ErrorList & errorList, bool asParagraphs,
|
|||||||
Buffer buffer("", false);
|
Buffer buffer("", false);
|
||||||
buffer.setUnnamed(true);
|
buffer.setUnnamed(true);
|
||||||
available = buffer.importString(names[i], text, errorList);
|
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)
|
if (available)
|
||||||
available = !buffer.paragraphs().empty();
|
available = !buffer.paragraphs().empty();
|
||||||
if (available && !buffer.paragraphs()[0].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();
|
cur.recordUndo();
|
||||||
pasteParagraphList(cur, buffer.paragraphs(),
|
pasteParagraphList(cur, buffer.paragraphs(),
|
||||||
buffer.params().documentClassPtr(), errorList);
|
buffer.params().documentClassPtr(), errorList);
|
||||||
|
Loading…
Reference in New Issue
Block a user