// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
-int const LYX_FORMAT = 372; // jspitzm: buffer param fontenc
+int const LYX_FORMAT = 373; // jspitzm: merge g-brief class
typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
{
LaTeXFeatures features(*this, params(), runparams);
validate(features);
- // We are going to use some of this stuff ourselves,
- // so make sure it is up to date.
- updateLabels();
+ updateLabels(UpdateMaster, true);
d->texrow.reset();
LYXERR(Debug::MACROS, "updateMacroInstances for "
<< d->filename.onlyFileName());
DocIterator it = doc_iterator_begin(this);
- DocIterator end = doc_iterator_end(this);
- for (; it != end; it.forwardPos()) {
- // look for MathData cells in InsetMathNest insets
- Inset * inset = it.nextInset();
- if (!inset)
- continue;
-
- InsetMath * minset = inset->asInsetMath();
+ it.forwardInset();
+ DocIterator const end = doc_iterator_end(this);
+ for (; it != end; it.forwardInset()) {
+ // look for MathData cells in InsetMathNest insets
+ InsetMath * minset = it.nextInset()->asInsetMath();
if (!minset)
continue;
}
-void Buffer::updateLabels(bool out, UpdateScope scope) const
+void Buffer::updateLabels(UpdateScope scope, bool out) const
{
// Use the master text class also for child documents
Buffer const * const master = masterBuffer();
// If this is a child document start with the master
if (master != this) {
bufToUpdate.insert(this);
- master->updateLabels(out);
+ master->updateLabels(UpdateMaster, out);
// Do this here in case the master has no gui associated with it. Then,
// the TocModel is not updated and TocModel::toc_ is invalid (bug 5699).
if (!master->gui_)
DocIterator const end = doc_iterator_end(this);
for (; from != end; from.forwardPos()) {
// We are only interested in text so remove the math CursorSlice.
- while (from.inMathed())
- from.forwardInset();
+ while (from.inMathed()) {
+ from.pop_back();
+ from.pos()++;
+ }
+ // If from is at the end of the document (which is possible
+ // when leaving the mathed) LyX will crash later.
+ if (from == end)
+ break;
to = from;
if (from.paragraph().spellCheck(from.pos(), to.pos(), wl, suggestions)) {
word_lang = wl;
break;
}
- from = to;
- ++progress;
+
+ // Do not increase progress when from == to, otherwise the word
+ // count will be wrong.
+ if (from != to) {
+ from = to;
+ ++progress;
+ }
}
return progress;
}