#4772 Ensemble RFT Fix crash when loading formation names after plot

* Problem is we're replacing the existing file summary case with a grid summary case
* This means we also have to update the ptr field in the rft plot.
This commit is contained in:
Gaute Lindkvist 2019-09-26 15:38:59 +02:00
parent e242304b4d
commit 912e2063df

View File

@ -55,6 +55,7 @@
#include "RimSummaryCurveFilter.h"
#include "RimSummaryPlot.h"
#include "RimSummaryPlotCollection.h"
#include "RimWellLogRftCurve.h"
#include "Riu3DMainWindowTools.h"
#include "RiuMainWindow.h"
@ -125,6 +126,17 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fil
{
existingFileSummaryCase->firstAncestorOrThisOfType( existingCollection );
// Replace file summary case pointers in Rft Curves
std::vector<RimWellLogRftCurve*> rftCurves;
existingFileSummaryCase->objectsWithReferringPtrFieldsOfType( rftCurves );
for ( RimWellLogRftCurve* curve : rftCurves )
{
if ( curve->summaryCase() == existingSummaryCase )
{
curve->setSummaryCase( newSumCase );
}
}
// Replace all occurrences of file sum with ecl sum
std::vector<RimSummaryCurve*> objects;