diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-01-28 13:15:14 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-01-28 13:15:14 +0000 |
commit | 3a4be04bb220400764738d41bd7689556442921d (patch) | |
tree | ac7915eba0ce2939ae683dfb55a54b0d383b7254 /accessibility | |
parent | 71cab43133e4ec9d890faeb094c3447a060127ba (diff) |
INTEGRATION: CWS tbe32 (1.2.16); FILE MERGED
2007/10/31 11:43:29 tbe 1.2.16.1: #i71010# [a11y] OOo doesn't implement the MEMBER_OF relation for radio buttons
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/standard/vclxaccessibleradiobutton.cxx | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/accessibility/source/standard/vclxaccessibleradiobutton.cxx b/accessibility/source/standard/vclxaccessibleradiobutton.cxx index 2668f7304bad..4a7e8245d02b 100644 --- a/accessibility/source/standard/vclxaccessibleradiobutton.cxx +++ b/accessibility/source/standard/vclxaccessibleradiobutton.cxx @@ -4,9 +4,9 @@ * * $RCSfile: vclxaccessibleradiobutton.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: hr $ $Date: 2007-06-27 15:40:15 $ + * last change: $Author: vg $ $Date: 2008-01-28 14:15:14 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -83,6 +83,9 @@ #ifndef _SV_WINDOW_HXX #include <vcl/window.hxx> #endif +#ifndef _SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif using namespace ::com::sun::star; @@ -139,14 +142,20 @@ void VCLXAccessibleRadioButton::FillAccessibleRelationSet( utl::AccessibleRelati { VCLXAccessibleTextComponent::FillAccessibleRelationSet( rRelationSet ); - Window* pWindow = GetWindow(); - if ( pWindow ) + RadioButton* pRadioButton = dynamic_cast< RadioButton* >( GetWindow() ); + if ( pRadioButton ) { - Window *pLabeledBy = pWindow->GetLabeledBy(); - if ( pLabeledBy && pLabeledBy != pWindow ) + ::std::vector< RadioButton* > aGroup; + pRadioButton->GetRadioButtonGroup( aGroup, true ); + if ( !aGroup.empty() ) { - Sequence< Reference< XInterface > > aSequence(1); - aSequence[0] = pLabeledBy->GetAccessible(); + sal_Int32 i = 0; + Sequence< Reference< XInterface > > aSequence( static_cast< sal_Int32 >( aGroup.size() ) ); + ::std::vector< RadioButton* >::const_iterator aEndItr = aGroup.end(); + for ( ::std::vector< RadioButton* >::const_iterator aItr = aGroup.begin(); aItr < aEndItr; ++aItr ) + { + aSequence[i++] = (*aItr)->GetAccessible(); + } rRelationSet.AddRelation( AccessibleRelation( AccessibleRelationType::MEMBER_OF, aSequence ) ); } } |