ErrorList & errorList, InsetText * insetPtr)
{
depth_type depth = 0;
+ bool res = true;
while (lex.isOK()) {
lex.nextToken();
continue;
if (token == "\\end_document") {
- // avoid a crash on weird documents (bug 4859)
- if (pars_.empty()) {
- Paragraph par;
- par.setInsetOwner(insetPtr);
- par.params().depth(depth);
- par.setFont(0, Font(inherit_font,
- buf.params().language));
- pars_.push_back(par);
- }
- return false;
+ res = false;
+ break;
}
if (token == "\\begin_layout") {
LYXERR0("Handling unknown body token: `" << token << '\'');
}
}
- return true;
+
+ // avoid a crash on weird documents (bug 4859)
+ if (pars_.empty()) {
+ Paragraph par;
+ par.setInsetOwner(insetPtr);
+ par.params().depth(depth);
+ par.setFont(0, Font(inherit_font,
+ buf.params().language));
+ pars_.push_back(par);
+ }
+
+ return res;
}
// Returns the current font and depth as a message.