mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
parent
65e04ce08b
commit
e38e12f89b
@ -32,7 +32,7 @@ Range MapSource::zooms(QXmlStreamReader &reader)
|
||||
|
||||
if (attr.hasAttribute("min")) {
|
||||
min = attr.value("min").toString().toInt(&res);
|
||||
if (!res || !OSM::ZOOMS.contains(min)) {
|
||||
if (!res || min < 0) {
|
||||
reader.raiseError("Invalid minimal zoom level");
|
||||
return Range();
|
||||
}
|
||||
@ -41,18 +41,13 @@ Range MapSource::zooms(QXmlStreamReader &reader)
|
||||
|
||||
if (attr.hasAttribute("max")) {
|
||||
max = attr.value("max").toString().toInt(&res);
|
||||
if (!res || !OSM::ZOOMS.contains(max)) {
|
||||
if (!res || max < min) {
|
||||
reader.raiseError("Invalid maximal zoom level");
|
||||
return Range();
|
||||
}
|
||||
} else
|
||||
max = OSM::ZOOMS.max();
|
||||
|
||||
if (min > max) {
|
||||
reader.raiseError("Invalid maximal/minimal zoom level combination");
|
||||
return Range();
|
||||
}
|
||||
|
||||
return Range(min, max);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user