1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-08 08:14:28 +02:00

Added file changes missing in last commit...

This commit is contained in:
2016-10-25 19:46:44 +02:00
parent b99def1b30
commit 6cc22afcdc
6 changed files with 72 additions and 52 deletions

View File

@ -2,7 +2,7 @@
bool CSVParser::loadFile(QIODevice *device)
{
bool ret;
bool res;
int ln = 1;
_errorLine = 0;
@ -17,14 +17,14 @@ bool CSVParser::loadFile(QIODevice *device)
return false;
}
qreal lat = list[0].trimmed().toDouble(&ret);
if (!ret) {
qreal lat = list[0].trimmed().toDouble(&res);
if (!res || (lat < -90.0 || lat > 90.0)) {
_errorString = "Invalid latitude.";
_errorLine = ln;
return false;
}
qreal lon = list[1].trimmed().toDouble(&ret);
if (!ret) {
qreal lon = list[1].trimmed().toDouble(&res);
if (!res || (lon < -180.0 || lon > 180.0)) {
_errorString = "Invalid longitude.";
_errorLine = ln;
return false;