From: jfa Date: Fri, 17 Aug 2007 08:25:09 +0000 (+0000) Subject: Join modifications from V3_2_0_maintainance (V3_2_6pre4 - T32x_16Aug2007_16h00m) X-Git-Tag: Start_MERGE_MULTIPR_EVOLUTION X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=82d53a8f2576abbb74960a3644beef7cb147f2b7;p=modules%2Fkernel.git Join modifications from V3_2_0_maintainance (V3_2_6pre4 - T32x_16Aug2007_16h00m) --- diff --git a/src/SALOMEDS/SALOME_DriverPy.py b/src/SALOMEDS/SALOME_DriverPy.py index 8346a3979..9e8f5264a 100644 --- a/src/SALOMEDS/SALOME_DriverPy.py +++ b/src/SALOMEDS/SALOME_DriverPy.py @@ -38,7 +38,7 @@ class SALOME_DriverPy_i(SALOMEDS__POA.Driver): return self._ComponentDataType def Save(self, theComponent, theURL, isMultiFile): - return NULL + return "" def SaveASCII(self, theComponent, theURL, isMultiFile): return self.Save(theComponent, theURL, isMultiFile) @@ -56,7 +56,7 @@ class SALOME_DriverPy_i(SALOMEDS__POA.Driver): return 1 def PublishInStudy(self, theStudy, theSObject, theObject, theName): - return NULL + return None def CanCopy(self, theObject): return 0 diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 7c9225a3f..518929b81 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -343,18 +343,20 @@ Handle(TColStd_HSequenceOfTransient) SALOMEDSImpl_Study::FindObjectByName(const Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_Study::FindObjectIOR(const TCollection_AsciiString& anObjectIOR) { _errorCode = ""; - + Handle(SALOMEDSImpl_SObject) aResult = NULL; - + // searching in the datamap for optimization if (myIORLabels.IsBound(anObjectIOR)) { aResult = GetSObject(myIORLabels.Find(anObjectIOR)); // 11 oct 2002: forbidden attributes must be checked here - if (!aResult->GetLabel().IsAttribute(SALOMEDSImpl_AttributeIOR::GetID())) + if (!aResult->GetLabel().IsAttribute(SALOMEDSImpl_AttributeIOR::GetID())) { myIORLabels.UnBind(anObjectIOR); + aResult = NULL; + } } - - if(aResult.IsNull()) _errorCode = "No object was found"; + + if (aResult.IsNull()) _errorCode = "No object was found"; return aResult; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index 423052a77..9b06d1d0f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -335,8 +335,8 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const Handle(SALOMEDSImpl_SComponent)& //Open the Study HDF file HDFfile *hdf_file = new HDFfile(aHDFUrl.ToCString()); - char aMultifileState[2]; - char ASCIIfileState[2]; + char aMultifileState[2] = "S"; // default: single + char ASCIIfileState[2] = "B"; // default: binary try { TCollection_AsciiString scoid = anSCO->GetID(); hdf_file->OpenOnDisk(HDF_RDONLY); @@ -357,16 +357,27 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const Handle(SALOMEDSImpl_SComponent)& hdf_dataset->ReadFromDisk(aStreamFile); hdf_dataset->CloseOnDisk(); hdf_dataset = 0; - } else + } + else aStreamFile = NULL; - HDFdataset *multifile_hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group); - multifile_hdf_dataset->OpenOnDisk(); - multifile_hdf_dataset->ReadFromDisk(aMultifileState); + if (hdf_sco_group->ExistInternalObject("MULTIFILE_STATE")) { + HDFdataset *multifile_hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group); + multifile_hdf_dataset->OpenOnDisk(); + multifile_hdf_dataset->ReadFromDisk(aMultifileState); + + multifile_hdf_dataset->CloseOnDisk(); + multifile_hdf_dataset = 0; + } - HDFdataset *ascii_hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group); - ascii_hdf_dataset->OpenOnDisk(); - ascii_hdf_dataset->ReadFromDisk(ASCIIfileState); + if (hdf_sco_group->ExistInternalObject("ASCII_STATE")) { + HDFdataset *ascii_hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group); + ascii_hdf_dataset->OpenOnDisk(); + ascii_hdf_dataset->ReadFromDisk(ASCIIfileState); + + ascii_hdf_dataset->CloseOnDisk(); + ascii_hdf_dataset = 0; + } // set path without file name from URL //int aFileNameSize = Res.Length(); @@ -395,11 +406,6 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const Handle(SALOMEDSImpl_SComponent)& //if(aDir != NULL) delete []aDir; - multifile_hdf_dataset->CloseOnDisk(); - multifile_hdf_dataset = 0; - ascii_hdf_dataset->CloseOnDisk(); - ascii_hdf_dataset = 0; - hdf_sco_group->CloseOnDisk(); hdf_sco_group = 0; hdf_group->CloseOnDisk(); @@ -420,7 +426,8 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const Handle(SALOMEDSImpl_SComponent)& if (isASCII) { Handle(TColStd_HSequenceOfAsciiString) aFilesToRemove = new TColStd_HSequenceOfAsciiString; aFilesToRemove->Append(aHDFUrl); - SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true); + SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), + aFilesToRemove, true); } if (aLocked) anSCO->GetStudy()->GetProperties()->SetLocked(true);