mirror of https://github.com/odrling/Aegisub
Don't let pasting styles duplicate style names. Add "Copy of " where necessary.
Originally committed to SVN as r1550.
This commit is contained in:
parent
23cb553ac4
commit
a5aa4245f0
|
@ -691,6 +691,9 @@ void DialogStyleManager::PasteToCurrent() {
|
|||
while (st.HasMoreTokens()) {
|
||||
AssStyle *s = new AssStyle(st.GetNextToken().Trim(true));
|
||||
if (s->Valid) {
|
||||
while (AssFile::top->GetStyle(s->name) != NULL)
|
||||
s->name = _T("Copy of ") + s->name;
|
||||
|
||||
AssFile::top->InsertStyle(s);
|
||||
LoadCurrentStyles(AssFile::top);
|
||||
}
|
||||
|
@ -714,6 +717,9 @@ void DialogStyleManager::PasteToStorage() {
|
|||
while (st.HasMoreTokens()) {
|
||||
AssStyle *s = new AssStyle(st.GetNextToken().Trim(true));
|
||||
if (s->Valid) {
|
||||
while (Store.GetStyle(s->name) != NULL)
|
||||
s->name = _T("Copy of ") + s->name;
|
||||
|
||||
Store.style.push_back(s);
|
||||
Store.Save(CatalogList->GetString(CatalogList->GetSelection()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue