diff --git a/src/App/PropertyFile.cpp b/src/App/PropertyFile.cpp index 916db26195..282e1748c1 100644 --- a/src/App/PropertyFile.cpp +++ b/src/App/PropertyFile.cpp @@ -479,7 +479,7 @@ void PropertyFileIncluded::SaveDocFile (Base::Writer &writer) const unsigned char c; std::ostream& to = writer.Stream(); while (from.get((char&)c)) { - to.put((const char)c); + to.put((char)c); } } @@ -503,7 +503,7 @@ void PropertyFileIncluded::RestoreDocFile(Base::Reader &reader) aboutToSetValue(); unsigned char c; while (reader.get((char&)c)) { - to.put((const char)c); + to.put((char)c); } to.close(); diff --git a/src/Mod/Import/App/AppImportPy.cpp b/src/Mod/Import/App/AppImportPy.cpp index 16d8071497..d13c85af05 100644 --- a/src/Mod/Import/App/AppImportPy.cpp +++ b/src/Mod/Import/App/AppImportPy.cpp @@ -290,7 +290,7 @@ private: Base::Reference hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("STEP"); - makeHeader.SetName(new TCollection_HAsciiString((const Standard_CString)Utf8Name.c_str())); + makeHeader.SetName(new TCollection_HAsciiString((Standard_CString)Utf8Name.c_str())); makeHeader.SetAuthorValue (1, new TCollection_HAsciiString(hGrp->GetASCII("Author", "Author").c_str())); makeHeader.SetOrganizationValue (1, new TCollection_HAsciiString(hGrp->GetASCII("Company").c_str())); makeHeader.SetOriginatingSystem(new TCollection_HAsciiString(App::GetApplication().getExecutableName())); diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index 6c20eb94cc..aa7906d554 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -541,11 +541,11 @@ private: // the App Code. std::vector< std::vector > Colors; get_parts_colors(hierarchical_part,FreeLabels,part_id,Colors); - ocaf.reallocateFreeShape(hierarchical_part,FreeLabels,part_id,Colors); - -#if OCC_VERSION_HEX >= 0x070200 - // Update is not performed automatically anymore: https://tracker.dev.opencascade.org/view.php?id=28055 - XCAFDoc_DocumentTool::ShapeTool(hDoc->Main())->UpdateAssemblies(); + ocaf.reallocateFreeShape(hierarchical_part,FreeLabels,part_id,Colors); + +#if OCC_VERSION_HEX >= 0x070200 + // Update is not performed automatically anymore: https://tracker.dev.opencascade.org/view.php?id=28055 + XCAFDoc_DocumentTool::ShapeTool(hDoc->Main())->UpdateAssemblies(); #endif Base::FileInfo file(Utf8Name.c_str()); @@ -571,7 +571,7 @@ private: Base::Reference hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("STEP"); - makeHeader.SetName(new TCollection_HAsciiString((const Standard_CString)(Utf8Name.c_str()))); + makeHeader.SetName(new TCollection_HAsciiString((Standard_CString)(Utf8Name.c_str()))); makeHeader.SetAuthorValue (1, new TCollection_HAsciiString(hGrp->GetASCII("Author", "Author").c_str())); makeHeader.SetOrganizationValue (1, new TCollection_HAsciiString(hGrp->GetASCII("Company").c_str())); makeHeader.SetOriginatingSystem(new TCollection_HAsciiString(App::GetApplication().getExecutableName())); diff --git a/src/Mod/Part/App/FeaturePartCurveNet.cpp b/src/Mod/Part/App/FeaturePartCurveNet.cpp index f416235b37..17a84aaa66 100644 --- a/src/Mod/Part/App/FeaturePartCurveNet.cpp +++ b/src/Mod/Part/App/FeaturePartCurveNet.cpp @@ -57,7 +57,7 @@ App::DocumentObjectExecReturn *CurveNet::execute(void) } TopoShape aShape; - aShape.read((const Standard_CString)FileName.getValue()); + aShape.read(FileName.getValue()); this->Shape.setValue(aShape); return App::DocumentObject::StdReturn; diff --git a/src/Mod/Part/App/FeaturePartImportBrep.cpp b/src/Mod/Part/App/FeaturePartImportBrep.cpp index b62ad75d9c..92c8458e3d 100644 --- a/src/Mod/Part/App/FeaturePartImportBrep.cpp +++ b/src/Mod/Part/App/FeaturePartImportBrep.cpp @@ -59,7 +59,7 @@ App::DocumentObjectExecReturn *ImportBrep::execute(void) } TopoShape aShape; - aShape.importBrep((const Standard_CString)FileName.getValue()); + aShape.importBrep(FileName.getValue()); this->Shape.setValue(aShape); return App::DocumentObject::StdReturn; diff --git a/src/Mod/Part/App/FeaturePartImportIges.cpp b/src/Mod/Part/App/FeaturePartImportIges.cpp index 3b67ec301e..74c424c870 100644 --- a/src/Mod/Part/App/FeaturePartImportIges.cpp +++ b/src/Mod/Part/App/FeaturePartImportIges.cpp @@ -59,7 +59,7 @@ App::DocumentObjectExecReturn *ImportIges::execute(void) } TopoShape aShape; - aShape.importIges((const Standard_CString)FileName.getValue()); + aShape.importIges(FileName.getValue()); this->Shape.setValue(aShape); return App::DocumentObject::StdReturn; diff --git a/src/Mod/Part/App/FeaturePartImportStep.cpp b/src/Mod/Part/App/FeaturePartImportStep.cpp index 2544357824..612e88aa25 100644 --- a/src/Mod/Part/App/FeaturePartImportStep.cpp +++ b/src/Mod/Part/App/FeaturePartImportStep.cpp @@ -58,7 +58,7 @@ App::DocumentObjectExecReturn *ImportStep::execute(void) } TopoShape aShape; - aShape.importStep((const Standard_CString)FileName.getValue()); + aShape.importStep(FileName.getValue()); this->Shape.setValue(aShape); return App::DocumentObject::StdReturn; diff --git a/src/Mod/Part/App/ImportIges.cpp b/src/Mod/Part/App/ImportIges.cpp index 737fef22af..df1fe1a147 100644 --- a/src/Mod/Part/App/ImportIges.cpp +++ b/src/Mod/Part/App/ImportIges.cpp @@ -78,7 +78,7 @@ int Part::ImportIgesParts(App::Document *pcDoc, const char* FileName) Message_MsgFile::LoadFromEnv("CSF_SHMessageStd","SHAPEStd"); IGESControl_Reader aReader; - if (aReader.ReadFile((const Standard_CString)FileName) != IFSelect_RetDone) + if (aReader.ReadFile((Standard_CString)FileName) != IFSelect_RetDone) throw Base::Exception("Error in reading IGES"); // Ignore construction elements diff --git a/src/Mod/Part/App/PropertyTopoShape.cpp b/src/Mod/Part/App/PropertyTopoShape.cpp index 258720a3ae..d590a8553d 100644 --- a/src/Mod/Part/App/PropertyTopoShape.cpp +++ b/src/Mod/Part/App/PropertyTopoShape.cpp @@ -333,7 +333,7 @@ void PropertyPartShape::SaveDocFile (Base::Writer &writer) const // we may run into some problems on the Linux platform static Base::FileInfo fi(App::Application::getTempFileName()); - if (!BRepTools_Write(myShape,(const Standard_CString)fi.filePath().c_str())) { + if (!BRepTools_Write(myShape,(Standard_CString)fi.filePath().c_str())) { // Note: Do NOT throw an exception here because if the tmp. file could // not be created we should not abort. // We only print an error message but continue writing the next files to the @@ -412,7 +412,7 @@ void PropertyPartShape::RestoreDocFile(Base::Reader &reader) // If it's still empty after reading the (non-empty) file there must occurred an error. TopoDS_Shape shape; if (ulSize > 0) { - if (!BRepTools::Read(shape, (const Standard_CString)fi.filePath().c_str(), builder)) { + if (!BRepTools::Read(shape, (Standard_CString)fi.filePath().c_str(), builder)) { // Note: Do NOT throw an exception here because if the tmp. created file could // not be read it's NOT an indication for an invalid input stream 'reader'. // We only print an error message but continue reading the next files from the diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index ddaf088d6c..a094dcb3a0 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -714,7 +714,7 @@ void TopoShape::exportStep(const char *filename) const throw Base::Exception("Error in transferring STEP"); APIHeaderSection_MakeHeader makeHeader(aWriter.Model()); - makeHeader.SetName(new TCollection_HAsciiString((const Standard_CString)(encodeFilename(filename).c_str()))); + makeHeader.SetName(new TCollection_HAsciiString((Standard_CString)(encodeFilename(filename).c_str()))); makeHeader.SetAuthorValue (1, new TCollection_HAsciiString("FreeCAD")); makeHeader.SetOrganizationValue (1, new TCollection_HAsciiString("FreeCAD")); makeHeader.SetOriginatingSystem(new TCollection_HAsciiString("FreeCAD"));