#5979 Fix color legend crash when opening regression test project

Projects containing Rim2dIntersectionViews copy legend config from the view using
PdmXmlObjectHandle::writeObjectToXmlString/readObjectFromXmlString. The
resulting xml contains references to RimColorLegendCollection which are unresolved,
and this would lead to a crash (m_colorLegend == nullptr). Fixed by resolving
the references explicitly after copy the config.
This commit is contained in:
Kristian Bendiksen 2020-05-26 07:10:27 +02:00 committed by Magne Sjaastad
parent d6be12bf02
commit 3e882a65df

View File

@ -884,6 +884,7 @@ void RimRegularLegendConfig::setUiValuesFromLegendConfig( const RimRegularLegend
{
QString serializedObjectString = otherLegendConfig->writeObjectToXmlString();
this->readObjectFromXmlString( serializedObjectString, caf::PdmDefaultObjectFactory::instance() );
this->resolveReferencesRecursively();
this->updateLegend();
}