mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
If the graphics loader has a copy c-tor it should have copy assignment that does the same thing.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7112 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
aa7c2f32e1
commit
71f798da6e
@ -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>
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
class Inset;
|
||||
class BufferView;
|
||||
|
||||
namespace grfx {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user