]> git.lyx.org Git - features.git/commitdiff
Found a cleaner solution for the buffer reference problem in mathed.
authorAbdelrazak Younes <younes@lyx.org>
Tue, 4 Mar 2008 14:18:34 +0000 (14:18 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 4 Mar 2008 14:18:34 +0000 (14:18 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23445 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/mathed/InsetMathHull.cpp

index 01c580281edc8b85ea09284a335ab91dad0d9f8f..cf8d6a0124aa9cf47b5d53fd58c03042df292fe6 100644 (file)
@@ -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;
 }
 
index 0d3bdb4ff74e99e20dae63afde0ddc6bfb38b409..c626c86cc82aec51a9d338ec45f52fb436064dc0 100644 (file)
@@ -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);