handle empty lines better

Tue, 09 Jul 2013 03:07:39 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Tue, 09 Jul 2013 03:07:39 +0300
changeset 369
0060d11e4991
parent 368
436ceec98c4f
child 370
843b3dbbd849

handle empty lines better

src/gui_editactions.cpp file | annotate | diff | comparison | revisions
--- a/src/gui_editactions.cpp	Tue Jul 09 03:04:31 2013 +0300
+++ b/src/gui_editactions.cpp	Tue Jul 09 03:07:39 2013 +0300
@@ -50,7 +50,10 @@
 	// Now, copy the contents into the clipboard.
 	str data;
 	for (LDObject* obj : objs) {
-		data += ( obj->raw () + "\n" );
+		if( data.length() > 0 )
+			data += "\n";
+		
+		data += obj->raw ();
 		++num;
 	}
 	
@@ -86,7 +89,7 @@
 	g_win->sel ().clear ();
 	int num = 0;
 	
-	for( str line : clipboardText.split( "\n", QString::SkipEmptyParts ))
+	for( str line : clipboardText.split( "\n" ))
 	{
 		LDObject* pasted = parseLine (line);
 		g_curfile->insertObj (idx++, pasted);

mercurial