mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 14:07:01 -04:00
Made spec_sort specifications featuring more than one '()' not hang.
Added error window if a script error occurs while loading a set. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@412 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -91,10 +91,15 @@ void NewSetWindow::OnOK(wxCommandEvent&) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void NewSetWindow::done() {
|
void NewSetWindow::done() {
|
||||||
|
try {
|
||||||
StyleSheetP stylesheet = stylesheet_list->getSelection<StyleSheet>();
|
StyleSheetP stylesheet = stylesheet_list->getSelection<StyleSheet>();
|
||||||
set = new_intrusive1<Set>(stylesheet);
|
set = new_intrusive1<Set>(stylesheet);
|
||||||
set->validate();
|
set->validate();
|
||||||
EndModal(wxID_OK);
|
EndModal(wxID_OK);
|
||||||
|
} catch (Error& e) {
|
||||||
|
handle_error(e);
|
||||||
|
throw; // We want to crash.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewSetWindow::onUpdateUI(wxUpdateUIEvent& ev) {
|
void NewSetWindow::onUpdateUI(wxUpdateUIEvent& ev) {
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ String spec_sort(const String& spec, const String& input) {
|
|||||||
pos = end;
|
pos = end;
|
||||||
|
|
||||||
} else if (c == _('(')) { // in a cycle
|
} else if (c == _('(')) { // in a cycle
|
||||||
size_t end = spec.find_first_of(_(')'));
|
size_t end = spec.find_first_of(_(')'), pos);
|
||||||
if (end == String::npos) throw ParseError(_("Expected ')' in sort_rule specification"));
|
if (end == String::npos) throw ParseError(_("Expected ')' in sort_rule specification"));
|
||||||
ret += cycle_sort(spec.substr(pos + 1, end - pos - 1), input);
|
ret += cycle_sort(spec.substr(pos + 1, end - pos - 1), input);
|
||||||
pos = end;
|
pos = end;
|
||||||
|
|||||||
Reference in New Issue
Block a user