0024822: Solve selection fails after copying
authorvro <vro@opencascade.com>
Thu, 17 Apr 2014 12:18:38 +0000 (16:18 +0400)
committerapn <apn@opencascade.com>
Thu, 17 Apr 2014 12:19:25 +0000 (16:19 +0400)
The method ::Paste() copies myIndex now.
Test case for issue CR24822

src/TNaming/TNaming_Name.cxx
tests/bugs/caf/bug24822 [new file with mode: 0644]

index a38e6e8..7caca2e 100644 (file)
@@ -308,7 +308,7 @@ TopAbs_ShapeEnum TNaming_Name::ShapeType() const
 }
 
 //=======================================================================
 }
 
 //=======================================================================
-//function : Append
+//function : Paste
 //purpose  : 
 //=======================================================================
 
 //purpose  : 
 //=======================================================================
 
@@ -317,7 +317,8 @@ void TNaming_Name::Paste (TNaming_Name& into,
 {
   into.myType      = myType;
   into.myShapeType = myShapeType;
 {
   into.myType      = myType;
   into.myShapeType = myShapeType;
-  into.myShape     = myShape; 
+  into.myShape     = myShape;
+  into.myIndex     = myIndex;
   into.myArgs.Clear();
 //  into.myOrientation = myOrientation;
   Handle(TNaming_NamedShape) NS;
   into.myArgs.Clear();
 //  into.myOrientation = myOrientation;
   Handle(TNaming_NamedShape) NS;
diff --git a/tests/bugs/caf/bug24822 b/tests/bugs/caf/bug24822
new file mode 100644 (file)
index 0000000..bd33b9b
--- /dev/null
@@ -0,0 +1,23 @@
+puts "=========="
+puts "OCC24822"
+puts "=========="
+puts ""
+###################################################
+# Solve selection fails after copying
+###################################################
+
+restore [locate_data_file bug24822_face.brep] f
+explode f w
+
+NewDocument D XmlOcaf
+ImportShape D 0:1 f
+SelectShape D 0:2 f_1 f
+SolveSelection D 0:2
+
+CopyLabel D 0:2 0:3
+
+if [catch { SolveSelection D 0:3 } ] {
+  puts "Error: Solve selection fails after copying"
+} else {
+  puts "OK: Solve selection is good after copying"
+}