PVUnion copy allways shallow

This commit is contained in:
Matej Sekoranja
2014-11-10 21:30:48 +01:00
parent 4e671a1c21
commit 278e531806

View File

@@ -462,17 +462,14 @@ void Convert::copyUnion(PVUnionPtr const & from, PVUnionPtr const & to)
PVFieldPtr fromValue = from->get();
if (from->getUnion()->isVariant())
{
if (fromValue.get() == 0)
to->set(PVFieldPtr());
else
to->set(getPVDataCreate()->createPVField(fromValue)); // clone value // TODO cache getPVDataCreate()
to->set(from->get());
}
else
{
if (fromValue.get() == 0)
to->select(PVUnion::UNDEFINED_INDEX);
else
to->set(from->getSelectedFieldName(),from->get());
to->set(from->getSelectedIndex(),from->get());
}
}