mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
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:
committed by
Mark Liversedge
parent
dd5cdd920d
commit
a8e5777953
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user