// 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);
+ 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(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();
+ 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_)
// do the real work
ParIterator parit = cbuf.par_iterator_begin();
- updateLabels(parit);
+ updateLabels(parit, out);
if (master != this)
// TocBackend update will be done later.
if (par.params().startOfAppendix()) {
// FIXME: only the counter corresponding to toplevel
- // sectionning should be reset
+ // sectioning should be reset
counters.reset();
counters.appendix(true);
}
}
-void Buffer::updateLabels(ParIterator & parit) const
+void Buffer::updateLabels(ParIterator & parit, bool out) const
{
LASSERT(parit.pit() == 0, /**/);
InsetList::const_iterator end = parit->insetList().end();
for (; iit != end; ++iit) {
parit.pos() = iit->pos;
- iit->inset->updateLabels(parit);
+ iit->inset->updateLabels(parit, out);
}
}
}
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;
}