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>
struct Loader::Impl : boost::signals::trackable {
///
- Impl(Params const &);
+ Impl();
///
~Impl();
///
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);
{}
+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;
}
-Loader::Impl::Impl(Params const & params)
- : status_(WaitingToLoad), params_(params)
+Loader::Impl::Impl()
+ : status_(WaitingToLoad)
{
}
#include <boost/scoped_ptr.hpp>
class Inset;
-class BufferView;
namespace grfx {
/// 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;