Tue, 09 Jul 2013 03:07:39 +0300
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);