Improve the error message in the fonts collector when a style does not exist
Closes #1661.
This commit is contained in:
parent
466b69ba59
commit
f0ff8c6179
1 changed files with 8 additions and 1 deletions
|
@ -72,8 +72,15 @@ FontCollector::FontCollector(FontCollectorStatusCallback status_callback, FontFi
|
||||||
void FontCollector::ProcessDialogueLine(const AssDialogue *line, int index) {
|
void FontCollector::ProcessDialogueLine(const AssDialogue *line, int index) {
|
||||||
if (line->Comment) return;
|
if (line->Comment) return;
|
||||||
|
|
||||||
|
auto style_it = styles.find(line->Style);
|
||||||
|
if (style_it == end(styles)) {
|
||||||
|
status_callback(wxString::Format(_("Style '%s' does not exist\n"), to_wx(line->Style)), 2);
|
||||||
|
++missing;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
boost::ptr_vector<AssDialogueBlock> blocks(line->ParseTags());
|
boost::ptr_vector<AssDialogueBlock> blocks(line->ParseTags());
|
||||||
StyleInfo style = styles[line->Style];
|
StyleInfo style = style_it->second;
|
||||||
StyleInfo initial = style;
|
StyleInfo initial = style;
|
||||||
|
|
||||||
bool overriden = false;
|
bool overriden = false;
|
||||||
|
|
Loading…
Reference in a new issue