Added #2057 Show all assigned AS linkage classes in the item name (instead just one)

This commit is contained in:
Jindra Petřík
2023-10-01 18:21:38 +02:00
parent 3873e960e5
commit 0a52175bc3
8 changed files with 69 additions and 27 deletions
@@ -3308,16 +3308,26 @@ public class XFLConverter {
private static Map<Integer, String> getCharacterClasses(ReadOnlyTagList tags) {
Map<Integer, String> ret = new HashMap<>();
Set<Integer> multipleClassesCharacters = new HashSet<>();
for (Tag t : tags) {
if (t instanceof SymbolClassTag) {
SymbolClassTag sc = (SymbolClassTag) t;
for (int i = 0; i < sc.tags.size(); i++) {
if (!ret.containsKey(sc.tags.get(i)) && !ret.containsValue(sc.names.get(i))) {
ret.put(sc.tags.get(i), sc.names.get(i));
} else if (ret.containsKey(sc.tags.get(i))){
multipleClassesCharacters.add(sc.tags.get(i));
}
}
}
}
for (int i: multipleClassesCharacters) {
ret.remove(i);
}
//TODO: handle multiple classes assigned to same character (Can happen when Embed tag used with identical file)
return ret;
}