summaryrefslogtreecommitdiffstats
path: root/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-07 17:19:58 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-07 17:19:58 +0100
commit088c9003c03dbbed38ced59587c20ed8218de0ad (patch)
treed15f1716db86ca1eca5849478626b664eb3a7d58 /qthelper.cpp
parent5d2436b504f3329a63d6005d2317faa0dfc2bb89 (diff)
downloadsubsurface-088c9003c03dbbed38ced59587c20ed8218de0ad.tar.gz
Correctly parse GPS coordinates with a ',' between lat and lon
We use this in our own HTML export - and Google uses that in their standard way of describing GPS coordinates. With this the new test passes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qthelper.cpp')
-rw-r--r--qthelper.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/qthelper.cpp b/qthelper.cpp
index 00adb5ad8..a963ad73f 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -425,6 +425,13 @@ static bool parseCoord(const QString& txt, int& pos, const QString& positives,
value += number / 3600.0;
numberDefined = false;
secondsDefined = true;
+ } else if ((numberDefined || minutesDefined || secondsDefined) &&
+ (txt[pos] == ',' || txt[pos] == ';')) {
+ // next coordinate coming up
+ // eat the ',' and any subsequent white space
+ while (txt[++pos].isSpace())
+ /* nothing */ ;
+ break;
} else {
return false;
}