]> OCCT Git - occt-copy.git/commitdiff
0030380: Exception while reading Step-file
authornbv <nbv@opencascade.com>
Tue, 20 Nov 2018 13:34:27 +0000 (16:34 +0300)
committernbv <nbv@opencascade.com>
Thu, 22 Nov 2018 12:22:37 +0000 (15:22 +0300)
Incorrect initialization of array (when upper bound is less than lower bound) has been avoided in some places.

(cherry picked from commit 1277cedd8d3c242426acc3a182c8361bbade5dfd)

24 files changed:
src/RWStepFEA/RWStepFEA_RWCurve3dElementRepresentation.cxx
src/RWStepFEA/RWStepFEA_RWDummyNode.cxx
src/RWStepFEA/RWStepFEA_RWElementRepresentation.cxx
src/RWStepFEA/RWStepFEA_RWFeaModel.cxx
src/RWStepFEA/RWStepFEA_RWFeaModel3d.cxx
src/RWStepFEA/RWStepFEA_RWGeometricNode.cxx
src/RWStepFEA/RWStepFEA_RWNode.cxx
src/RWStepFEA/RWStepFEA_RWNodeRepresentation.cxx
src/RWStepFEA/RWStepFEA_RWNodeWithSolutionCoordinateSystem.cxx
src/RWStepFEA/RWStepFEA_RWNodeWithVector.cxx
src/RWStepFEA/RWStepFEA_RWSurface3dElementRepresentation.cxx
src/RWStepFEA/RWStepFEA_RWVolume3dElementRepresentation.cxx
src/RWStepShape/RWStepShape_RWCompoundShapeRepresentation.cxx
src/RWStepShape/RWStepShape_RWConnectedFaceShapeRepresentation.cxx
src/RWStepShape/RWStepShape_RWEdgeBasedWireframeShapeRepresentation.cxx
src/RWStepShape/RWStepShape_RWNonManifoldSurfaceShapeRepresentation.cxx
src/RWStepShape/RWStepShape_RWPointRepresentation.cxx
src/RWStepShape/RWStepShape_RWShapeDimensionRepresentation.cxx
src/RWStepShape/RWStepShape_RWShapeRepresentationWithParameters.cxx
src/RWStepVisual/RWStepVisual_RWDraughtingModel.cxx
src/STEPConstruct/STEPConstruct_Styles.cxx
src/StepData/StepData_StepReaderData.cxx
src/StepVisual/StepVisual_PresentationLayerAssignment.cxx
tests/bugs/step/bug30380 [new file with mode: 0644]

index 14a96079f2867935517ff8f638ef58018b6c0576..59d124eea03e94f4194eccd754768f0e0c19c36c 100644 (file)
@@ -127,7 +127,7 @@ void RWStepFEA_RWCurve3dElementRepresentation::WriteStep (StepData_StepWriter& S
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -166,7 +166,7 @@ void RWStepFEA_RWCurve3dElementRepresentation::Share (const Handle(StepFEA_Curve
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index c4b86c4a09bdbed72c7c60e613956393ef02f915..4a3cedfb8fc7917f6bd97afbe73c22f03312b946 100644 (file)
@@ -94,7 +94,7 @@ void RWStepFEA_RWDummyNode::WriteStep (StepData_StepWriter& SW,
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -118,7 +118,7 @@ void RWStepFEA_RWDummyNode::Share (const Handle(StepFEA_DummyNode) &ent,
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 50736dcfddb9252d1ca7214f2a8da9278d2c4243..b26d60daeb35d6eadb46ce828fc14a610070ed45 100644 (file)
@@ -105,7 +105,7 @@ void RWStepFEA_RWElementRepresentation::WriteStep (StepData_StepWriter& SW,
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -134,7 +134,7 @@ void RWStepFEA_RWElementRepresentation::Share (const Handle(StepFEA_ElementRepre
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 366311e490264df5921a83d49a04aa20c274e488..aa6be8fe5c390b34a45db94161132b06876f8c13 100644 (file)
@@ -117,7 +117,7 @@ void RWStepFEA_RWFeaModel::WriteStep (StepData_StepWriter& SW,
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -153,7 +153,7 @@ void RWStepFEA_RWFeaModel::Share (const Handle(StepFEA_FeaModel) &ent,
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 87afc5eb183cf90f78430ff7bd0fa2f94ada2a93..a8320ea8811ef8808f70f94ff3812a97164704fb 100644 (file)
@@ -117,7 +117,7 @@ void RWStepFEA_RWFeaModel3d::WriteStep (StepData_StepWriter& SW,
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -153,7 +153,7 @@ void RWStepFEA_RWFeaModel3d::Share (const Handle(StepFEA_FeaModel3d) &ent,
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 8a3a59b128b13969e60257e2d8de045791e7c06d..9c9af39cec6d122c6fc854af638db16e02c1ed90 100644 (file)
@@ -94,7 +94,7 @@ void RWStepFEA_RWGeometricNode::WriteStep (StepData_StepWriter& SW,
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -118,7 +118,7 @@ void RWStepFEA_RWGeometricNode::Share (const Handle(StepFEA_GeometricNode) &ent,
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 9cd0602bb04eebeef86c3381d6359135494d649d..0082e89cfb22d0037c781004e4d72b27ab418b50 100644 (file)
@@ -94,7 +94,7 @@ void RWStepFEA_RWNode::WriteStep (StepData_StepWriter& SW,
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -118,7 +118,7 @@ void RWStepFEA_RWNode::Share (const Handle(StepFEA_Node) &ent,
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index a3d7694ed6be0bf162748a873a1aa43abaf1a5c8..36ed76443bdd4c2338a7a7348f70aa37d0edd7bb 100644 (file)
@@ -94,7 +94,7 @@ void RWStepFEA_RWNodeRepresentation::WriteStep (StepData_StepWriter& SW,
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -118,7 +118,7 @@ void RWStepFEA_RWNodeRepresentation::Share (const Handle(StepFEA_NodeRepresentat
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 12d80686e13e0fd683f3e246c0f18e4bec256565..ae2e6b012318be93ef0736928cb1ab1b8bf4cc33 100644 (file)
@@ -94,7 +94,7 @@ void RWStepFEA_RWNodeWithSolutionCoordinateSystem::WriteStep (StepData_StepWrite
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -118,7 +118,7 @@ void RWStepFEA_RWNodeWithSolutionCoordinateSystem::Share (const Handle(StepFEA_N
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 9469c856c5006ebc99aaee2497d6e249def56db1..54aee7e877984d9f9e69a71a88831df031e66ac3 100644 (file)
@@ -94,7 +94,7 @@ void RWStepFEA_RWNodeWithVector::WriteStep (StepData_StepWriter& SW,
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -118,7 +118,7 @@ void RWStepFEA_RWNodeWithVector::Share (const Handle(StepFEA_NodeWithVector) &en
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index c525aed3e1eb0949c5412b2dddaddf0167402477..d7606faa8b236bdf2999e45cbb6710c544417ef4 100644 (file)
@@ -127,7 +127,7 @@ void RWStepFEA_RWSurface3dElementRepresentation::WriteStep (StepData_StepWriter&
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -166,7 +166,7 @@ void RWStepFEA_RWSurface3dElementRepresentation::Share (const Handle(StepFEA_Sur
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 84154454f96307d8d9ae15f7c360896375d27059..53375399ab1316a224e3c2fd853e9a83a48674dd 100644 (file)
@@ -122,7 +122,7 @@ void RWStepFEA_RWVolume3dElementRepresentation::WriteStep (StepData_StepWriter&
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -159,7 +159,7 @@ void RWStepFEA_RWVolume3dElementRepresentation::Share (const Handle(StepFEA_Volu
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 3dbc356bed48695b2921e198e0b16f4778f497f4..80d52c60ea3f080aede78a9208fd59c41027c20e 100644 (file)
@@ -87,7 +87,7 @@ void RWStepShape_RWCompoundShapeRepresentation::WriteStep (StepData_StepWriter&
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -107,7 +107,7 @@ void RWStepShape_RWCompoundShapeRepresentation::Share (const Handle(StepShape_Co
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 9ad0c3c23210e3c85207f0c2600c08e659072530..fabfd8f8502d8f13bc19a3103e1c5b62cf7446b2 100644 (file)
@@ -87,7 +87,7 @@ void RWStepShape_RWConnectedFaceShapeRepresentation::WriteStep (StepData_StepWri
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -107,7 +107,7 @@ void RWStepShape_RWConnectedFaceShapeRepresentation::Share (const Handle(StepSha
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 72dbad259b34a60aec7fdc6b48ec0c5ca477814a..08c0e611d3b320df2b8463ee237af1a5efbf3147 100644 (file)
@@ -87,7 +87,7 @@ void RWStepShape_RWEdgeBasedWireframeShapeRepresentation::WriteStep (StepData_St
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -107,7 +107,7 @@ void RWStepShape_RWEdgeBasedWireframeShapeRepresentation::Share (const Handle(St
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 27b4ff6b264363e27b024065989539692449bc31..6c6d9bae71a99ab8d6ec5eb6719d1a4876f3ebf9 100644 (file)
@@ -87,7 +87,7 @@ void RWStepShape_RWNonManifoldSurfaceShapeRepresentation::WriteStep (StepData_St
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -107,7 +107,7 @@ void RWStepShape_RWNonManifoldSurfaceShapeRepresentation::Share (const Handle(St
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 5243d03b8ba6b8264896dad8a23befcbadab0f2e..a911af0cac2f388412076e0ec4708a78300de06b 100644 (file)
@@ -87,7 +87,7 @@ void RWStepShape_RWPointRepresentation::WriteStep (StepData_StepWriter& SW,
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -107,7 +107,7 @@ void RWStepShape_RWPointRepresentation::Share (const Handle(StepShape_PointRepre
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 384cf03c843df672323e179b8fdd51d968e60b2a..76556992ed6bbba771daaa30548e9e33192abf0c 100644 (file)
@@ -107,7 +107,7 @@ void RWStepShape_RWShapeDimensionRepresentation::WriteStep (StepData_StepWriter&
 
   SW.OpenSub();
   if (ent->ItemsAP242().IsNull()) {
-    for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+    for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
       Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
       SW.Send (Var0);
     }
@@ -135,7 +135,7 @@ void RWStepShape_RWShapeDimensionRepresentation::Share (const Handle(StepShape_S
   // Inherited fields of Representation
 
   if (ent->ItemsAP242().IsNull()) {
-    for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+    for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
       Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
       iter.AddItem (Var0);
     }
index 9e07e93e809c3bba5d9197a72b8f71920eaea4cf..91559411b861386ad261c082017461e079c894ac 100644 (file)
@@ -87,7 +87,7 @@ void RWStepShape_RWShapeRepresentationWithParameters::WriteStep (StepData_StepWr
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -107,7 +107,7 @@ void RWStepShape_RWShapeRepresentationWithParameters::Share (const Handle(StepSh
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index 5a941ec0f93486017d3b125691ddfaeac097a944..13161312c16a5000334bc96cb7b77765bacf2539 100644 (file)
@@ -87,7 +87,7 @@ void RWStepVisual_RWDraughtingModel::WriteStep (StepData_StepWriter& SW,
   SW.Send (ent->StepRepr_Representation::Name());
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     SW.Send (Var0);
   }
@@ -107,7 +107,7 @@ void RWStepVisual_RWDraughtingModel::Share (const Handle(StepVisual_DraughtingMo
 
   // Inherited fields of Representation
 
-  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
+  for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
     iter.AddItem (Var0);
   }
index ad131f96c001c5f8015232bc547278f43f17d335..cbe27efd07479f4633f8344aa39efa9d18f8c6d9 100644 (file)
@@ -559,7 +559,7 @@ Standard_Boolean STEPConstruct_Styles::GetColors (const Handle(StepVisual_Styled
   // parse on styles
   for(Standard_Integer j=1; j<=style->NbStyles(); j++ ) {
     Handle(StepVisual_PresentationStyleAssignment) PSA = style->StylesValue ( j );
-    if(PSA.IsNull()) continue;
+    if(PSA.IsNull() || PSA->Styles().IsNull()) continue;
     IsComponent = Standard_True;
     
     for(Standard_Integer k=1; k<=PSA->NbStyles(); k++ ) {
index bcfd329a9a38b7217d521c0dd8ab614b380425a6..7001b7e11203d3fc3c56779adb2c0ca5c3a2fb07 100644 (file)
@@ -477,7 +477,10 @@ Standard_Boolean StepData_StepReaderData::ReadSubList(const Standard_Integer num
                                                       const Standard_Integer /* lenmax */) const
 {
   numsub = SubListNumber (num,nump,Standard_False);
-  if (numsub > 0) return Standard_True;
+  if (numsub > 0)
+  {
+    return (NbParams(numsub) > 0);
+  }
 //  Si optionel indefini, on passe l eponge
   numsub = 0;
   Standard_Boolean isvoid = (Param(num,nump).ParamType() == Interface_ParamVoid);
index c48d6761918f59760368237d863b977555f13135..4b7a7378bcf60385b426dce79643428d55d3aeed 100644 (file)
@@ -70,5 +70,5 @@ StepVisual_LayeredItem StepVisual_PresentationLayerAssignment::AssignedItemsValu
 
 Standard_Integer StepVisual_PresentationLayerAssignment::NbAssignedItems () const
 {
-       return assignedItems->Length();
+       return assignedItems.IsNull()? 0 : assignedItems->Length();
 }
diff --git a/tests/bugs/step/bug30380 b/tests/bugs/step/bug30380
new file mode 100644 (file)
index 0000000..923f136
--- /dev/null
@@ -0,0 +1,13 @@
+puts "=========="
+puts "0030380: Ex-ception while reading Step-file"
+puts "=========="
+puts ""
+
+ReadStep D_First [locate_data_file bug29633_nist_ctc_05_asme1_ap242-1.stp]
+XGetOneShape result D_First 
+
+checkshape result
+
+checknbshapes result -solid 1 -shell 1 -face 156 -wire 201
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png