diff --git a/src/STEPCAFControl/STEPCAFControl_Reader.cxx b/src/STEPCAFControl/STEPCAFControl_Reader.cxx index 46533472ee..439873f12a 100644 --- a/src/STEPCAFControl/STEPCAFControl_Reader.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Reader.cxx @@ -1164,8 +1164,8 @@ Standard_Boolean STEPCAFControl_Reader::ReadNames (const Handle(XSControl_WorkSe Handle(StepBasic_ProductDefinitionRelationship) PDR = PDS->Definition().ProductDefinitionRelationship(); if ( PDR.IsNull() ) continue; if ( PDR->HasDescription() && - PDR->Description()->Length() >0 ) name = PDR->Description(); - else if ( !PDR->Name().IsNull() && PDR->Name()->Length() >0 ) name = PDR->Name(); + PDR->Description()->UsefullLength() >0 ) name = PDR->Description(); + else if ( !PDR->Name().IsNull() && PDR->Name()->UsefullLength() >0 ) name = PDR->Name(); else if ( !PDR->Id().IsNull()) name = PDR->Id(); else name = new TCollection_HAsciiString; } @@ -2861,8 +2861,9 @@ static TDF_Label createGDTObjectInXCAF(const Handle(Standard_Transient)& theEnt, else { if(aGISU.IsNull()) continue; - for (Standard_Integer i = 1; i <= aGISU->NbIdentifiedItem(); i++) { - aSeqRI.Append(aGISU->IdentifiedItemValue(i)); + Standard_Integer j =1; + for ( ; j <= aGISU->NbIdentifiedItem(); j++) { + aSeqRI.Append(aGISU->IdentifiedItemValue(j)); } } } diff --git a/tests/bugs/xde/bug27169 b/tests/bugs/xde/bug27169 new file mode 100644 index 0000000000..319bb69eda --- /dev/null +++ b/tests/bugs/xde/bug27169 @@ -0,0 +1,47 @@ +puts "==========" +puts "OCC27169" +puts "==========" +puts "" +######################################################################## +# Suspitious behavior of importing names during STEP import +######################################################################## + +pload DCAF + +ReadStep D [locate_data_file bug27169_robot01.step] + +set label_1 0:1:1:1:1 +set label_2 0:1:1:1:2 +set label_3 0:1:1:1:3 +set label_4 0:1:1:1:4 + +set Name_1 [GetName D ${label_1}] +set Name_2 [GetName D ${label_2}] +set Name_3 [GetName D ${label_3}] +set Name_4 [GetName D ${label_4}] + +puts "Name_1='${Name_1}'" +puts "Name_2='${Name_2}'" +puts "Name_3='${Name_3}'" +puts "Name_4='${Name_4}'" + +if (![regexp {NAUO1} ${Name_1}]) { + puts "Error: Name of entitie ${label_1} is bad" +} else { + puts "OK: Name of entitie ${label_1} is good" +} +if (![regexp {NAUO2} ${Name_2}]) { + puts "Error: Name of entitie ${label_2} is bad" +} else { + puts "OK: Name of entitie ${label_2} is good" +} +if (![regexp {NAUO3} ${Name_3}]) { + puts "Error: Name of entitie ${label_3} is bad" +} else { + puts "OK: Name of entitie ${label_3} is good" +} +if (![regexp {NAUO4} ${Name_4}]) { + puts "Error: Name of entitie ${label_4} is bad" +} else { + puts "OK: Name of entitie ${label_4} is good" +}