From 45b0c6be478c155124101ba786a00c2905aa3df7 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sat, 19 Dec 2009 15:46:45 +0000 Subject: [PATCH] Fix the threaded preview and reenable it. Buffer::Impl::inset was set in the ctor Buffer::Impl::Impl to be a clone. However, in the Buffer::Buffer ctor the inset was set again, now to a new and empty InsetText. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32589 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 9 +++++---- src/frontends/qt4/GuiView.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index e3319af92c..6da2e91de7 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -305,8 +305,6 @@ Buffer::Impl::Impl(Buffer & parent, FileName const & file, bool readonly_, temppath = cloned_buffer_->d->temppath; file_fully_loaded = true; params = cloned_buffer_->d->params; - inset = static_cast(cloned_buffer_->d->inset->clone()); - inset->setBuffer(parent); } @@ -314,8 +312,11 @@ Buffer::Buffer(string const & file, bool readonly, Buffer const * cloned_buffer) : d(new Impl(*this, FileName(file), readonly, cloned_buffer)), gui_(0) { LYXERR(Debug::INFO, "Buffer::Buffer()"); - - d->inset = new InsetText(this); + if (cloned_buffer) { + d->inset = static_cast(cloned_buffer->d->inset->clone()); + d->inset->setBuffer(*this); + } else + d->inset = new InsetText(this); d->inset->setAutoBreakRows(true); d->inset->getText(0)->setMacrocontextPosition(par_iterator_begin()); } diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index f10ad4e25d..c0230751d5 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -102,7 +102,7 @@ #include #include -#define EXPORT_in_THREAD 0 +#define EXPORT_in_THREAD 1 // QtConcurrent was introduced in Qt 4.4 #if (QT_VERSION >= 0x040400)