#10438 Fix stacking of curves

This was a side effect of changes in 69a668d
The return value when accessing time step values changed from const std::vector<time_t>& to std::vector<time_t>. When computing data related to stacking of curves, the data was inserted into a vector, and the change caused the insert operation to use two different vectors instead of one.
This commit is contained in:
Magne Sjaastad 2023-06-29 10:48:25 +02:00
parent c7032c60d2
commit 8a41d5a085

View File

@ -1747,7 +1747,12 @@ bool RimSummaryPlot::updateStackedCurveDataForAxis( RiuPlotAxis plotAxis )
std::vector<time_t> allTimeSteps;
for ( RimSummaryCurve* curve : stackedCurves )
{
allTimeSteps.insert( allTimeSteps.end(), curve->timeStepsY().begin(), curve->timeStepsY().end() );
auto timeSteps = curve->timeStepsY();
if ( !timeSteps.empty() )
{
// https://github.com/OPM/ResInsight/issues/10438
allTimeSteps.insert( allTimeSteps.end(), timeSteps.begin(), timeSteps.end() );
}
}
std::sort( allTimeSteps.begin(), allTimeSteps.end() );
allTimeSteps.erase( std::unique( allTimeSteps.begin(), allTimeSteps.end() ), allTimeSteps.end() );