]> git.lyx.org Git - features.git/commitdiff
Fix #7594 for branch.
authorRichard Heck <rgheck@comcast.net>
Mon, 5 Sep 2011 19:41:23 +0000 (19:41 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 5 Sep 2011 19:41:23 +0000 (19:41 +0000)
=====

Original log:

Fix bug reported on user list. Children included more than once in
the same document could not be rendered.

Problem was that we were using children_positions to deal with the
included documents. That structure only includes each child once.
We need to use position_to_children, instead.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39602 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
status.20x

index 06174697e56490477fb20ca99d16a8d3934ffb3c..04b379435da736841c651b3d5044d41c9478c037 100644 (file)
@@ -444,12 +444,12 @@ void Buffer::clone(BufferMap & bufmap) const
        // math macro caches need to be rethought and simplified.
        // I am not sure wether we should handle Buffer cloning here or in BufferList.
        // Right now BufferList knows nothing about buffer clones.
-       Impl::BufferPositionMap::iterator it = d->children_positions.begin();
-       Impl::BufferPositionMap::iterator end = d->children_positions.end();
+       Impl::PositionScopeBufferMap::iterator it = d->position_to_children.begin();
+       Impl::PositionScopeBufferMap::iterator end = d->position_to_children.end();
        for (; it != end; ++it) {
-               DocIterator dit = it->second.clone(buffer_clone);
+               DocIterator dit = it->first.clone(buffer_clone);
                dit.setBuffer(buffer_clone);
-               Buffer * child = const_cast<Buffer *>(it->first);
+               Buffer * child = const_cast<Buffer *>(it->second.second);
 
                child->clone(bufmap);
                BufferMap::iterator it = bufmap.find(child);
@@ -461,6 +461,7 @@ void Buffer::clone(BufferMap & bufmap) const
                InsetInclude * inset_inc = static_cast<InsetInclude *>(inset);
                inset_inc->setChildBuffer(child_clone);
                child_clone->d->setParent(buffer_clone);
+               // FIXME Do we need to do this now, or can we wait until we run updateMacros()?
                buffer_clone->setChild(dit, child_clone);
        }
        buffer_clone->d->macro_lock = false;
index d06d28f2df7c99f6e1ba6a96b73b9f6c5dd5bd09..7333968bf414a6d439644e1aaeeea8dea3a0e455 100644 (file)
@@ -47,6 +47,9 @@ What's new
 - Fix regression where parent macros were not displayed in a viewed child
   (bug 7593).
 
+- Fix regression where children included more than once are only rendered
+  once (bug 7594).
+
 - Fix problem where updates to children were not seen on output of master
   (bug 7360).