Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-05-23 16:12:51 +02:00
commit 84b0b30500

View file

@ -183,7 +183,6 @@ public class MapRenderingTypes {
rType = MapRulType.createAdditional(tag, val);
rType.additional = true;
rType.order = parent.order;
rType.applyToTagValue = parent.applyToTagValue;
rType.onlyMap = parent.onlyMap;
rType.onlyPoi = parent.onlyPoi;
rType.onlyPoint = parent.onlyPoint;
@ -216,24 +215,11 @@ public class MapRenderingTypes {
if(rType == nameEnRuleType && Algorithms.objectEquals(val, tags.get(OSMTagKey.NAME))) {
continue;
}
if(rType.targetTagValue != null) {
rType = rType.targetTagValue;
}
if (rType.isAdditionalOrText()) {
boolean applied = rType.applyToTagValue == null;
if(!applied) {
Iterator<TagValuePattern> it = rType.applyToTagValue.iterator();
while(!applied && it.hasNext()) {
TagValuePattern nv = it.next();
applied = nv.isApplicable(tags);
}
}
if (applied) {
if (!rType.isText() && !Algorithms.isEmpty(rType.tagValuePattern.value)) {
val = rType.tagValuePattern.value;
}
map.put(rType.tagValuePattern.tag, val);
if (!rType.isText() && !Algorithms.isEmpty(rType.tagValuePattern.value)) {
val = rType.tagValuePattern.value;
}
map.put(rType.tagValuePattern.tag, val);
}
}
}
@ -373,32 +359,13 @@ public class MapRenderingTypes {
if(filterOnlyMap && rtype.onlyMap) {
return null;
}
String targetTag = parser.getAttributeValue("", "target_tag");
String targetValue = parser.getAttributeValue("", "target_value");
if (targetTag != null || targetValue != null) {
if (targetTag == null) {
targetTag = rtype.getTag();
}
if (targetValue == null) {
targetValue = rtype.getValue();
}
rtype.targetTagValue = types.get(constructRuleKey(targetTag, targetValue));
if (rtype.targetTagValue == null) {
throw new RuntimeException("Illegal target tag/value " + targetTag + " " + targetValue + " for " + tag + " / " + value);
}
}
String order = parser.getAttributeValue("", "order");
if(!Algorithms.isEmpty(order)) {
rtype.order = Integer.parseInt(order);
} else if (parentCategory != null) {
rtype.order = parentCategory.order;
}
String applyTo = parser.getAttributeValue("", "apply_to");
String applyValue = parser.getAttributeValue("", "apply_value");
if (applyTo != null || applyValue != null) {
rtype.applyToTagValue = new HashSet<TagValuePattern>();
rtype.applyToTagValue.add(new TagValuePattern(applyTo, applyValue));
}
if(!rtype.onlyMap) {
rtype = registerRuleType(rtype);
}
@ -449,8 +416,6 @@ public class MapRenderingTypes {
tagName = rtype.namePrefix + tagName;
}
MapRulType mt = MapRulType.createText(tagName);
mt.applyToTagValue = new HashSet<TagValuePattern>();
mt.applyToTagValue.add(rtype.tagValuePattern);
mt = registerRuleType(mt);
rtype.names[i] = mt;
}
@ -468,17 +433,6 @@ public class MapRenderingTypes {
MapRulType mapRulType = types.get(keyVal);
if(mapRulType.isAdditional() || mapRulType.isText() ) {
rt.id = mapRulType.id;
if(rt.applyToTagValue != null ){
if(mapRulType.applyToTagValue == null) {
rt.applyToTagValue = null;
} else {
rt.applyToTagValue.addAll(mapRulType.applyToTagValue);
mapRulType.applyToTagValue.addAll(rt.applyToTagValue);
}
} else {
mapRulType.applyToTagValue = null;
}
if(rt.isMain()) {
mapRulType.main = true;
if(rt.minzoom != 0) {
@ -613,7 +567,6 @@ public class MapRenderingTypes {
protected boolean additionalText;
protected boolean main;
protected int order = 50;
protected Set<TagValuePattern> applyToTagValue = null;
protected String category = null;
protected String poiPrefix;
@ -622,9 +575,6 @@ public class MapRenderingTypes {
// poi_category was specially removed for one tag/value, to skip unnecessary objects
protected boolean poiSpecified;
protected MapRulType targetTagValue;
protected boolean relation;
// creation of only section
protected boolean onlyMap;
@ -720,10 +670,6 @@ public class MapRenderingTypes {
this.targetId = targetId;
}
public MapRulType getTargetTagValue() {
return targetTagValue;
}
public String getValue() {
return tagValuePattern.value;
}