]> git.lyx.org Git - features.git/commitdiff
Correctly initialize font (language) for multiple-cell paste (#11898)
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 29 Jun 2020 11:40:27 +0000 (13:40 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 30 Jun 2020 06:59:03 +0000 (08:59 +0200)
(cherry picked from commit 2cee820f718f8b2db3030dadc670d3855934096f)

src/CutAndPaste.cpp
status.23x

index dab14135b456859ed4ab7bd4ee6eb59062d9b7b6..cad8c943deeb8cf5550092e49c20198bd133eeb7 100644 (file)
@@ -1092,7 +1092,10 @@ void copySelection(Cursor const & cur, docstring const & plaintext)
                par.setLayout(bp.documentClass().plainLayout());
                // Replace (column-separating) tabs by space (#4449)
                docstring const clean_text = subst(plaintext, '\t', ' ');
-               par.insert(0, clean_text, Font(), Change(Change::UNCHANGED));
+               // For pasting into text, we set the language to the paragraph language
+               // (rather than the default_language which is always English; see #11898)
+               par.insert(0, clean_text, Font(sane_font, par.getParLanguage(bp)),
+                          Change(Change::UNCHANGED));
                pars.push_back(par);
                theCuts.push(make_pair(pars, bp.documentClassPtr()));
        } else {
index c27b58f73a73792ddf3bc7272d185fccf79d5183..4a465454e0b53ff2c765acb953c3272d01f7efdc 100644 (file)
@@ -62,6 +62,8 @@ What's new
 
 - Do not paste tabulators when pasting multiple cell outside table (bug 4449).
 
+- Fix language when pasting multiple cell outside table (bug 11898).
+
 
 * INTERNALS