IPAL21062 Fatal error on Add "Names of filters" - regression

This commit is contained in:
dmv 2009-04-17 07:15:33 +00:00
parent c41972303e
commit 25f640b0b6

View File

@ -1370,7 +1370,13 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
int aCriterionType = GetCriterionType(row); int aCriterionType = GetCriterionType(row);
QtxColorButton* clrBtn = qobject_cast<QtxColorButton*>(aTable->cellWidget(row, 2)); QtxColorButton* clrBtn = qobject_cast<QtxColorButton*>(aTable->cellWidget(row, 2));
bool isComboItem = aTable->item(row, 2)->type() == ComboItem::Type(); int aComboType = ComboItem::Type();
QTableWidgetItem* aTableItem = aTable->item(row, 2);
bool isComboItem = false;
if (aTableItem) {
int aTableType = aTable->item(row, 2)->type();
isComboItem = aTableType == aComboType ? true : false;
}
if ( (aCriterionType != SMESH::FT_GroupColor && clrBtn) || if ( (aCriterionType != SMESH::FT_GroupColor && clrBtn) ||
(aCriterionType != SMESH::FT_ElemGeomType && isComboItem) ) (aCriterionType != SMESH::FT_ElemGeomType && isComboItem) )
@ -1445,11 +1451,12 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
} }
else else
{ {
if (aCompareItem->count() != 3) if (aCompareItem && aCompareItem->count() != 3)
{ {
aCompareItem->setItems(getCompare()); aCompareItem->setItems(getCompare());
} }
if (aTable->item( row, 2 )) {
QString aText = aTable->text(row, 2); QString aText = aTable->text(row, 2);
bool isOk = false; bool isOk = false;
aText.toDouble(&isOk); aText.toDouble(&isOk);
@ -1459,6 +1466,7 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
if (!aTable->isEditable(row, 2)) if (!aTable->isEditable(row, 2))
aTable->setEditable(true, row, 2); aTable->setEditable(true, row, 2);
} }
}
updateAdditionalWidget(); updateAdditionalWidget();