]> git.lyx.org Git - features.git/commitdiff
set the buffer reference for all insets when the file is loaded.
authorAbdelrazak Younes <younes@lyx.org>
Tue, 4 Mar 2008 12:18:52 +0000 (12:18 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 4 Mar 2008 12:18:52 +0000 (12:18 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23433 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp

index cf8d6a0124aa9cf47b5d53fd58c03042df292fe6..01c580281edc8b85ea09284a335ab91dad0d9f8f 100644 (file)
@@ -696,6 +696,13 @@ 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;
 }