commit 73c41a3c418fcd7002ba47f96953f3e9b44f3ed3
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Fri Mar 9 12:15:19 2018 +0100

    Reset buffer language only if we have something to reset.
    
    Fixes: #11063
    (cherry picked from commit 599b1222f7da0222cd1802af69abefb81145f566)
---
 src/CutAndPaste.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index a6aa029..553f68d 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -1225,13 +1225,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);

Reply via email to