forked from mia/Aegisub
Made the check for duplicate style names when creating or editing styles case insensitive. Closes $777.
Originally committed to SVN as r3161.
This commit is contained in:
parent
a7d0b591f8
commit
6608ff47b5
1 changed files with 2 additions and 15 deletions
|
@ -436,21 +436,8 @@ void DialogStyleEditor::Apply (bool apply,bool close) {
|
||||||
|
|
||||||
// Check if style name is unique
|
// Check if style name is unique
|
||||||
for (unsigned int i=0;i<styles.Count();i++) {
|
for (unsigned int i=0;i<styles.Count();i++) {
|
||||||
if (styles[i] == newStyleName) {
|
if (newStyleName.CmpNoCase(styles[i]) == 0) {
|
||||||
bool ok = true;
|
if ((isLocal && grid->ass->GetStyle(styles[i]) != style) || (!isLocal && store->GetStyle(styles[i]) != style)) {
|
||||||
|
|
||||||
// Local
|
|
||||||
if (isLocal) {
|
|
||||||
if (grid->ass->GetStyle(styles[i]) != style) ok = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Storage
|
|
||||||
else {
|
|
||||||
if (store->GetStyle(styles[i]) != style) ok = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Repeated name
|
|
||||||
if (!ok) {
|
|
||||||
wxMessageBox(_T("There is already a style with this name. Please choose another name."),_T("Style name conflict."),wxICON_ERROR);
|
wxMessageBox(_T("There is already a style with this name. Please choose another name."),_T("Style name conflict."),wxICON_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue