0030870: Data Exchange - Add the support for empty draughting models and empty presen...
[occt.git] / src / RWStepVisual / RWStepVisual_RWPresentationLayerAssignment.cxx
index 1a3b1db..070ae7a 100644 (file)
@@ -52,17 +52,16 @@ void RWStepVisual_RWPresentationLayerAssignment::ReadStep
        Handle(StepVisual_HArray1OfLayeredItem) aAssignedItems;
        StepVisual_LayeredItem aAssignedItemsItem;
        Standard_Integer nsub3;
-  if (data->ReadSubList(num, 3, "assigned_items", ach, nsub3)) {
-    Standard_Integer nb3 = data->NbParams(nsub3);
-    if (nb3)
+       if (data->ReadSubList (num,3,"assigned_items",ach,nsub3)) {
+         Standard_Integer nb3 = data->NbParams(nsub3);
+    if (nb3 > 0)
     {
-    
-    aAssignedItems = new StepVisual_HArray1OfLayeredItem(1, nb3);
-    for (Standard_Integer i3 = 1; i3 <= nb3; i3++) {
-      //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
-      if (data->ReadEntity(nsub3, i3, "assigned_items", ach, aAssignedItemsItem))
-        aAssignedItems->SetValue(i3, aAssignedItemsItem);
-    }
+           aAssignedItems = new StepVisual_HArray1OfLayeredItem (1, nb3);
+           for (Standard_Integer i3 = 1; i3 <= nb3; i3 ++) {
+             //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
+             if (data->ReadEntity (nsub3,i3,"assigned_items",ach,aAssignedItemsItem))
+               aAssignedItems->SetValue(i3,aAssignedItemsItem);
+           }
     }
        }