From 7562e7bb3053dbb3c824fc69b75c4ff3c16d74be Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 9 Dec 2016 21:16:43 +0100 Subject: [PATCH] #559 : Linked views : Use writeObjectToXmlString to copy field values --- .../ProjectDataModel/RimLegendConfig.cpp | 13 ++----------- .../ProjectDataModel/RimTernaryLegendConfig.cpp | 13 ++----------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimLegendConfig.cpp b/ApplicationCode/ProjectDataModel/RimLegendConfig.cpp index 320a58b700..2c3bd89757 100644 --- a/ApplicationCode/ProjectDataModel/RimLegendConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimLegendConfig.cpp @@ -776,17 +776,8 @@ cvf::OverlayItem* RimLegendConfig::legend() //-------------------------------------------------------------------------------------------------- void RimLegendConfig::setUiValuesFromLegendConfig(const RimLegendConfig* otherLegendConfig) { - this->m_numLevels = otherLegendConfig->m_numLevels; - this->m_precision = otherLegendConfig->m_precision; - this->m_tickNumberFormat = otherLegendConfig->m_tickNumberFormat; - this->m_rangeMode = otherLegendConfig->m_rangeMode; - this->m_userDefinedMaxValue = otherLegendConfig->m_userDefinedMaxValue; - this->m_userDefinedMinValue = otherLegendConfig->m_userDefinedMinValue; - this->m_colorRangeMode = otherLegendConfig->m_colorRangeMode; - this->m_mappingMode = otherLegendConfig->m_mappingMode; - - this->m_userDefinedMinValue = otherLegendConfig->m_userDefinedMinValue; - this->m_userDefinedMaxValue = otherLegendConfig->m_userDefinedMaxValue; + QString serializedObjectString = otherLegendConfig->writeObjectToXmlString(); + this->readObjectFromXmlString(serializedObjectString, caf::PdmDefaultObjectFactory::instance()); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimTernaryLegendConfig.cpp b/ApplicationCode/ProjectDataModel/RimTernaryLegendConfig.cpp index 68e2e3ad93..5f62c66811 100644 --- a/ApplicationCode/ProjectDataModel/RimTernaryLegendConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimTernaryLegendConfig.cpp @@ -250,17 +250,8 @@ void RimTernaryLegendConfig::recreateLegend() //-------------------------------------------------------------------------------------------------- void RimTernaryLegendConfig::setUiValuesFromLegendConfig(const RimTernaryLegendConfig* otherLegendConfig) { - this->precision = otherLegendConfig->precision; - this->rangeMode = otherLegendConfig->rangeMode; - this->userDefinedMaxValueSoil = otherLegendConfig->userDefinedMaxValueSoil; - this->userDefinedMinValueSoil = otherLegendConfig->userDefinedMinValueSoil; - this->userDefinedMaxValueSgas = otherLegendConfig->userDefinedMaxValueSgas; - this->userDefinedMinValueSgas = otherLegendConfig->userDefinedMinValueSgas; - this->userDefinedMaxValueSwat = otherLegendConfig->userDefinedMaxValueSwat; - this->userDefinedMinValueSwat = otherLegendConfig->userDefinedMinValueSwat; - this->applyLocalMinMax = otherLegendConfig->applyLocalMinMax; - this->applyGlobalMinMax = otherLegendConfig->applyGlobalMinMax; - this->applyFullRangeMinMax = otherLegendConfig->applyFullRangeMinMax; + QString serializedObjectString = otherLegendConfig->writeObjectToXmlString(); + this->readObjectFromXmlString(serializedObjectString, caf::PdmDefaultObjectFactory::instance()); } //--------------------------------------------------------------------------------------------------