mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0028428: BinMNaming_NamedShapeDriver fails if there are no nodes in NamedShape
Unit test and additional parsing rule for tests are added as well as a minor fix of the draw command for bug24164_2 unit test (in reference array it was impossible to set only one value). Added the exception for the checking in issue 2269, when bad document is read. It checks that there is no crash, but just an error message. If crash is appeared, this test will not skipped anyway. Correction of test for bug2269 and parse.rules
This commit is contained in:
@@ -171,7 +171,6 @@ Standard_Boolean BinMNaming_NamedShapeDriver::Paste
|
||||
theSource >> aNbShapes;
|
||||
TDF_Label aLabel = theTarget->Label ();
|
||||
TNaming_Builder aBuilder (aLabel);
|
||||
if (aNbShapes == 0) return Standard_False;
|
||||
Standard_Integer aVer;
|
||||
Standard_Boolean ok = theSource >> aVer;
|
||||
if(!ok) return Standard_False;
|
||||
@@ -247,8 +246,6 @@ void BinMNaming_NamedShapeDriver::Paste (const Handle(TDF_Attribute)& theSource,
|
||||
for (TNaming_Iterator SItr (aSAtt); SItr.More (); SItr.Next ()) NbShapes++;
|
||||
//--------------------------------------------------------------
|
||||
|
||||
if (NbShapes == 0) return;
|
||||
|
||||
BinTools_ShapeSet& aShapeSet = (BinTools_ShapeSet&) myShapeSet;
|
||||
TNaming_Evolution anEvol = aSAtt->Evolution();
|
||||
|
||||
@@ -317,4 +314,3 @@ void BinMNaming_NamedShapeDriver::ReadShapeSection (Standard_IStream& theIS)
|
||||
else
|
||||
theIS.seekg(aPos); // no shape section is present, try to return to initial point
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user