]> git.lyx.org Git - features.git/commitdiff
Make the new grfx::Loader copy c-tor work "in expected fashion". Sheesh that took...
authorAngus Leeming <leeming@lyx.org>
Wed, 4 Jun 2003 15:14:42 +0000 (15:14 +0000)
committerAngus Leeming <leeming@lyx.org>
Wed, 4 Jun 2003 15:14:42 +0000 (15:14 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7106 a592a061-630c-0410-9148-cb99ea01b6c8

src/graphics/ChangeLog
src/graphics/GraphicsLoader.C
src/insets/ChangeLog
src/insets/graphicinset.C

index 1586f13517f328ab0d46889c1453dd7bf2424ee9..d6078d495e57b992d4aa581976f3a5ae31360d7b 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-04  Angus Leeming  <leeming@lyx.org>
+
+       * GraphicsLoader.C (Loader copy c-tor): make it work as expected. ;-)
+
 2003-06-03  Angus Leeming  <leeming@lyx.org>
 
        * GraphicsLoader.[Ch] (Loader): add copy constructor.
index cba47a8f44e51a016c86bbd101a209967b223f69..3fe180f17d7cd499ca2f72b1415ea3a5898454a8 100644 (file)
@@ -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)
index 14a2ee38b33067c5f3dd5c23d982376d666a7872..f9fe96770f862cf6c8c6782bcbaa8ad262e6fc97 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-04  Angus Leeming  <leeming@lyx.org>
+
+       * graphicinset.C (draw): add a comment for the #if 0 block.
+
 2003-06-04  André Pönitz  <poenitz@gmx.net>
 
        * inset.[Ch]: change owner_ from Inset * to UpdatableInset *
index a67e1c0408668c0cac660e4761d1f33e00d5c41c..a4e5a93c64f24acc9f0573ba60fea05f4ab5243e 100644 (file)
@@ -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,