diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp index ef9c96e786..06e4b1f97a 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp @@ -125,7 +125,7 @@ RimSummaryPlot* RicSummaryCurveCreator::previewPlot() const //-------------------------------------------------------------------------------------------------- void RicSummaryCurveCreator::updateFromSummaryPlot(RimSummaryPlot* targetPlot) { - if (m_targetPlot != targetPlot) + if (targetPlot == nullptr || m_targetPlot != targetPlot) { resetAllFields(); } @@ -136,9 +136,10 @@ void RicSummaryCurveCreator::updateFromSummaryPlot(RimSummaryPlot* targetPlot) if (m_targetPlot) { populateCurveCreator(*m_targetPlot); - syncPreviewCurvesFromUiSelection(); } + syncPreviewCurvesFromUiSelection(); + caf::PdmUiItem::updateConnectedEditors(); } @@ -548,6 +549,9 @@ void RicSummaryCurveCreator::copyCurveAndAddToPlot(const RimSummaryCurve *curve, //-------------------------------------------------------------------------------------------------- void RicSummaryCurveCreator::resetAllFields() { + std::vector curveDefinitions; + m_summaryCurveSelectionEditor->summaryAddressSelection()->setSelectedCurveDefinitions(curveDefinitions); + m_previewPlot->deleteAllSummaryCurves(); m_targetPlot = nullptr; }