+ // this function re-creates the cache of inset pointers
+ //lyxerr << "converting:\n" << *this << endl;
+ DocIterator dit = DocIterator(*inset);
+ for (size_t i = 0, n = data_.size(); i != n; ++i) {
+ if (inset == 0) {
+ // FIXME
+ lyxerr << BOOST_CURRENT_FUNCTION
+ << " Should not happen, but does e.g. after C-n C-l C-z S-C-z"
+ << '\n' << "dit: " << dit << '\n'
+ << " lastpos: " << dit.lastpos() << endl;
+ //break;
+ BOOST_ASSERT(false);
+ }
+ dit.push_back(data_[i]);
+ dit.top().inset_ = inset;
+ if (i + 1 != n)
+ inset = dit.nextInset();
+ }
+ //lyxerr << "convert:\n" << *this << " to:\n" << dit << endl;
+ return dit;