mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1257 More null pointer guards based on CppCheck
This commit is contained in:
parent
bf1f8fcbaa
commit
48599f7a94
@ -61,7 +61,7 @@ void RimGridCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
|||||||
this->firstAncestorOrThisOfType(rimView);
|
this->firstAncestorOrThisOfType(rimView);
|
||||||
CVF_ASSERT(rimView);
|
CVF_ASSERT(rimView);
|
||||||
|
|
||||||
rimView->showGridCells(isActive);
|
if (rimView) rimView->showGridCells(isActive);
|
||||||
|
|
||||||
updateUiIconFromState(isActive);
|
updateUiIconFromState(isActive);
|
||||||
}
|
}
|
||||||
|
@ -351,6 +351,8 @@ void RimIntersectionBox::updateBoxManipulatorGeometry()
|
|||||||
|
|
||||||
RimView* rimView = nullptr;
|
RimView* rimView = nullptr;
|
||||||
this->firstAncestorOrThisOfType(rimView);
|
this->firstAncestorOrThisOfType(rimView);
|
||||||
|
if (!rimView) return;
|
||||||
|
|
||||||
cvf::ref<caf::DisplayCoordTransform> transForm = rimView->displayCoordTransform();
|
cvf::ref<caf::DisplayCoordTransform> transForm = rimView->displayCoordTransform();
|
||||||
|
|
||||||
m_boxManipulator->setOrigin(transForm->transformToDisplayCoord(boxOrigin().translation()));
|
m_boxManipulator->setOrigin(transForm->transformToDisplayCoord(boxOrigin().translation()));
|
||||||
@ -468,10 +470,12 @@ void RimIntersectionBox::initAfterRead()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimIntersectionBox::slotScheduleRedraw()
|
void RimIntersectionBox::slotScheduleRedraw()
|
||||||
{
|
{
|
||||||
RimView* rimView = nullptr;
|
RimView* rimView = NULL;
|
||||||
this->firstAncestorOrThisOfType(rimView);
|
this->firstAncestorOrThisOfType(rimView);
|
||||||
|
if (rimView)
|
||||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
{
|
||||||
|
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -516,12 +520,7 @@ void RimIntersectionBox::rebuildGeometryAndScheduleCreateDisplayModel()
|
|||||||
{
|
{
|
||||||
m_intersectionBoxPartMgr = nullptr;
|
m_intersectionBoxPartMgr = nullptr;
|
||||||
|
|
||||||
RimView* rimView = NULL;
|
slotScheduleRedraw();
|
||||||
this->firstAncestorOrThisOfType(rimView);
|
|
||||||
if (rimView)
|
|
||||||
{
|
|
||||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -49,6 +49,7 @@ void RimPropertyFilterCollection::updateDisplayModelNotifyManagedViews() const
|
|||||||
RimView* view = NULL;
|
RimView* view = NULL;
|
||||||
this->firstAncestorOrThisOfType(view);
|
this->firstAncestorOrThisOfType(view);
|
||||||
CVF_ASSERT(view);
|
CVF_ASSERT(view);
|
||||||
|
if (!view) return;
|
||||||
|
|
||||||
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||||
view->scheduleCreateDisplayModelAndRedraw();
|
view->scheduleCreateDisplayModelAndRedraw();
|
||||||
|
@ -362,12 +362,19 @@ void RimViewController::removeOverrides(RimView* view)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimViewController::updateOptionSensitivity()
|
void RimViewController::updateOptionSensitivity()
|
||||||
{
|
{
|
||||||
RimViewLinker* linkedViews = NULL;
|
RimView* mainView = nullptr;
|
||||||
firstAncestorOrThisOfType(linkedViews);
|
|
||||||
CVF_ASSERT(linkedViews);
|
{
|
||||||
|
RimViewLinker* linkedViews = nullptr;
|
||||||
|
firstAncestorOrThisOfType(linkedViews);
|
||||||
|
CVF_ASSERT(linkedViews);
|
||||||
|
|
||||||
RimView* mainView = linkedViews->masterView();
|
if (linkedViews)
|
||||||
CVF_ASSERT(mainView);
|
{
|
||||||
|
mainView = linkedViews->masterView();
|
||||||
|
}
|
||||||
|
CVF_ASSERT(mainView);
|
||||||
|
}
|
||||||
|
|
||||||
RimEclipseView* eclipseMasterView = dynamic_cast<RimEclipseView*>(mainView);
|
RimEclipseView* eclipseMasterView = dynamic_cast<RimEclipseView*>(mainView);
|
||||||
RimGeoMechView* geoMasterView = dynamic_cast<RimGeoMechView*>(mainView);
|
RimGeoMechView* geoMasterView = dynamic_cast<RimGeoMechView*>(mainView);
|
||||||
|
@ -289,8 +289,10 @@ QString RimViewLinker::displayNameForView(RimView* view)
|
|||||||
{
|
{
|
||||||
RimCase* rimCase = NULL;
|
RimCase* rimCase = NULL;
|
||||||
view->firstAncestorOrThisOfType(rimCase);
|
view->firstAncestorOrThisOfType(rimCase);
|
||||||
|
if (rimCase)
|
||||||
displayName = rimCase->caseUserDescription() + ": " + view->name;
|
{
|
||||||
|
displayName = rimCase->caseUserDescription() + ": " + view->name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return displayName;
|
return displayName;
|
||||||
|
@ -235,6 +235,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate()
|
|||||||
RimWellLogPlotCollection* wellLogCollection = NULL;
|
RimWellLogPlotCollection* wellLogCollection = NULL;
|
||||||
this->firstAncestorOrThisOfType(wellLogCollection);
|
this->firstAncestorOrThisOfType(wellLogCollection);
|
||||||
CVF_ASSERT(wellLogCollection);
|
CVF_ASSERT(wellLogCollection);
|
||||||
|
if (!wellLogCollection) return;
|
||||||
|
|
||||||
cvf::ref<RigEclipseWellLogExtractor> eclExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, eclipseCase);
|
cvf::ref<RigEclipseWellLogExtractor> eclExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, eclipseCase);
|
||||||
cvf::ref<RigGeoMechWellLogExtractor> geomExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, geomCase);
|
cvf::ref<RigGeoMechWellLogExtractor> geomExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, geomCase);
|
||||||
@ -299,6 +300,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate()
|
|||||||
RimWellLogPlot* wellLogPlot;
|
RimWellLogPlot* wellLogPlot;
|
||||||
firstAncestorOrThisOfType(wellLogPlot);
|
firstAncestorOrThisOfType(wellLogPlot);
|
||||||
CVF_ASSERT(wellLogPlot);
|
CVF_ASSERT(wellLogPlot);
|
||||||
|
if (!wellLogPlot) return;
|
||||||
|
|
||||||
displayUnit = wellLogPlot->depthUnit();
|
displayUnit = wellLogPlot->depthUnit();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user