commit 0e57e3e3f56de48147c765489eca91a165dd9989
Author: Juergen Spitzmueller <[email protected]>
Date:   Tue Feb 6 13:20:45 2018 +0100

    Do not use English, but the context language, when pasting from LaTeX
    
    Fixes: #9199
    (cherry picked from commit e85704020ba613594a38e6f016ca7905c8f84c94)
---
 src/CutAndPaste.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index f611d59..85bd551 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -1222,6 +1222,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()) {

Reply via email to