Changeset 18610 in josm for trunk/src


Ignore:
Timestamp:
2022-12-07T14:52:06+01:00 (3 years ago)
Author:
taylor.smock
Message:

Fix #21324: Command stack says "pasting 1 tag to [number] objects" regardless of how many tags are pasted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/AbstractTagPaster.java

    r14143 r18610  
    6262    protected static void commitCommands(Collection<? extends OsmPrimitive> selection, List<Command> commands) {
    6363        if (!commands.isEmpty()) {
    64             String title1 = trn("Pasting {0} tag", "Pasting {0} tags", commands.size(), commands.size());
     64            final int changedTags = commands.stream()
     65                    .filter(ChangePropertyCommand.class::isInstance)
     66                    .map(ChangePropertyCommand.class::cast)
     67                    .mapToInt(p -> p.getTags().size())
     68                    .sum();
     69            String title1 = trn("Pasting {0} tag", "Pasting {0} tags", changedTags, changedTags);
    6570            String title2 = trn("to {0} object", "to {0} objects", selection.size(), selection.size());
    6671            @I18n.QuirkyPluralString
Note: See TracChangeset for help on using the changeset viewer.