diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp index e24ba1f2ef..adf38bec41 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp @@ -242,7 +242,7 @@ void RimWellRftPlot::updateFormationsOnPlot() const RimCase* formationNamesCase = m_wellLogPlot->trackByIndex(0)->formationNamesCase(); - if ( !formationNamesCase ) + if (!formationNamesCase) { /// Set default case. Todo : Use the first of the selected cases in the plot std::vector cases; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp index 9531b73d50..50f06af09d 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp @@ -260,15 +260,17 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField, } else if (changedField == &m_showFormations || changedField == &m_formationSource) { - bool validWellPathChosen = false; - std::vector wellPaths; - RimTools::wellPathWithFormations(&wellPaths); - for (RimWellPath* wellPath : wellPaths) + if (changedField == &m_formationSource && m_formationSource == WELL_PICK_FILTER) { - if (wellPath == m_formationWellPathForSourceCase) + std::vector wellPaths; + RimTools::wellPathWithFormations(&wellPaths); + for (RimWellPath* wellPath : wellPaths) { - m_formationWellPathForSourceWellPath = m_formationWellPathForSourceCase(); - break; + if (wellPath == m_formationWellPathForSourceCase) + { + m_formationWellPathForSourceWellPath = m_formationWellPathForSourceCase(); + break; + } } } @@ -284,8 +286,8 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField, else { RimWellPltPlot* pltPlot(nullptr); - firstAncestorOrThisOfType(pltPlot); + if (pltPlot) { pltPlot->updateConnectedEditors(); @@ -362,7 +364,6 @@ QList RimWellLogTrack::calculateValueOptions(const caf:: if (fieldNeedingOptions == &m_formationWellPathForSourceCase) { RimTools::wellPathOptionItems(&options); - options.push_front(caf::PdmOptionItemInfo("None", nullptr)); } else if (fieldNeedingOptions == &m_formationWellPathForSourceWellPath)