]> git.lyx.org Git - features.git/commitdiff
If the graphics loader has a copy c-tor it should have copy assignment that does...
authorAngus Leeming <leeming@lyx.org>
Thu, 5 Jun 2003 22:45:51 +0000 (22:45 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 5 Jun 2003 22:45:51 +0000 (22:45 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7112 a592a061-630c-0410-9148-cb99ea01b6c8

src/graphics/ChangeLog
src/graphics/GraphicsLoader.C
src/graphics/GraphicsLoader.h
src/graphics/PreviewImage.h

index d6078d495e57b992d4aa581976f3a5ae31360d7b..48e67610cbc59b01c46682c24b72543fd615053c 100644 (file)
@@ -1,6 +1,7 @@
 2003-06-04  Angus Leeming  <leeming@lyx.org>
 
        * GraphicsLoader.C (Loader copy c-tor): make it work as expected. ;-)
+       (operator=): if it has a copy c-tor, it should have this too.
 
 2003-06-03  Angus Leeming  <leeming@lyx.org>
 
index 3fe180f17d7cd499ca2f72b1415ea3a5898454a8..391fac6ac5380b3207cb90ef2e7f362ed61ccd91 100644 (file)
@@ -29,7 +29,7 @@ namespace grfx {
 
 struct Loader::Impl : boost::signals::trackable {
        ///
-       Impl(Params const &);
+       Impl();
        ///
        ~Impl();
        ///
@@ -67,26 +67,26 @@ private:
 
 
 Loader::Loader()
-       : pimpl_(new Impl(Params()))
+       : pimpl_(new Impl)
 {}
 
 
 Loader::Loader(string const & file, DisplayType type)
-       : pimpl_(new Impl(Params()))
+       : pimpl_(new Impl)
 {
        reset(file, type);
 }
 
 
 Loader::Loader(string const & file, Params const & params)
-       : pimpl_(new Impl(Params()))
+       : pimpl_(new Impl)
 {
        reset(file, params);
 }
 
 
 Loader::Loader(Loader const & other)
-       : pimpl_(new Impl(Params()))
+       : pimpl_(new Impl)
 {
        Params const & params = other.pimpl_->params();
        reset(params.filename, params);
@@ -97,6 +97,16 @@ Loader::~Loader()
 {}
 
 
+Loader & Loader::operator=(Loader const & other)
+{
+       if (this != &other) {
+               Params const & params = other.pimpl_->params();
+               reset(params.filename, params);
+       }
+       return *this;
+}
+
+
 void Loader::reset(string const & file, DisplayType type) const
 {
        Params params;
@@ -184,8 +194,8 @@ Image const * Loader::image() const
 }
 
 
-Loader::Impl::Impl(Params const & params)
-       : status_(WaitingToLoad), params_(params)
+Loader::Impl::Impl()
+       : status_(WaitingToLoad)
 {
 }
 
index 6307ec1a0291248f924debf1339ab97cf20b4c28..c95a21430a6f08fa5a7ac710a6ed295ada08f58f 100644 (file)
@@ -31,7 +31,6 @@
 #include <boost/scoped_ptr.hpp>
 
 class Inset;
-class BufferView;
 
 namespace grfx {
 
@@ -52,6 +51,8 @@ public:
        /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
        ~Loader();
 
+       Loader & operator=(Loader const &);
+
        /// The file can be changed, or the display params, or both.
        void reset(string const & file_with_path,
                   DisplayType = ColorDisplay) const;
index 4c459756d01b7a8e61a8c5751c447dc9b25cf1f2..cb1cb71b3d830d8eec6055988b7416dc0a5befe5 100644 (file)
@@ -16,7 +16,6 @@
 #include <boost/scoped_ptr.hpp>
 
 class Inset;
-class BufferView;
 
 namespace grfx {