a paragraph if the previous line exceeds runparams.linelen
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17233
a592a061-630c-0410-9148-
cb99ea01b6c8
}
}
- if (runparams.linelen > 0 &&
- currlinelen + word.length() > runparams.linelen) {
- os << '\n';
- pair<int, docstring> p = addDepth(depth, ltype_depth);
- os << p.second;
- currlinelen = p.first;
+ // currlinelen may be greater than runparams.linelen!
+ // => check whether word is empty and do nothing in this case
+ if (!word.empty()) {
+ if (runparams.linelen > 0 &&
+ currlinelen + word.length() > runparams.linelen) {
+ os << '\n';
+ pair<int, docstring> p = addDepth(depth, ltype_depth);
+ os << p.second;
+ currlinelen = p.first;
+ }
+ os << word;
}
- os << word;
}