Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-08-03 19:45:37 +02:00
commit a8ae9d7524

View file

@ -243,8 +243,17 @@ public class MapRenderingTypes {
return getRuleType(tag, val, true); return getRuleType(tag, val, true);
} }
private String lc(String a) {
if(a != null) {
return a.toLowerCase();
}
return a;
}
protected MapRulType getRuleType(String tag, String val, boolean poi) { protected MapRulType getRuleType(String tag, String val, boolean poi) {
Map<String, MapRulType> types = getEncodingRuleTypes(); Map<String, MapRulType> types = getEncodingRuleTypes();
tag = lc(tag);
val = lc(val);
MapRulType rType = types.get(constructRuleKey(tag, val)); MapRulType rType = types.get(constructRuleKey(tag, val));
if (rType == null || (!rType.isPOI() && poi) || (!rType.isMap() && !poi)) { if (rType == null || (!rType.isPOI() && poi) || (!rType.isMap() && !poi)) {
rType = types.get(constructRuleKey(tag, null)); rType = types.get(constructRuleKey(tag, null));
@ -417,8 +426,8 @@ public class MapRenderingTypes {
} }
protected MapRulType parseBaseRuleType(XmlPullParser parser, String poiParentCategory, String poiParentPrefix, String parentOrder, boolean filterOnlyMap) { protected MapRulType parseBaseRuleType(XmlPullParser parser, String poiParentCategory, String poiParentPrefix, String parentOrder, boolean filterOnlyMap) {
String tag = parser.getAttributeValue("", "tag"); String tag = lc(parser.getAttributeValue("", "tag"));
String value = parser.getAttributeValue("", "value"); String value = lc(parser.getAttributeValue("", "value"));
String additional = parser.getAttributeValue("", "additional"); String additional = parser.getAttributeValue("", "additional");
if (value != null && value.length() == 0) { //$NON-NLS-1$ if (value != null && value.length() == 0) { //$NON-NLS-1$
value = null; value = null;
@ -486,9 +495,9 @@ public class MapRenderingTypes {
rtype.poiPrefix = poiPrefix; rtype.poiPrefix = poiPrefix;
} }
if (!rtype.isAdditional() && !rtype.isText()) {
rtype.onlyPoint = Boolean.parseBoolean(parser.getAttributeValue("", "point")); //$NON-NLS-1$ rtype.onlyPoint = Boolean.parseBoolean(parser.getAttributeValue("", "point")); //$NON-NLS-1$
rtype.relation = Boolean.parseBoolean(parser.getAttributeValue("", "relation")); //$NON-NLS-1$ rtype.relation = Boolean.parseBoolean(parser.getAttributeValue("", "relation")); //$NON-NLS-1$
if (!rtype.isAdditional() && !rtype.isText()) {
rtype.namePrefix = parser.getAttributeValue("", "namePrefix"); //$NON-NLS-1$ rtype.namePrefix = parser.getAttributeValue("", "namePrefix"); //$NON-NLS-1$
if (rtype.namePrefix == null) { if (rtype.namePrefix == null) {
rtype.namePrefix = ""; rtype.namePrefix = "";