diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-03-29 11:50:15 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-03-29 11:50:15 +0000 |
commit | ad3c126213d5ca83b02b60dfe3b4c455dd628382 (patch) | |
tree | 1c59877d71d0c053c1f9d41a0c190bf04d0bc7d0 /accessibility | |
parent | 8ae53d568c21c9ba2bdb65fa923c4496c35581c8 (diff) |
INTEGRATION: CWS vcl37 (1.10.8); FILE MERGED
2005/03/04 15:30:42 obr 1.10.8.1: #i20314# don't return AccessibleText when disposed
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/bridge/org/openoffice/java/accessibility/Component.java | 94 |
1 files changed, 49 insertions, 45 deletions
diff --git a/accessibility/bridge/org/openoffice/java/accessibility/Component.java b/accessibility/bridge/org/openoffice/java/accessibility/Component.java index a33a70dedcf2..fe613910f92a 100644 --- a/accessibility/bridge/org/openoffice/java/accessibility/Component.java +++ b/accessibility/bridge/org/openoffice/java/accessibility/Component.java @@ -2,9 +2,9 @@ * * $RCSfile: Component.java,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: rt $ $Date: 2004-11-02 14:31:11 $ + * last change: $Author: rt $ $Date: 2005-03-29 12:50:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -329,49 +329,53 @@ public abstract class Component extends java.awt.Component { /** Called by OpenOffice process to notify property changes */ public void notifyEvent(AccessibleEventObject event) { - switch (event.EventId) { - case AccessibleEventId.ACTION_CHANGED: - firePropertyChange(accessibleContext.ACCESSIBLE_ACTION_PROPERTY, - toNumber(event.OldValue), toNumber(event.NewValue)); - break; - case AccessibleEventId.NAME_CHANGED: - // Set the accessible name for the corresponding context, which will fire a property - // change event itself - handleNameChangedEvent(event.NewValue); - break; - case AccessibleEventId.DESCRIPTION_CHANGED: - // Set the accessible description for the corresponding context, which will fire a property - // change event itself - so do not set propertyName ! - handleDescriptionChangedEvent(event.NewValue); - break; - case AccessibleEventId.CHILD: - if (Build.DEBUG) { - System.out.println("Unexpected child event for object of role " + getAccessibleContext().getAccessibleRole()); - } - break; - case AccessibleEventId.STATE_CHANGED: - // Update the internal state set and fire the appropriate PropertyChangedEvent - handleStateChangedEvent(event.OldValue, event.NewValue); - break; - case AccessibleEventId.VISIBLE_DATA_CHANGED: - case AccessibleEventId.BOUNDRECT_CHANGED: - firePropertyChange(AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY, null, null); - break; - case AccessibleEventId.TEXT_CHANGED: - firePropertyChange(AccessibleContext.ACCESSIBLE_TEXT_PROPERTY, - AccessibleTextImpl.convertTextSegment(event.OldValue), - AccessibleTextImpl.convertTextSegment(event.NewValue)); - break; - case AccessibleEventId.CARET_CHANGED: - firePropertyChange(accessibleContext.ACCESSIBLE_CARET_PROPERTY, toNumber(event.OldValue), toNumber(event.NewValue)); - break; - case AccessibleEventId.VALUE_CHANGED: - firePropertyChange(accessibleContext.ACCESSIBLE_VALUE_PROPERTY, toNumber(event.OldValue), toNumber(event.NewValue)); - default: - // Warn about unhandled events - if(Build.DEBUG) { - System.out.println(this + ": unhandled accessibility event id=" + event.EventId); - } + + if ( !disposed ) { + + switch (event.EventId) { + case AccessibleEventId.ACTION_CHANGED: + firePropertyChange(accessibleContext.ACCESSIBLE_ACTION_PROPERTY, + toNumber(event.OldValue), toNumber(event.NewValue)); + break; + case AccessibleEventId.NAME_CHANGED: + // Set the accessible name for the corresponding context, which will fire a property + // change event itself + handleNameChangedEvent(event.NewValue); + break; + case AccessibleEventId.DESCRIPTION_CHANGED: + // Set the accessible description for the corresponding context, which will fire a property + // change event itself - so do not set propertyName ! + handleDescriptionChangedEvent(event.NewValue); + break; + case AccessibleEventId.CHILD: + if (Build.DEBUG) { + System.out.println("Unexpected child event for object of role " + getAccessibleContext().getAccessibleRole()); + } + break; + case AccessibleEventId.STATE_CHANGED: + // Update the internal state set and fire the appropriate PropertyChangedEvent + handleStateChangedEvent(event.OldValue, event.NewValue); + break; + case AccessibleEventId.VISIBLE_DATA_CHANGED: + case AccessibleEventId.BOUNDRECT_CHANGED: + firePropertyChange(AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY, null, null); + break; + case AccessibleEventId.TEXT_CHANGED: + firePropertyChange(AccessibleContext.ACCESSIBLE_TEXT_PROPERTY, + AccessibleTextImpl.convertTextSegment(event.OldValue), + AccessibleTextImpl.convertTextSegment(event.NewValue)); + break; + case AccessibleEventId.CARET_CHANGED: + firePropertyChange(accessibleContext.ACCESSIBLE_CARET_PROPERTY, toNumber(event.OldValue), toNumber(event.NewValue)); + break; + case AccessibleEventId.VALUE_CHANGED: + firePropertyChange(accessibleContext.ACCESSIBLE_VALUE_PROPERTY, toNumber(event.OldValue), toNumber(event.NewValue)); + default: + // Warn about unhandled events + if(Build.DEBUG) { + System.out.println(this + ": unhandled accessibility event id=" + event.EventId); + } + } } } |