From 53167af9e142d1f8acbebaf19881b7123feb84bf Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Wed, 31 Jan 2018 15:17:54 +0200 Subject: [PATCH] Don't export deleted tags --- OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java index 15ed31e156..4f1b2904e7 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java @@ -793,7 +793,7 @@ public class OsmEditsFragment extends OsmAndListFragment implements SendPoiDialo StringBuilder sb = new StringBuilder(); for (String tag : point.getEntity().getTagKeySet()) { String val = point.getEntity().getTag(tag); - if (val == null || val.length() == 0 || tag.length() == 0 || "poi_type_tag".equals(tag)) { + if (isNotValid(tag, val)) { continue; } sb.append(tag).append(" : "); @@ -802,6 +802,11 @@ public class OsmEditsFragment extends OsmAndListFragment implements SendPoiDialo return sb.toString(); } + private boolean isNotValid(String tag, String val) { + return val == null || val.length() == 0 || tag.length() == 0 + || tag.startsWith(EditPoiData.REMOVE_TAG_PREFIX) || tag.equals("poi_type_tag"); + } + private void writeContent(XmlSerializer sz, OsmPoint[] points, OsmPoint.Action a) throws IllegalArgumentException, IllegalStateException, IOException { for (OsmPoint point : points) { if (point.getGroup() == Group.POI) { @@ -814,7 +819,7 @@ public class OsmEditsFragment extends OsmAndListFragment implements SendPoiDialo sz.attribute("", "version", "1"); for (String tag : p.getEntity().getTagKeySet()) { String val = p.getEntity().getTag(tag); - if (val == null || val.length() == 0 || tag.length() == 0 || "poi_type_tag".equals(tag)) { + if (isNotValid(tag, val)) { continue; } sz.startTag("", "tag");