Commit dfc9dc0c authored by coppro's avatar coppro

Made spec_sort specifications featuring more than one '()' not hang.

Added error window if a script error occurs while loading a set.
parent 54d6ae31
......@@ -91,10 +91,15 @@ void NewSetWindow::OnOK(wxCommandEvent&) {
}
void NewSetWindow::done() {
try {
StyleSheetP stylesheet = stylesheet_list->getSelection<StyleSheet>();
set = new_intrusive1<Set>(stylesheet);
set->validate();
EndModal(wxID_OK);
} catch (Error& e) {
handle_error(e);
throw; // We want to crash.
}
}
void NewSetWindow::onUpdateUI(wxUpdateUIEvent& ev) {
......
......@@ -510,7 +510,7 @@ String spec_sort(const String& spec, const String& input) {
pos = end;
} 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"));
ret += cycle_sort(spec.substr(pos + 1, end - pos - 1), input);
pos = end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment