- // this function re-creates the cache of inset pointers
- //lyxerr << "converting:\n" << *this << endl;
- Inset * inset = &buf->inset();
- DocIterator dit = DocIterator(buf, inset);
- for (size_t i = 0, n = data_.size(); i != n; ++i) {
- if (inset == 0) {
- // FIXME
- LYXERR0(" Should not happen, but does e.g. after "
- "C-n C-l C-z S-C-z\n"
- << " or when a Buffer has been concurrently edited by two views"
- << '\n' << "dit: " << dit << '\n'
- << " lastpos: " << dit.lastpos());
- dit.fixIfBroken();
- break;
- }
- dit.push_back(data_[i]);
- dit.top().inset_ = inset;
- if (dit.fixIfBroken())
- break;
- if (i + 1 != n)
- inset = dit.nextInset();
- }
- //lyxerr << "convert:\n" << *this << " to:\n" << dit << endl;