diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-07-25 08:04:34 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-07-25 08:04:34 +0000 |
commit | 5abe57b3dcbf8c0c5707aac2ca523fc2c00d7faf (patch) | |
tree | dfeae6b022041bf5ffccab954886f77938941f29 /vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm | |
parent | a9946452d8fc6b807db0a38d5663433bde3760ec (diff) |
INTEGRATION: CWS aqua11y02 (1.2.30); FILE MERGED
2008/05/26 14:05:04 fne 1.2.30.1: #i89131# set focus correctly for toolbox-comboboxes
Diffstat (limited to 'vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm')
-rw-r--r-- | vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm index ff70c1a6c06f..32d290ce81c6 100644 --- a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm @@ -8,7 +8,7 @@ * * $RCSfile: aqua11ycomponentwrapper.mm,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * * This file is part of OpenOffice.org. * @@ -94,15 +94,14 @@ using namespace ::com::sun::star::uno; +(void)setFocusedAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value { if ( [ value boolValue ] == YES ) { if ( [ wrapper accessibleContext ] -> getAccessibleRole() == AccessibleRole::COMBO_BOX ) { - // special treatment for comboboxes: find the included text area and set focus to it - if ( [ wrapper accessibleContext ] -> getAccessibleChildCount() > 0 ) { - for ( int i = 0; i < [ wrapper accessibleContext ] -> getAccessibleChildCount(); i++ ) { - Reference < XAccessible > rxAccessibleChild = [ wrapper accessibleContext ] -> getAccessibleChild ( i ); - if ( rxAccessibleChild.is() && rxAccessibleChild -> getAccessibleContext().is() && rxAccessibleChild -> getAccessibleContext() -> getAccessibleRole() == AccessibleRole::TEXT ) { - Reference < XAccessibleComponent > rxAccessibleComponent = Reference < XAccessibleComponent > ( rxAccessibleChild -> getAccessibleContext(), UNO_QUERY ); - if ( rxAccessibleComponent.is() ) { - rxAccessibleComponent -> grabFocus(); - } + // special treatment for comboboxes: find the corresponding PANEL and set focus to it + Reference < XAccessible > rxParent = [ wrapper accessibleContext ] -> getAccessibleParent(); + if ( rxParent.is() ) { + Reference < XAccessibleContext > rxContext = rxParent->getAccessibleContext(); + if ( rxContext.is() && rxContext -> getAccessibleRole() == AccessibleRole::PANEL ) { + Reference < XAccessibleComponent > rxComponent = Reference < XAccessibleComponent > ( rxParent -> getAccessibleContext(), UNO_QUERY ); + if ( rxComponent.is() ) { + rxComponent -> grabFocus(); } } } |