mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix crashes in Drag and Drop if the drop target is the same as the current dragged item
This commit is contained in:
parent
da6360cf98
commit
a9c9471e7f
@ -47,6 +47,8 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTra
|
||||
{
|
||||
RimWellLogCurve* curve = curves[cIdx];
|
||||
|
||||
if ( curve == curveToInsertBeforeOrAfter ) continue;
|
||||
|
||||
RimWellLogTrack* wellLogPlotTrack;
|
||||
curve->firstAncestorOrThisOfType( wellLogPlotTrack );
|
||||
if ( wellLogPlotTrack )
|
||||
|
@ -1078,13 +1078,20 @@ void RimWellLogTrack::addCurve( RimWellLogCurve* curve )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::insertCurve( RimWellLogCurve* curve, size_t index )
|
||||
{
|
||||
m_curves.insert( index, curve );
|
||||
connectCurveSignals( curve );
|
||||
// Todo: Mark curve data to use either TVD or MD
|
||||
|
||||
if ( m_plotWidget )
|
||||
if ( index >= m_curves.size() )
|
||||
{
|
||||
curve->setParentQwtPlotAndReplot( m_plotWidget );
|
||||
addCurve( curve );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_curves.insert( index, curve );
|
||||
connectCurveSignals( curve );
|
||||
// Todo: Mark curve data to use either TVD or MD
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
curve->setParentQwtPlotAndReplot( m_plotWidget );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -444,6 +444,9 @@ void RimSummaryCurveCollection::moveCurvesToCollection( RimSummaryCurveCollectio
|
||||
for ( auto curve : curves )
|
||||
{
|
||||
RimSummaryCurveCollection* srcCollection = nullptr;
|
||||
|
||||
if ( curve == curveToInsertBeforeOrAfter ) continue;
|
||||
|
||||
curve->firstAncestorOrThisOfTypeAsserted( srcCollection );
|
||||
|
||||
srcCollection->removeCurve( curve );
|
||||
|
Loading…
Reference in New Issue
Block a user