Do not start from a non-relevant parent in Buffer cloning.

(cherry picked from commit e077255aea)
This commit is contained in:
Juergen Spitzmueller 2018-05-16 08:35:21 +02:00
parent b7f5fe94cd
commit a0fb2f05c9
4 changed files with 9 additions and 8 deletions

View File

@ -570,13 +570,13 @@ Buffer::~Buffer()
} }
Buffer * Buffer::cloneFromMaster() const Buffer * Buffer::cloneWithChildren() const
{ {
BufferMap bufmap; BufferMap bufmap;
cloned_buffers.push_back(new CloneList); cloned_buffers.push_back(new CloneList);
CloneList * clones = cloned_buffers.back(); CloneList * clones = cloned_buffers.back();
masterBuffer()->cloneWithChildren(bufmap, clones); cloneWithChildren(bufmap, clones);
// make sure we got cloned // make sure we got cloned
BufferMap::const_iterator bit = bufmap.find(this); BufferMap::const_iterator bit = bufmap.find(this);

View File

@ -157,9 +157,9 @@ public:
/// Destructor /// Destructor
~Buffer(); ~Buffer();
/// Clones the entire structure of which this Buffer is part, starting /// Clones the entire structure of which this Buffer is part,
/// with the master and cloning all the children, too. /// cloning all the children, too.
Buffer * cloneFromMaster() const; Buffer * cloneWithChildren() const;
/// Just clones this single Buffer. For autosave. /// Just clones this single Buffer. For autosave.
Buffer * cloneBufferOnly() const; Buffer * cloneBufferOnly() const;
/// ///

View File

@ -3598,7 +3598,7 @@ bool GuiView::GuiViewPrivate::asyncBufferProcessing(
#if EXPORT_in_THREAD #if EXPORT_in_THREAD
if (allow_async) { if (allow_async) {
GuiViewPrivate::busyBuffers.insert(used_buffer); GuiViewPrivate::busyBuffers.insert(used_buffer);
Buffer * cloned_buffer = used_buffer->cloneFromMaster(); Buffer * cloned_buffer = used_buffer->cloneWithChildren();
if (!cloned_buffer) { if (!cloned_buffer) {
Alert::error(_("Export Error"), Alert::error(_("Export Error"),
_("Error cloning the Buffer.")); _("Error cloning the Buffer."));

View File

@ -48,7 +48,8 @@ What's new
* DOCUMENT INPUT/OUTPUT * DOCUMENT INPUT/OUTPUT
- When cloning a buffer, do not start from a parent if it is not the
current master (e.g., when compiling a child alone).
* USER INTERFACE * USER INTERFACE