Salome HOME
Fix for the problem of import Part crash when sketch with removed sketch elements.
authormpv <mikhail.ponikarov@opencascade.com>
Wed, 15 Jul 2020 18:05:26 +0000 (21:05 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Wed, 15 Jul 2020 18:05:26 +0000 (21:05 +0300)
src/Model/Model_Document.cpp

index 7d9dabeae63c6b15f8e3437ba338621230684685..6046533abec17ecd956ea1e49f5269207f891782 100644 (file)
@@ -388,6 +388,10 @@ bool Model_Document::importPart(const char* theFileName,
   if (isOk && !theCheckOnly) {
     // copy features from the temporary document to the current
     Handle(TDF_RelocationTable) aRelocTable = new TDF_RelocationTable();
+    // add to relocation table source root label to the destination label because
+    // sometimes there could be a reference to root (issue 3267 on import part
+    // with sketch with removed features)
+    aRelocTable->SetRelocation(aTempDoc->Main().Root(), myDoc->Main().Root());
     TDF_LabelList anAllNewFeatures;
     // Perform the copying twice for correct references:
     // 1. copy labels hierarchy and fill the relocation table