Merge from default. Hope I did it right...

This commit is contained in:
Emil Martinec
2012-03-08 20:27:30 -06:00
parent 380728e1f0
commit f47b4b5bb0
262 changed files with 41736 additions and 37104 deletions

View File

@@ -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;
}
}