FIx regression blocking drag and drop of well names into existing plots

This commit is contained in:
Magne Sjaastad 2022-03-31 14:43:42 +02:00
parent 15f17234c8
commit b822996fc3

View File

@ -1970,23 +1970,27 @@ int RimSummaryPlot::handleAddressCollectionDrop( RimSummaryAddressCollection* ad
auto curveAdr = newCurveDef.summaryAddress(); auto curveAdr = newCurveDef.summaryAddress();
if ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL ) if ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL )
{ {
auto currentObjectString = curveAdr.wellName();
curveAdr.setWellName( droppedName ); curveAdr.setWellName( droppedName );
newCurveDef.setSummaryAddress( curveAdr ); newCurveDef.setSummaryAddress( curveAdr );
newCurveDefsWithObjectNames[newCurveDef].insert( curveAdr.wellName() ); newCurveDefsWithObjectNames[newCurveDef].insert( currentObjectString );
} }
else if ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL_GROUP ) else if ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL_GROUP )
{ {
auto currentObjectString = curveAdr.wellGroupName();
curveAdr.setWellGroupName( droppedName ); curveAdr.setWellGroupName( droppedName );
newCurveDef.setSummaryAddress( curveAdr ); newCurveDef.setSummaryAddress( curveAdr );
newCurveDefsWithObjectNames[newCurveDef].insert( curveAdr.wellGroupName() ); newCurveDefsWithObjectNames[newCurveDef].insert( currentObjectString );
} }
else if ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::REGION ) else if ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::REGION )
{ {
auto currentObjectString = std::to_string( curveAdr.regionNumber() );
int droppedRegion = std::stoi( droppedName ); int droppedRegion = std::stoi( droppedName );
curveAdr.setRegion( droppedRegion ); curveAdr.setRegion( droppedRegion );
newCurveDef.setSummaryAddress( curveAdr ); newCurveDef.setSummaryAddress( curveAdr );
newCurveDefsWithObjectNames[newCurveDef].insert( std::to_string( curveAdr.regionNumber() ) ); newCurveDefsWithObjectNames[newCurveDef].insert( currentObjectString );
} }
} }