-#define RegisteredAttributes 28
-
-UNEXPECT_CATCH(GALockProtection, SALOMEDS::GenericAttribute::LockProtection);
-
-const char AttributesTypeNames[RegisteredAttributes][30] = {
- "AttributeReal", "AttributeInteger",
- "AttributeSequenceOfReal", "AttributeSequenceOfInteger",
- "AttributeName", "AttributeComment",
- "AttributeIOR", "AttributePersistentRef",
- "AttributeDrawable", "AttributeSelectable",
- "AttributeExpandable", "AttributeOpened",
- "AttributeTextColor", "AttributeTextHighlightColor", "AttributePixMap",
- "AttributeTreeNode", "AttributeLocalID",
- "AttributeTarget",
- "AttributeTableOfInteger", "AttributeTableOfReal", "AttributeTableOfString",
- "AttributeStudyProperties",
- "AttributePythonObject",
- "AttributeUserID",
- "AttributeExternalFileDef", "AttributeFileType",
- "AttributeFlags",
- "AttributeGraphic"
-};
-
-const Standard_GUID AttributesGUIDs[RegisteredAttributes] = {
- TDataStd_Real::GetID(), TDataStd_Integer::GetID(),
- SALOMEDS_SequenceOfRealAttribute::GetID(), SALOMEDS_SequenceOfIntegerAttribute::GetID(),
- TDataStd_Name::GetID(), TDataStd_Comment::GetID(),
- SALOMEDS_IORAttribute::GetID(), SALOMEDS_PersRefAttribute::GetID(),
- SALOMEDS_DrawableAttribute::GetID(), SALOMEDS_SelectableAttribute::GetID(),
- SALOMEDS_ExpandableAttribute::GetID(), SALOMEDS_OpenedAttribute::GetID(),
- SALOMEDS_TextColorAttribute::GetID(), SALOMEDS_TextHighlightColorAttribute::GetID(), SALOMEDS_PixMapAttribute::GetID(),
- TDataStd_TreeNode::GetDefaultTreeID(), SALOMEDS_LocalIDAttribute::GetID(),
- SALOMEDS_TargetAttribute::GetID(),
- SALOMEDS_TableOfIntegerAttribute::GetID(), SALOMEDS_TableOfRealAttribute::GetID(), SALOMEDS_TableOfStringAttribute::GetID(),
- SALOMEDS_StudyPropertiesAttribute::GetID(),
- SALOMEDS_PythonObjectAttribute::GetID(),
- Standard_GUID("FFFFFFFF-D9CD-11d6-945D-1050DA506788"),
- SALOMEDS_ExternalFileDef::GetID(), SALOMEDS_FileType::GetID(),
- SALOMEDS_FlagsAttribute::GetID(),
- SALOMEDS_GraphicAttribute::GetID()
-};
-
-void SALOMEDS_GenericAttribute_i::CheckLocked() throw (SALOMEDS::GenericAttribute::LockProtection) {
- Unexpect aCatch(GALockProtection);
- if (!_myAttr.IsNull() && _myAttr->IsValid() && !CORBA::is_nil(_myOrb)) {
- Handle(SALOMEDS_IORAttribute) Att;
- if (_myAttr->Label().Root().FindAttribute(SALOMEDS_IORAttribute::GetID(),Att)){
- TCollection_AsciiString ch(Att->Get());
- char* IOR = CORBA::string_dup(ch.ToCString());
- CORBA::Object_var obj = _myOrb->string_to_object(IOR);
- SALOMEDS::Study_ptr aStudy = SALOMEDS::Study::_narrow(obj);
-// ASSERT(!CORBA::is_nil(aStudy));
- if (aStudy->NewBuilder()->HasOpenCommand()) return;
- if (aStudy->GetProperties()->IsLocked()) {
-// MESSAGE("Locked document modification !!!");
- throw SALOMEDS::GenericAttribute::LockProtection();
- }
- }
- }