Changeset 16951 in josm
- Timestamp:
- 2020-08-28T22:38:23+02:00 (4 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java
r16950 r16951 213 213 name.append(" \u200E("); 214 214 name.append(CoordinateFormatManager.getDefaultFormat().toString(node, ", ")); 215 name.append( ')');215 name.append(")\u200C"); 216 216 } 217 217 } … … 306 306 } 307 307 decorateNameWithId(name, way); 308 name.append('\u200C'); 308 309 309 310 String result = name.toString(); -
trunk/src/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferable.java
r16950 r16951 91 91 sb.append(OsmPrimitiveType.from(primitive).getAPIName()).append(' ').append(primitive.getId()); 92 92 } 93 return sb.toString().replace("\u200E", "").replace("\u200F", ""); 93 return sb.toString().replace("\u200C", "").replace("\u200E", "").replace("\u200F", ""); 94 94 } 95 95 } -
trunk/src/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferable.java
r16438 r16951 107 107 .append('\n'); 108 108 } 109 return sb.toString().replace("\u200E", "").replace("\u200F", ""); 109 return sb.toString().replace("\u200C", "").replace("\u200E", "").replace("\u200F", ""); 110 110 } 111 111 -
trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java
r16950 r16951 124 124 @Test 125 125 public void testWayName() { 126 assertEquals("building (0 nodes)", getFormattedWayName("building=yes")); 127 assertEquals("House number 123 (0 nodes)", getFormattedWayName("building=yes addr:housenumber=123")); 128 assertEquals("House number 123 at FooStreet (0 nodes)", getFormattedWayName("building=yes addr:housenumber=123 addr:street=FooStreet")); 129 assertEquals("House FooName (0 nodes)", getFormattedWayName("building=yes addr:housenumber=123 addr:housename=FooName")); 126 assertEquals("\u200Ebuilding\u200E (0 nodes)\u200C", getFormattedWayName("building=yes")); 127 assertEquals("\u200EHouse number 123\u200E (0 nodes)\u200C", 128 getFormattedWayName("building=yes addr:housenumber=123")); 129 assertEquals("\u200EHouse number 123 at FooStreet\u200E (0 nodes)\u200C", 130 getFormattedWayName("building=yes addr:housenumber=123 addr:street=FooStreet")); 131 assertEquals("\u200EHouse FooName\u200E (0 nodes)\u200C", 132 getFormattedWayName("building=yes addr:housenumber=123 addr:housename=FooName")); 130 133 } 131 134 132 135 static String getFormattedRelationName(String tagsString) { 133 return DefaultNameFormatter.getInstance().format((Relation) OsmUtils.createPrimitive("relation " + tagsString)) 134 .replace("\u200E", "").replace("\u200F", ""); 136 return DefaultNameFormatter.getInstance().format((Relation) OsmUtils.createPrimitive("relation " + tagsString)); 135 137 } 136 138 137 139 static String getFormattedWayName(String tagsString) { 138 return DefaultNameFormatter.getInstance().format((Way) OsmUtils.createPrimitive("way " + tagsString)) 139 .replace("\u200E", "").replace("\u200F", ""); 140 return DefaultNameFormatter.getInstance().format((Way) OsmUtils.createPrimitive("way " + tagsString)); 140 141 } 141 142 -
trunk/test/unit/org/openstreetmap/josm/data/validation/util/MultipleNameVisitorTest.java
r16950 r16951 33 33 MultipleNameVisitor visitor = new MultipleNameVisitor(); 34 34 visitor.visit(Arrays.asList(new Way(), new Way())); 35 assertEquals("2 ways: 0(0 nodes), 0(0 nodes)", visitor.toString());35 assertEquals("2 ways: \u200E0\u200E (0 nodes)\u200C, \u200E0\u200E (0 nodes)\u200C", visitor.toString()); 36 36 } 37 37 … … 46 46 TestUtils.newWay("addr:housename=Stark"), 47 47 TestUtils.newRelation("type=route"))); 48 assertEquals("3 objects: foo, House Stark(0 nodes), route (0, 0 members)", visitor.toString());48 assertEquals("3 objects: foo, \u200EHouse Stark\u200E (0 nodes)\u200C, route (0, 0 members)", visitor.toString()); 49 49 } 50 50 }
Note:
See TracChangeset
for help on using the changeset viewer.