Changeset 16951 in josm


Ignore:
Timestamp:
2020-08-28T22:38:23+02:00 (4 weeks ago)
Author:
simon04
Message:

fix #19717 - DefaultNameFormatter: add missing U+202C POP DIRECTIONAL FORMATTING

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java

    r16950 r16951  
    213213                name.append(" \u200E(");
    214214                name.append(CoordinateFormatManager.getDefaultFormat().toString(node, ", "));
    215                 name.append(')');
     215                name.append(")\u200C");
    216216            }
    217217        }
     
    306306        }
    307307        decorateNameWithId(name, way);
     308        name.append('\u200C');
    308309
    309310        String result = name.toString();
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferable.java

    r16950 r16951  
    9191            sb.append(OsmPrimitiveType.from(primitive).getAPIName()).append(' ').append(primitive.getId());
    9292        }
    93         return sb.toString().replace("\u200E", "").replace("\u200F", "");
     93        return sb.toString().replace("\u200C", "").replace("\u200E", "").replace("\u200F", "");
    9494    }
    9595}
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferable.java

    r16438 r16951  
    107107              .append('\n');
    108108        }
    109         return sb.toString().replace("\u200E", "").replace("\u200F", "");
     109        return sb.toString().replace("\u200C", "").replace("\u200E", "").replace("\u200F", "");
    110110    }
    111111
  • trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java

    r16950 r16951  
    124124    @Test
    125125    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"));
    130133    }
    131134
    132135    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));
    135137    }
    136138
    137139    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));
    140141    }
    141142
  • trunk/test/unit/org/openstreetmap/josm/data/validation/util/MultipleNameVisitorTest.java

    r16950 r16951  
    3333        MultipleNameVisitor visitor = new MultipleNameVisitor();
    3434        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());
    3636    }
    3737
     
    4646                TestUtils.newWay("addr:housename=Stark"),
    4747                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());
    4949    }
    5050}
Note: See TracChangeset for help on using the changeset viewer.