Committing patch from issue 1240: "Partial profile handling"
This commit is contained in:
@@ -19,3 +19,51 @@
|
||||
#include "clipboard.h"
|
||||
|
||||
Clipboard clipboard;
|
||||
|
||||
Clipboard::Clipboard () : partProfile (false) {}
|
||||
|
||||
Clipboard::~Clipboard () {
|
||||
partProfile.deleteInstance();
|
||||
}
|
||||
|
||||
/*
|
||||
* set both the "pparams" and "pedited" field of the PartialProfile; each one can be NULL
|
||||
*/
|
||||
void Clipboard::setPartialProfile (const rtengine::procparams::PartialProfile& pprofile) {
|
||||
if (pprofile.pparams) {
|
||||
if (!partProfile.pparams) partProfile.pparams = new rtengine::procparams::ProcParams();
|
||||
*partProfile.pparams = *pprofile.pparams;
|
||||
}
|
||||
else {
|
||||
if (partProfile.pparams) {
|
||||
delete partProfile.pparams;
|
||||
partProfile.pparams = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (pprofile.pedited) {
|
||||
if (!partProfile.pedited) partProfile.pedited = new ParamsEdited();
|
||||
*partProfile.pedited = *pprofile.pedited;
|
||||
}
|
||||
else {
|
||||
if (partProfile.pedited) {
|
||||
delete partProfile.pedited;
|
||||
partProfile.pedited = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* this method copy the procparams to "pparams" and delete "pedited"
|
||||
*/
|
||||
void Clipboard::setProcParams (const rtengine::procparams::ProcParams& pparams) {
|
||||
// copy procparams
|
||||
if (!partProfile.pparams) partProfile.pparams = new rtengine::procparams::ProcParams();
|
||||
*partProfile.pparams = pparams;
|
||||
|
||||
// delete pedited
|
||||
if (partProfile.pedited) {
|
||||
delete partProfile.pedited;
|
||||
partProfile.pedited = NULL;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user