From e515fb946ebd4ba72a2dbbdbd2a8083a273a3fa8 Mon Sep 17 00:00:00 2001 From: srowen Date: Fri, 6 Mar 2009 15:25:26 +0000 Subject: [PATCH] Normalize GEO: to geo: git-svn-id: http://zxing.googlecode.com/svn/trunk@873 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../google/zxing/client/result/GeoResultParser.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/core/src/com/google/zxing/client/result/GeoResultParser.java b/core/src/com/google/zxing/client/result/GeoResultParser.java index b4a03255..1c1bc1f8 100644 --- a/core/src/com/google/zxing/client/result/GeoResultParser.java +++ b/core/src/com/google/zxing/client/result/GeoResultParser.java @@ -38,12 +38,7 @@ final class GeoResultParser extends ResultParser { } // Drop geo, query portion int queryStart = rawText.indexOf('?', 4); - String geoURIWithoutQuery; - if (queryStart < 0) { - geoURIWithoutQuery = rawText.substring(4); - } else { - geoURIWithoutQuery = rawText.substring(4, queryStart); - } + String geoURIWithoutQuery = queryStart < 0 ? rawText.substring(4) : rawText.substring(4, queryStart); int latitudeEnd = geoURIWithoutQuery.indexOf(','); if (latitudeEnd < 0) { return null; @@ -62,7 +57,8 @@ final class GeoResultParser extends ResultParser { } catch (NumberFormatException nfe) { return null; } - return new GeoParsedResult(rawText, latitude, longitude, altitude); + return new GeoParsedResult(rawText.startsWith("GEO:") ? "geo:" + rawText.substring(4) : rawText, + latitude, longitude, altitude); } } \ No newline at end of file -- 2.20.1