(#539) Check for NULL pointer when deciding what kind of range filter collection to use

As the management of override range filter collection is handled
independenly from scheduleRedraw, we must check for a valid pointer when
trying to access the override range filter
This commit is contained in:
Magne Sjaastad 2015-10-21 13:27:10 +02:00
parent 4b95f2b807
commit dbd6ce09c5
4 changed files with 9 additions and 17 deletions

View File

@ -19,16 +19,18 @@
#include "RicUnLinkViewFeature.h"
#include "RimViewController.h"
#include "RiaApplication.h"
#include "RimProject.h"
#include "RimView.h"
#include "RimViewController.h"
#include "RimViewLinker.h"
#include "cafCmdFeatureManager.h"
#include "cafSelectionManager.h"
#include <QAction>
#include "RiaApplication.h"
#include "RimProject.h"
#include "cafCmdFeatureManager.h"
CAF_CMD_SOURCE_INIT(RicUnLinkViewFeature, "RicUnLinkViewFeature");

View File

@ -563,9 +563,8 @@ void RimView::addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
//--------------------------------------------------------------------------------------------------
RimCellRangeFilterCollection* RimView::rangeFilterCollection()
{
if (this->viewController() && this->viewController()->isRangeFiltersControlled())
if (this->viewController() && this->viewController()->isRangeFiltersControlled() && m_overrideRangeFilterCollection)
{
CVF_ASSERT(m_overrideRangeFilterCollection());
return m_overrideRangeFilterCollection;
}
else
@ -579,9 +578,8 @@ RimCellRangeFilterCollection* RimView::rangeFilterCollection()
//--------------------------------------------------------------------------------------------------
const RimCellRangeFilterCollection* RimView::rangeFilterCollection() const
{
if (this->viewController() && this->viewController()->isRangeFiltersControlled())
if (this->viewController() && this->viewController()->isRangeFiltersControlled() && m_overrideRangeFilterCollection)
{
CVF_ASSERT(m_overrideRangeFilterCollection());
return m_overrideRangeFilterCollection;
}
else

View File

@ -237,7 +237,6 @@ void RiuViewer::mouseReleaseEvent(QMouseEvent* event)
return;
}
event->accept();
m_viewerCommands->displayContextMenu(event);
return;
}

View File

@ -266,14 +266,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
if (menu.actions().size() > 0)
{
// event->accept();
QAction* act = menu.exec(event->globalPos());
/*
if (act)
{
cvf::Trace::show("Jadda");
}
*/
menu.exec(event->globalPos());
}
}