projects
/
zxing.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Preserve query in geo URI
[zxing.git]
/
core
/
src
/
com
/
google
/
zxing
/
client
/
result
/
GeoResultParser.java
diff --git
a/core/src/com/google/zxing/client/result/GeoResultParser.java
b/core/src/com/google/zxing/client/result/GeoResultParser.java
index
3d21bf3
..
8459ddc
100644
(file)
--- a/
core/src/com/google/zxing/client/result/GeoResultParser.java
+++ b/
core/src/com/google/zxing/client/result/GeoResultParser.java
@@
-38,7
+38,15
@@
final class GeoResultParser extends ResultParser {
}
// Drop geo, query portion
int queryStart = rawText.indexOf('?', 4);
}
// Drop geo, query portion
int queryStart = rawText.indexOf('?', 4);
- String geoURIWithoutQuery = queryStart < 0 ? rawText.substring(4) : rawText.substring(4, queryStart);
+ String query;
+ String geoURIWithoutQuery;
+ if (queryStart < 0) {
+ query = null;
+ geoURIWithoutQuery = rawText.substring(4);
+ } else {
+ query = rawText.substring(queryStart + 1);
+ geoURIWithoutQuery = rawText.substring(4, queryStart);
+ }
int latitudeEnd = geoURIWithoutQuery.indexOf(',');
if (latitudeEnd < 0) {
return null;
int latitudeEnd = geoURIWithoutQuery.indexOf(',');
if (latitudeEnd < 0) {
return null;
@@
-63,7
+71,7
@@
final class GeoResultParser extends ResultParser {
} catch (NumberFormatException nfe) {
return null;
}
} catch (NumberFormatException nfe) {
return null;
}
- return new GeoParsedResult(latitude, longitude, altitude);
+ return new GeoParsedResult(latitude, longitude, altitude
, query
);
}
}
\ No newline at end of file
}
}
\ No newline at end of file