From 5a2bea38f76caf6883b53727c6d68c572b906ce7 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 3 Oct 2019 10:12:37 +0200 Subject: [PATCH] #4750 Summary : Use first ensemble case if no standalone case is found --- .../SummaryPlotCommands/RicNewSummaryCurveFeature.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryCurveFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryCurveFeature.cpp index 41cfbf021d..0ba5237ca7 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryCurveFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryCurveFeature.cpp @@ -68,6 +68,17 @@ void RicNewSummaryCurveFeature::onActionTriggered( bool isChecked ) defaultCase = project->activeOilField()->summaryCaseMainCollection()->summaryCase( 0 ); } + if ( !defaultCase ) + { + std::vector allSummaryCases = + project->activeOilField()->summaryCaseMainCollection()->allSummaryCases(); + + if ( !allSummaryCases.empty() ) + { + defaultCase = allSummaryCases.front(); + } + } + RimSummaryCurve* newCurve = RicSummaryPlotFeatureImpl::addDefaultCurveToPlot( plot, defaultCase ); plot->applyDefaultCurveAppearances();