From f18ccc8cd60e654baab35d768dc004e5b51477f6 Mon Sep 17 00:00:00 2001 From: vro Date: Thu, 17 Apr 2014 16:18:38 +0400 Subject: [PATCH] 0024822: Solve selection fails after copying The method ::Paste() copies myIndex now. Test case for issue CR24822 --- src/TNaming/TNaming_Name.cxx | 5 +++-- tests/bugs/caf/bug24822 | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 tests/bugs/caf/bug24822 diff --git a/src/TNaming/TNaming_Name.cxx b/src/TNaming/TNaming_Name.cxx index a38e6e81fc..7caca2eb26 100644 --- a/src/TNaming/TNaming_Name.cxx +++ b/src/TNaming/TNaming_Name.cxx @@ -308,7 +308,7 @@ TopAbs_ShapeEnum TNaming_Name::ShapeType() const } //======================================================================= -//function : Append +//function : Paste //purpose : //======================================================================= @@ -317,7 +317,8 @@ void TNaming_Name::Paste (TNaming_Name& into, { 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; diff --git a/tests/bugs/caf/bug24822 b/tests/bugs/caf/bug24822 new file mode 100644 index 0000000000..bd33b9bbbe --- /dev/null +++ b/tests/bugs/caf/bug24822 @@ -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" +}