0032683: Coding Rules, XCAFDoc_Editor::CloneMetaData() - unexpected bitwise operations
authordpasukhi <dpasukhi@opencascade.com>
Thu, 25 Nov 2021 22:26:49 +0000 (01:26 +0300)
committersmoskvin <smoskvin@opencascade.com>
Mon, 29 Nov 2021 21:36:15 +0000 (00:36 +0300)
Fixed problem with incorrect bitwise operators.
Removed forced naming via cloning metadata

src/XCAFDoc/XCAFDoc_Editor.cxx

index dd92a88..11cff3d 100644 (file)
@@ -300,9 +300,9 @@ void XCAFDoc_Editor::CloneMetaData(const TDF_Label& theSrcLabel,
   {
     return;
   }
-  const Standard_Boolean toCopyColor = theToCopyColor & XCAFDoc_DocumentTool::CheckColorTool(theSrcLabel);
-  const Standard_Boolean toCopyLayer = theToCopyLayer & XCAFDoc_DocumentTool::CheckLayerTool(theSrcLabel);
-  const Standard_Boolean toCopyMaterial = theToCopyMaterial & XCAFDoc_DocumentTool::CheckMaterialTool(theSrcLabel);
+  const Standard_Boolean toCopyColor = theToCopyColor && XCAFDoc_DocumentTool::CheckColorTool(theSrcLabel);
+  const Standard_Boolean toCopyLayer = theToCopyLayer && XCAFDoc_DocumentTool::CheckLayerTool(theSrcLabel);
+  const Standard_Boolean toCopyMaterial = theToCopyMaterial && XCAFDoc_DocumentTool::CheckMaterialTool(theSrcLabel);
   const Standard_Boolean toCopyVisMaterial = XCAFDoc_DocumentTool::CheckVisMaterialTool(theSrcLabel);
   // Colors
   if (toCopyColor)
@@ -474,12 +474,4 @@ void XCAFDoc_Editor::CloneMetaData(const TDF_Label& theSrcLabel,
       TDataStd_Name::Set(theDstLabel, aRefName);
     }
   }
-  else
-  {
-    Standard_SStream Stream;
-    TopoDS_Shape aShape = aDstShapeTool->GetShape(theDstLabel);
-    TopAbs::Print(aShape.ShapeType(), Stream);
-    TCollection_AsciiString aName(Stream.str().c_str());
-    TDataStd_Name::Set(theDstLabel, TCollection_ExtendedString(aName));
-  }
 }