1 // SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : SALOMEDS_GenericAttribute_i.cxx
8 // Author : Mikhail PONIKAROV
12 #include "SALOMEDS_StudyBuilder_i.hxx"
15 void SALOMEDS_GenericAttribute_i::CheckLocked() throw (SALOMEDS::GenericAttribute::LockProtection) {
16 if (!_myAttr.IsNull() && _myAttr->IsValid() && !CORBA::is_nil(_myOrb)) {
17 Handle(SALOMEDS_IORAttribute) Att;
18 if (_myAttr->Label().Root().FindAttribute(SALOMEDS_IORAttribute::GetID(),Att)){
19 TCollection_AsciiString ch(Att->Get());
20 char* IOR = CORBA::string_dup(ch.ToCString());
21 CORBA::Object_var obj = _myOrb->string_to_object(IOR);
22 SALOMEDS::Study_ptr aStudy = SALOMEDS::Study::_narrow(obj);
23 // ASSERT(!CORBA::is_nil(aStudy));
24 if (aStudy->NewBuilder()->HasOpenCommand()) return;
25 if (aStudy->GetProperties()->IsLocked()) {
26 // INFOS("Locked document modification !!!");
27 throw SALOMEDS::GenericAttribute::LockProtection();