Commit 71097f13 authored by Rusty Blue's avatar Rusty Blue
Browse files

BUG: CopyEntry/ShallowCopy would incorrectly set a default ()) value even if...

BUG: CopyEntry/ShallowCopy would incorrectly set a default ()) value even if key being copied didn't exist.
parent 3f4fc817
......@@ -14,7 +14,7 @@
=========================================================================*/
#include "vtkInformationDoubleKey.h"
vtkCxxRevisionMacro(vtkInformationDoubleKey, "1.3");
vtkCxxRevisionMacro(vtkInformationDoubleKey, "1.4");
//----------------------------------------------------------------------------
vtkInformationDoubleKey::vtkInformationDoubleKey(const char* name, const char* location):
......@@ -84,7 +84,14 @@ int vtkInformationDoubleKey::Has(vtkInformation* info)
//----------------------------------------------------------------------------
void vtkInformationDoubleKey::ShallowCopy(vtkInformation* from, vtkInformation* to)
{
this->Set(to, this->Get(from));
if (this->Has(from))
{
this->Set(to, this->Get(from));
}
else
{
this->SetAsObjectBase(to, 0); // doesn't exist in from, so remove the key
}
}
//----------------------------------------------------------------------------
......
......@@ -14,7 +14,7 @@
=========================================================================*/
#include "vtkInformationIntegerKey.h"
vtkCxxRevisionMacro(vtkInformationIntegerKey, "1.7");
vtkCxxRevisionMacro(vtkInformationIntegerKey, "1.8");
//----------------------------------------------------------------------------
vtkInformationIntegerKey::vtkInformationIntegerKey(const char* name, const char* location):
......@@ -84,7 +84,14 @@ int vtkInformationIntegerKey::Has(vtkInformation* info)
//----------------------------------------------------------------------------
void vtkInformationIntegerKey::ShallowCopy(vtkInformation* from, vtkInformation* to)
{
this->Set(to, this->Get(from));
if (this->Has(from))
{
this->Set(to, this->Get(from));
}
else
{
this->SetAsObjectBase(to, 0); // doesn't exist in from, so remove the key
}
}
//----------------------------------------------------------------------------
......
......@@ -14,7 +14,7 @@
=========================================================================*/
#include "vtkInformationUnsignedLongKey.h"
vtkCxxRevisionMacro(vtkInformationUnsignedLongKey, "1.7");
vtkCxxRevisionMacro(vtkInformationUnsignedLongKey, "1.8");
//----------------------------------------------------------------------------
vtkInformationUnsignedLongKey::vtkInformationUnsignedLongKey(const char* name, const char* location):
......@@ -86,7 +86,14 @@ int vtkInformationUnsignedLongKey::Has(vtkInformation* info)
void vtkInformationUnsignedLongKey::ShallowCopy(vtkInformation* from,
vtkInformation* to)
{
this->Set(to, this->Get(from));
if (this->Has(from))
{
this->Set(to, this->Get(from));
}
else
{
this->SetAsObjectBase(to, 0); // doesn't exist in from, so remove the key
}
}
//----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment