diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 01c580281e..cf8d6a0124 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -696,13 +696,6 @@ bool Buffer::readFile(FileName const & filename) if (readFile(lex, fname) != success) return false; - // FIXME: there are insets that don't set the buffer reference - // (InsetMathHull at least) so wet explicitely set the buffer in all insets. - InsetIterator it = inset_iterator_begin(inset()); - InsetIterator end = inset_iterator_end(inset()); - for (; it != end; ++it) - it->setBuffer(*this); - return true; } diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 0d3bdb4ff7..c626c86cc8 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -210,6 +210,12 @@ InsetMathHull & InsetMathHull::operator=(InsetMathHull const & other) void InsetMathHull::setBuffer(Buffer & buffer) { buffer_ = &buffer; + for (idx_type i = 0, n = nargs(); i != n; ++i) { + MathData & data = cell(i); + for (size_t j = 0; j != data.size(); ++j) + data[j].nucleus()->setBuffer(buffer); + } + for (size_t i = 0; i != label_.size(); ++i) { if (label_[i]) label_[i]->setBuffer(buffer);