vclxaccessiblebutton.cxx (c82f2877) vclxaccessiblebutton.cxx (21075d77)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 89 unchanged lines hidden (view full) ---

98 {
99 rStateSet.AddState( AccessibleStateType::FOCUSABLE );
100
101 if ( pButton->GetState() == STATE_CHECK )
102 rStateSet.AddState( AccessibleStateType::CHECKED );
103
104 if ( pButton->IsPressed() )
105 rStateSet.AddState( AccessibleStateType::PRESSED );
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 89 unchanged lines hidden (view full) ---

98 {
99 rStateSet.AddState( AccessibleStateType::FOCUSABLE );
100
101 if ( pButton->GetState() == STATE_CHECK )
102 rStateSet.AddState( AccessibleStateType::CHECKED );
103
104 if ( pButton->IsPressed() )
105 rStateSet.AddState( AccessibleStateType::PRESSED );
106
107 // IA2 CWS: If the button has a poppup menu,it should has the state EXPANDABLE
108 if( pButton->GetType() == WINDOW_MENUBUTTON )
109 {
110 rStateSet.AddState( AccessibleStateType::EXPANDABLE );
111 }
112 if( pButton->GetStyle() & WB_DEFBUTTON )
113 {
114 rStateSet.AddState( AccessibleStateType::DEFAULT );
115 }
106 }
107}
108
109// -----------------------------------------------------------------------------
110// XInterface
111// -----------------------------------------------------------------------------
112
113IMPLEMENT_FORWARD_XINTERFACE2( VCLXAccessibleButton, VCLXAccessibleTextComponent, VCLXAccessibleButton_BASE )

--- 26 unchanged lines hidden (view full) ---

140// XAccessibleContext
141// -----------------------------------------------------------------------------
142
143::rtl::OUString VCLXAccessibleButton::getAccessibleName( ) throw (RuntimeException)
144{
145 OExternalLockGuard aGuard( this );
146
147 ::rtl::OUString aName( VCLXAccessibleTextComponent::getAccessibleName() );
116 }
117}
118
119// -----------------------------------------------------------------------------
120// XInterface
121// -----------------------------------------------------------------------------
122
123IMPLEMENT_FORWARD_XINTERFACE2( VCLXAccessibleButton, VCLXAccessibleTextComponent, VCLXAccessibleButton_BASE )

--- 26 unchanged lines hidden (view full) ---

150// XAccessibleContext
151// -----------------------------------------------------------------------------
152
153::rtl::OUString VCLXAccessibleButton::getAccessibleName( ) throw (RuntimeException)
154{
155 OExternalLockGuard aGuard( this );
156
157 ::rtl::OUString aName( VCLXAccessibleTextComponent::getAccessibleName() );
158
159 // IA2 CWS: Removed special handling for browse/more buttons.
160 // Comment was "the '...' or '<<' or '>>' should be kepted per the requirements from AT"
161 // MT: We did introduce this special handling by intention.
162 // As the original text is still what you get via XAccessibleText,
163 // I think for the accessible name the stuff below is correct.
164
148 sal_Int32 nLength = aName.getLength();
149
150 if ( nLength >= 3 && aName.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("..."), nLength - 3 ) )
151 {
152 if ( nLength == 3 )
153 {
154 // it's a browse button
155 aName = ::rtl::OUString( TK_RES_STRING( RID_STR_ACC_NAME_BROWSEBUTTON ) );

--- 167 unchanged lines hidden ---
165 sal_Int32 nLength = aName.getLength();
166
167 if ( nLength >= 3 && aName.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("..."), nLength - 3 ) )
168 {
169 if ( nLength == 3 )
170 {
171 // it's a browse button
172 aName = ::rtl::OUString( TK_RES_STRING( RID_STR_ACC_NAME_BROWSEBUTTON ) );

--- 167 unchanged lines hidden ---