| Summary: | KmlcoordinateTagHandler can't handle space after comma in coordinates | ||
|---|---|---|---|
| Product: | [Applications] marble | Reporter: | J Jones <bjustjones> |
| Component: | general | Assignee: | marble-bugs |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | nienhueser |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | 1.1.0 | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | http://commits.kde.org/marble/af1fb70c7bdcc513c7e13a8d6ad417fe0853adf5 | Version Fixed/Implemented In: | 1.5.0/KDE-4.10.0 |
| Sentry Crash Report: | |||
Git commit af1fb70c7bdcc513c7e13a8d6ad417fe0853adf5 by Dennis Nienhüser. Committed on 24/11/2012 at 12:23. Pushed by nienhueser into branch 'master'. Fix parsing coordinate strings that don't follow kml specs exactly. Coordinates like '1, 2, 3 4 ,5, 6' are not valid coordinate strings (should be '1,2,3 4,5,6') but can still be parsed. Patch by Valery Kharitonov, thanks! REVIEW: 103525 FIXED-IN: 1.5.0/KDE-4.10.0 M +31 -2 src/lib/geodata/handlers/kml/KmlCoordinatesTagHandler.cpp http://commits.kde.org/marble/af1fb70c7bdcc513c7e13a8d6ad417fe0853adf5 |
Version: unspecified (using KDE 4.4.5) OS: Linux In function GeoNode* KmlcoordinatesTagHandler::parse( GeoParser& parser ) in file KmlcoordinateTagHandler .cpp the line 53: QStringList coordinatesLines = parser.readElementText().trimmed().split( QRegExp("\\s"), QString::SkipEmptyParts ); splits coordinates by spaces. so <coordinates> -113.55, 52.5 </coordinates> will be broken into two pairs because of the space in the middle maybe a fancier QRegExpression? or a .replace(QRegExp("\\s*,\\s*"),",") thrown in there after the trimmed() in order to collapse spaces around commas? as in: QStringList coordinatesLines = parser.readElementText().trimmed().replace(QRegExp("\\s*,\\s*"),",").split( QRegExp("\\s"), QString::SkipEmptyParts ); Reproducible: Always Steps to Reproduce: feed in a kml file with space around the commas in <coordinates> Actual Results: bad kml points are skipped (placemarks before and after in kml file are drawn though) Expected Results: all placemarks drawn