mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-27 09:50:34 +05:00
Regression bugs_00/A3
More protection from access to a closed study
This commit is contained in:
parent
a483336704
commit
fd6f0fdf57
@ -658,6 +658,8 @@ void SMESH_Gen_i::setCurrentStudy( SALOMEDS::Study_ptr theStudy,
|
||||
SALOMEDS::Study_ptr SMESH_Gen_i::GetCurrentStudy()
|
||||
{
|
||||
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::GetCurrentStudy: study Id = " << GetCurrentStudyID() );
|
||||
if ( GetCurrentStudyID() < 0 )
|
||||
return SALOMEDS::Study::_nil();
|
||||
return SALOMEDS::Study::_duplicate( myCurrentStudy );
|
||||
}
|
||||
|
||||
@ -1052,13 +1054,18 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa
|
||||
aPythonDump << "([";
|
||||
|
||||
if (theStatus == SMESH::DRS_OK) {
|
||||
SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
|
||||
SALOMEDS::StudyBuilder_var aStudyBuilder;
|
||||
if ( GetCurrentStudyID() > -1 )
|
||||
{
|
||||
aStudyBuilder = myCurrentStudy->NewBuilder();
|
||||
aStudyBuilder->NewCommand(); // There is a transaction
|
||||
}
|
||||
aResult->length( aNames.size() );
|
||||
int i = 0;
|
||||
|
||||
// Iterate through all meshes and create mesh objects
|
||||
for ( list<string>::iterator it = aNames.begin(); it != aNames.end(); it++ ) {
|
||||
for ( list<string>::iterator it = aNames.begin(); it != aNames.end(); it++ )
|
||||
{
|
||||
// Python Dump
|
||||
if (i > 0) aPythonDump << ", ";
|
||||
|
||||
@ -1091,6 +1098,7 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa
|
||||
aResult[i++] = SMESH::SMESH_Mesh::_duplicate( mesh );
|
||||
meshServant->GetImpl().GetMeshDS()->Modified();
|
||||
}
|
||||
if ( !aStudyBuilder->_is_nil() )
|
||||
aStudyBuilder->CommitCommand();
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ long SMESH_Gen_i::GetBallElementsGroupsTag()
|
||||
bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
|
||||
{
|
||||
if(MYDEBUG) MESSAGE("CanPublishInStudy - "<<!CORBA::is_nil(myCurrentStudy));
|
||||
if(CORBA::is_nil(myCurrentStudy))
|
||||
if( GetCurrentStudyID() < 0 )
|
||||
return false;
|
||||
|
||||
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(theIOR);
|
||||
|
Loading…
Reference in New Issue
Block a user