Made the style sorting code only append each style once even when multiple styles have the same name. Closes #922.

Originally committed to SVN as r3163.
This commit is contained in:
Thomas Goyne 2009-07-18 04:37:43 +00:00
parent 0fa0d9d17e
commit c02f953ee0

View file

@ -1084,17 +1084,17 @@ void DialogStyleManager::MoveStyles(bool storage, int type) {
}
// Get sorted list
wxArrayString stylNames;
for (int i=0;i<nStyles;i++) stylNames.Add(srcStyls->at(i)->name.Lower());
stylNames.Sort();
AssStyle *curStyl;
wxArrayString styleNames;
for (int i=0; i < nStyles; i++) styleNames.Add(srcStyls->at(i)->name);
styleNames.Sort();
// Find each and copy it
for (int i=0;i<nStyles;i++) {
for (int j=0;j<nStyles;j++) {
curStyl = srcStyls->at(j);
if (curStyl->name.Lower() == stylNames[i]) {
styls.push_back(curStyl);
std::list<AssStyle *> styles(srcStyls->begin(), srcStyls->end());
for (int i = 0; i < nStyles; i++) {
for (std::list<AssStyle *>::iterator style = styles.begin(); style != styles.end(); style++) {
if ((*style)->name == styleNames[i]) {
styls.push_back(*style);
styles.erase(style);
break;
}
}
}