Do not add symbols twice to Encoding::symbolsList()

Also sort the list properly.

Fixes #10644
This commit is contained in:
Juergen Spitzmueller 2017-05-01 17:34:25 +02:00
parent eb4723a589
commit 0887f89350
2 changed files with 6 additions and 2 deletions

View File

@ -264,11 +264,14 @@ vector<char_type> Encoding::symbolsList() const
// add those below start_encodable_
for (char_type c = 0; c < start_encodable_; ++c)
symbols.push_back(c);
// now the ones from the unicodesymbols file
// now the ones from the unicodesymbols file that are not already there
CharInfoMap::const_iterator const end = unicodesymbols.end();
CharInfoMap::const_iterator it = unicodesymbols.begin();
for (; it != end; ++it)
symbols.push_back(it->first);
if (find(symbols.begin(), symbols.end(), it->first) == symbols.end())
symbols.push_back(it->first);
// finally, sort the vector
sort(symbols.begin(), symbols.end());
return symbols;
}

View File

@ -43,6 +43,7 @@ What's new
* USER INTERFACE
- Remove duplicate entries from the Symbols dialog (bug 10644).
* INTERNALS