Modify line endings in the ride editor

On mac systems, when copying data from excel and pasting into the ride
editor GC would complain about the data ranges not being the same size.
This is a result of the fact that excel mac terminates lines with a CR
(\r) rather than a NL (\n).  This patch changes the behavior so that we
check for all three commonly occurring line endings CR, NL and CRNL.

fixes #135
This commit is contained in:
Jamie Kimberley
2010-08-30 13:09:26 -04:00
committed by Mark Liversedge
parent dd5cdd920d
commit a8e5777953

View File

@@ -807,7 +807,9 @@ RideEditor::getPaste(QVector<QVector<double> >&cells, QStringList &seps, QString
regexpStr += "]";
QRegExp sep(regexpStr); // RegExp for seperators
foreach(QString line, text.split("\n")) {
QRegExp ELine(("\n|\r|\r\n")); //RegExp for line endings
foreach(QString line, text.split(ELine)) {
if (line == "") continue;
if (hasHeader && first == true) {