]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Fix error with wrong entity type when editing field created on a whole shape
authorvsr <vsr@opencascade.com>
Fri, 15 Nov 2013 09:49:33 +0000 (09:49 +0000)
committervsr <vsr@opencascade.com>
Fri, 15 Nov 2013 09:49:33 +0000 (09:49 +0000)
src/EntityGUI/EntityGUI_FieldDlg.cxx

index 1ab1d8c91619d493ed4b9baa1c9f104e66bb8dde..f8f129ebd58cadb04b1da7d5f7ef6796baff63af 100644 (file)
@@ -1181,7 +1181,7 @@ void EntityGUI_FieldDlg::SelectionIntoArgument()
 
           // re-fill myDimCombo
           //const int curDim = getDim();
-          updateDims( -1 );
+          updateDims( -100 );
 
           // update table
           onDimChange();
@@ -1607,14 +1607,14 @@ void EntityGUI_FieldDlg::updateDims(int curDim)
     {
       exp.Init( aShape, getShapeType(&dim));
       if ( exp.More() && !aShape.IsSame( exp.Current() ))
-      {
         myDimCombo->insertItem( dim, tr( subNames[dim] ), dim );
-        if ( dim == curDim )  // restore current dim
-          myDimCombo->setCurrentIndex( myDimCombo->count()-1 );
-      }
     }
     myDimCombo->insertItem( 4, tr("WHOLE"), -1 );
-    if ( getDim() != curDim )
+
+    int idx = myDimCombo->findData( curDim );
+    if ( idx != -1 )
+      myDimCombo->setCurrentIndex( idx );
+    else 
       myDimCombo->setCurrentIndex( myDimCombo->count()-1-(myDimCombo->count()>1?1:0) );
   }
   myDimCombo->blockSignals( false );