[LyX/2.3.x] Do not paste \t when pasting multiple table columns outside table (#4449)

Juergen Spitzmueller spitz at lyx.org
Tue Jun 30 06:33:24 UTC 2020


commit 41ebc1f9ae9d69b881dffb6fcee77b5041e510e6
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Mon Jun 29 12:51:15 2020 +0200

    Do not paste \t when pasting multiple table columns outside table (#4449)
    
    (cherry picked from commit 6dd990560e439dd8a1c07230519033253e1ce77c)
---
 src/CutAndPaste.cpp |    4 +++-
 status.23x          |    2 ++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index 9507b2b..dab1413 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -1090,7 +1090,9 @@ void copySelection(Cursor const & cur, docstring const & plaintext)
 		Paragraph par;
 		BufferParams const & bp = cur.buffer()->params();
 		par.setLayout(bp.documentClass().plainLayout());
-		par.insert(0, plaintext, Font(), Change(Change::UNCHANGED));
+		// Replace (column-separating) tabs by space (#4449)
+		docstring const clean_text = subst(plaintext, '\t', ' ');
+		par.insert(0, clean_text, Font(), Change(Change::UNCHANGED));
 		pars.push_back(par);
 		theCuts.push(make_pair(pars, bp.documentClassPtr()));
 	} else {
diff --git a/status.23x b/status.23x
index a536e01..c27b58f 100644
--- a/status.23x
+++ b/status.23x
@@ -60,6 +60,8 @@ What's new
 
 - Fix background color of collapsible insets with sublabel.
 
+- Do not paste tabulators when pasting multiple cell outside table (bug 4449).
+
 
 * INTERNALS
 


More information about the lyx-cvs mailing list