mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-28 02:10:35 +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()
|
SALOMEDS::Study_ptr SMESH_Gen_i::GetCurrentStudy()
|
||||||
{
|
{
|
||||||
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::GetCurrentStudy: study Id = " << GetCurrentStudyID() );
|
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::GetCurrentStudy: study Id = " << GetCurrentStudyID() );
|
||||||
|
if ( GetCurrentStudyID() < 0 )
|
||||||
|
return SALOMEDS::Study::_nil();
|
||||||
return SALOMEDS::Study::_duplicate( myCurrentStudy );
|
return SALOMEDS::Study::_duplicate( myCurrentStudy );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1052,13 +1054,18 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa
|
|||||||
aPythonDump << "([";
|
aPythonDump << "([";
|
||||||
|
|
||||||
if (theStatus == SMESH::DRS_OK) {
|
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
|
aStudyBuilder->NewCommand(); // There is a transaction
|
||||||
|
}
|
||||||
aResult->length( aNames.size() );
|
aResult->length( aNames.size() );
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
// Iterate through all meshes and create mesh objects
|
// 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
|
// Python Dump
|
||||||
if (i > 0) aPythonDump << ", ";
|
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 );
|
aResult[i++] = SMESH::SMESH_Mesh::_duplicate( mesh );
|
||||||
meshServant->GetImpl().GetMeshDS()->Modified();
|
meshServant->GetImpl().GetMeshDS()->Modified();
|
||||||
}
|
}
|
||||||
|
if ( !aStudyBuilder->_is_nil() )
|
||||||
aStudyBuilder->CommitCommand();
|
aStudyBuilder->CommitCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ long SMESH_Gen_i::GetBallElementsGroupsTag()
|
|||||||
bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
|
bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
|
||||||
{
|
{
|
||||||
if(MYDEBUG) MESSAGE("CanPublishInStudy - "<<!CORBA::is_nil(myCurrentStudy));
|
if(MYDEBUG) MESSAGE("CanPublishInStudy - "<<!CORBA::is_nil(myCurrentStudy));
|
||||||
if(CORBA::is_nil(myCurrentStudy))
|
if( GetCurrentStudyID() < 0 )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(theIOR);
|
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(theIOR);
|
||||||
|
Loading…
Reference in New Issue
Block a user