]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsLoader.C
If the graphics loader has a copy c-tor it should have copy assignment that does...
[lyx.git] / src / graphics / GraphicsLoader.C
index cba47a8f44e51a016c86bbd101a209967b223f69..391fac6ac5380b3207cb90ef2e7f362ed61ccd91 100644 (file)
@@ -29,7 +29,7 @@ namespace grfx {
 
 struct Loader::Impl : boost::signals::trackable {
        ///
-       Impl(Params const &);
+       Impl();
        ///
        ~Impl();
        ///
@@ -67,33 +67,46 @@ 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(other.pimpl_->params()))
-{}
+       : pimpl_(new Impl)
+{
+       Params const & params = other.pimpl_->params();
+       reset(params.filename, params);
+}
 
 
 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;
@@ -181,8 +194,8 @@ Image const * Loader::image() const
 }
 
 
-Loader::Impl::Impl(Params const & params)
-       : status_(WaitingToLoad), params_(params)
+Loader::Impl::Impl()
+       : status_(WaitingToLoad)
 {
 }
 
@@ -274,7 +287,6 @@ void Loader::Impl::createPixmap()
        }
 }
 
-
 void Loader::Impl::startLoading()
 {
        if (status_ != WaitingToLoad)