Commit f5096075 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot

Merge topic '18939-fix-segfault'

ff453232 avoid mapping block selection for non-composite dataset
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Cory Quammen's avatarCory Quammen (Kitware) <cory.quammen@kitware.com>
Merge-request: !3201
parents bb6d8f93 ff453232
Pipeline #134654 running with stage
......@@ -527,18 +527,22 @@ public:
QItemSelection aselection;
const QAbstractProxyModel* amodel = qobject_cast<const QAbstractProxyModel*>(this->model());
vtkSMSourceProxy* selSource = port ? port->getSelectionInput() : nullptr;
if (selSource && strcmp(selSource->GetXMLName(), "BlockSelectionSource") == 0)
// amodel's source model may be null if the data is not a composite dataset
// BUG #18939.
if (amodel->sourceModel() != nullptr)
{
vtkSMPropertyHelper blocksHelper(selSource, "Blocks");
for (unsigned int cc = 0, max = blocksHelper.GetNumberOfElements(); cc < max; ++cc)
vtkSMSourceProxy* selSource = port ? port->getSelectionInput() : nullptr;
if (selSource && strcmp(selSource->GetXMLName(), "BlockSelectionSource") == 0)
{
const QModelIndex midx = this->CDTModel->find(blocksHelper.GetAsIdType(cc));
if (midx.isValid())
vtkSMPropertyHelper blocksHelper(selSource, "Blocks");
for (unsigned int cc = 0, max = blocksHelper.GetNumberOfElements(); cc < max; ++cc)
{
const QModelIndex idx = amodel->mapFromSource(midx);
aselection.select(idx, idx);
const QModelIndex midx = this->CDTModel->find(blocksHelper.GetAsIdType(cc));
if (midx.isValid())
{
const QModelIndex idx = amodel->mapFromSource(midx);
aselection.select(idx, idx);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment