-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SALOMEDSImpl_StudyBuilder.cxx
SALOMEDSImpl_SComponent so = _study->GetSComponent (NL);
if(_callbackOnAdd) _callbackOnAdd->OnAddSObject(so);
+ _study->addSO_Notification(so);
_doc->SetModified(true);
SALOMEDSImpl_SObject so = _study->GetSObject(NewLab);
if(_callbackOnAdd) _callbackOnAdd->OnAddSObject(so);
+ _study->addSO_Notification(so);
_doc->SetModified(true);
return so;
SALOMEDSImpl_SObject so = _study->GetSObject(NewLab);
if(_callbackOnAdd) _callbackOnAdd->OnAddSObject(so);
+ _study->addSO_Notification(so);
_doc->SetModified(true);
return so;
Lab.ForgetAllAttributes();
_doc->SetModified(true);
+ _study->removeSO_Notification(anObject);
return true;
}
Lab.ForgetAllAttributes(true);
_doc->SetModified(true);
+ _study->removeSO_Notification(anObject);
return true;
}
char aMultifileState[2];
char ASCIIfileState[2];
+ bool hasModuleData = false;
try {
std::string scoid = anSCO.GetID();
hdf_file->OpenOnDisk(HDF_RDONLY);
hdf_group->OpenOnDisk();
HDFgroup *hdf_sco_group = new HDFgroup((char*)scoid.c_str(), hdf_group);
hdf_sco_group->OpenOnDisk();
+ hasModuleData = true;
unsigned char* aStreamFile = NULL;
int aStreamSize = 0;
std::string aDir = SALOMEDSImpl_Tool::GetDirFromPath(Res);
- bool aResult = (ASCIIfileState[0]=='A')?
+ bool aResult = true;
+ if(aStreamFile && aStreamSize > 0 ) {
+ aResult = (ASCIIfileState[0]=='A')?
aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'):
aDriver->Load(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M');
+ }
if(aStreamFile != NULL) delete []aStreamFile;
}
if (aLocked) _study->GetProperties()->SetLocked(true);
+
+ if (!hasModuleData)
+ return true;
+
_errorCode = "No persistent file";
return false;
}
Lab.ForgetAttribute (SALOMEDSImpl_SObject::GetGUID(aTypeOfAttribute));
_doc->SetModified(true);
+ _study->modifySO_Notification(anObject,0);
return true;
}