diff --git a/ApplicationCode/Commands/WellLogCommands/RicWellLogPlotTrackFeatureImpl.cpp b/ApplicationCode/Commands/WellLogCommands/RicWellLogPlotTrackFeatureImpl.cpp index f53a26b36c..8d5b1d426a 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicWellLogPlotTrackFeatureImpl.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicWellLogPlotTrackFeatureImpl.cpp @@ -52,8 +52,6 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTra if ( wellLogPlotTrack ) { wellLogPlotTrack->removeCurve( curve ); - wellLogPlotTrack->updateConnectedEditors(); - wellLogPlotTrack->updateStackedCurveData(); srcTracks.insert( wellLogPlotTrack ); RimWellLogPlot* plot; wellLogPlotTrack->firstAncestorOrThisOfType( plot ); @@ -73,15 +71,17 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTra destTrack->insertCurve( curves[cIdx], insertionStartIndex + cIdx ); } - for ( std::set::iterator pIt = srcPlots.begin(); pIt != srcPlots.end(); ++pIt ) + for ( auto track : srcTracks ) { - ( *pIt )->calculateAvailableDepthRange(); + track->setAutoScaleXEnabled( true ); + track->updateParentPlotZoom(); + track->updateConnectedEditors(); + track->updateStackedCurveData(); } - for ( std::set::iterator tIt = srcTracks.begin(); tIt != srcTracks.end(); ++tIt ) + for ( auto plot : srcPlots ) { - ( *tIt )->setAutoScaleXEnabled( true ); - ( *tIt )->updateParentPlotZoom(); + plot->calculateAvailableDepthRange(); } destTrack->loadDataAndUpdate();