From c2933d528fae8d9fd0b461ef664b84175a446bd3 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Wed, 4 Jun 2003 15:14:42 +0000 Subject: [PATCH] Make the new grfx::Loader copy c-tor work "in expected fashion". Sheesh that took some tracking down. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7106 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/graphics/ChangeLog | 4 ++++ src/graphics/GraphicsLoader.C | 10 ++++++---- src/insets/ChangeLog | 4 ++++ src/insets/graphicinset.C | 11 +++++++---- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 1586f13517..d6078d495e 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,7 @@ +2003-06-04 Angus Leeming + + * GraphicsLoader.C (Loader copy c-tor): make it work as expected. ;-) + 2003-06-03 Angus Leeming * GraphicsLoader.[Ch] (Loader): add copy constructor. diff --git a/src/graphics/GraphicsLoader.C b/src/graphics/GraphicsLoader.C index cba47a8f44..3fe180f17d 100644 --- a/src/graphics/GraphicsLoader.C +++ b/src/graphics/GraphicsLoader.C @@ -79,15 +79,18 @@ Loader::Loader(string const & file, DisplayType type) Loader::Loader(string const & file, Params const & params) - : pimpl_(new Impl(params)) + : pimpl_(new Impl(Params())) { reset(file, params); } Loader::Loader(Loader const & other) - : pimpl_(new Impl(other.pimpl_->params())) -{} + : pimpl_(new Impl(Params())) +{ + Params const & params = other.pimpl_->params(); + reset(params.filename, params); +} Loader::~Loader() @@ -274,7 +277,6 @@ void Loader::Impl::createPixmap() } } - void Loader::Impl::startLoading() { if (status_ != WaitingToLoad) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 14a2ee38b3..f9fe96770f 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2003-06-04 Angus Leeming + + * graphicinset.C (draw): add a comment for the #if 0 block. + 2003-06-04 André Pönitz * inset.[Ch]: change owner_ from Inset * to UpdatableInset * diff --git a/src/insets/graphicinset.C b/src/insets/graphicinset.C index a67e1c0408..a4e5a93c64 100644 --- a/src/insets/graphicinset.C +++ b/src/insets/graphicinset.C @@ -43,9 +43,9 @@ void GraphicInset::update(grfx::Params const & params) { params_ = params; - if (!params.filename.empty()) { - lyx::Assert(AbsolutePath(params.filename)); - loader_.reset(params.filename, params); + if (!params_.filename.empty()) { + lyx::Assert(AbsolutePath(params_.filename)); + loader_.reset(params_.filename, params_); } } @@ -194,6 +194,9 @@ void GraphicInset::draw(PainterInfo & pi, int x, int y) const view(pi.base.bv); #if 0 + // Comment this out and see if anything goes wrong. + // The explanation for why it _was_ needed once upon a time is below. + // MakeAbsPath returns filename_ unchanged if it is absolute // already. string const file_with_path = @@ -219,7 +222,7 @@ void GraphicInset::draw(PainterInfo & pi, int x, int y) const loader_.status() == grfx::WaitingToLoad) loader_.startLoading(); - if (!loader_.monitoring()) + if (params_.display != grfx::NoDisplay && !loader_.monitoring()) loader_.startMonitoring(); // This will draw the graphics. If the graphics has not been loaded yet, -- 2.39.2