accessibleeditbrowseboxcell.cxx (4d7c9de0) accessibleeditbrowseboxcell.cxx (d69df039)
1/**************************************************************
1/**************************************************************
2 *
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
9 * with the License. You may obtain a copy of the License at
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
9 * with the License. You may obtain a copy of the License at
10 *
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
19 *
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_accessibility.hxx"
26#include <accessibility/extended/accessibleeditbrowseboxcell.hxx>
27#include <svtools/editbrowsebox.hxx>

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

124 return m_xInnerContext->getAccessibleDescription();
125 }
126
127 // -----------------------------------------------------------------------------
128 ::rtl::OUString SAL_CALL EditBrowseBoxTableCell::getAccessibleName() throw ( RuntimeException )
129 {
130 SolarMethodGuard aGuard( *this );
131
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_accessibility.hxx"
26#include <accessibility/extended/accessibleeditbrowseboxcell.hxx>
27#include <svtools/editbrowsebox.hxx>

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

124 return m_xInnerContext->getAccessibleDescription();
125 }
126
127 // -----------------------------------------------------------------------------
128 ::rtl::OUString SAL_CALL EditBrowseBoxTableCell::getAccessibleName() throw ( RuntimeException )
129 {
130 SolarMethodGuard aGuard( *this );
131
132 // TODO: localize this!
133 //String sName = mpBrowseBox->GetColumnDescription( getColumnPos( ) );
134
135 //if ( 0 == sName.Len() )
136 //{
137 // sName = String::CreateFromAscii( "Column " );
138 String sName = String::CreateFromAscii( "Column " );
139 sName += String::CreateFromInt32( getColumnPos( ) - 1 );
140 //}
141 sName += String::CreateFromAscii( ", Row " );
142 sName += String::CreateFromInt32( getRowPos( ) );
132 // TODO: localize this!
133 //String sName = mpBrowseBox->GetColumnDescription( getColumnPos( ) );
143
134
144 return ::rtl::OUString( sName );
135 //if ( 0 == sName.Len() )
136 //{
137 // sName = String::CreateFromAscii( "Column " );
138 String sName = String::CreateFromAscii( "Column " );
139 sName += String::CreateFromInt32( getColumnPos( ) - 1 );
140 //}
141 sName += String::CreateFromAscii( ", Row " );
142 sName += String::CreateFromInt32( getRowPos( ) );
143
144 return ::rtl::OUString( sName );
145 }
146
147 // -----------------------------------------------------------------------------
148 Reference< XAccessibleRelationSet > SAL_CALL EditBrowseBoxTableCell::getAccessibleRelationSet() throw ( RuntimeException )
149 {
150 SolarMethodGuard aGuard( *this );
151 return OAccessibleContextWrapperHelper::getAccessibleRelationSet( );
152 }

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

225 {
226 DBG_DTOR( EditBrowseBoxTableCellAccess, NULL );
227 }
228 //--------------------------------------------------------------------
229 Reference< XAccessibleContext > SAL_CALL EditBrowseBoxTableCellAccess::getAccessibleContext( ) throw (RuntimeException)
230 {
231 if ( !m_pBrowseBox || !m_xControlAccessible.is() )
232 throw DisposedException();
145 }
146
147 // -----------------------------------------------------------------------------
148 Reference< XAccessibleRelationSet > SAL_CALL EditBrowseBoxTableCell::getAccessibleRelationSet() throw ( RuntimeException )
149 {
150 SolarMethodGuard aGuard( *this );
151 return OAccessibleContextWrapperHelper::getAccessibleRelationSet( );
152 }

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

225 {
226 DBG_DTOR( EditBrowseBoxTableCellAccess, NULL );
227 }
228 //--------------------------------------------------------------------
229 Reference< XAccessibleContext > SAL_CALL EditBrowseBoxTableCellAccess::getAccessibleContext( ) throw (RuntimeException)
230 {
231 if ( !m_pBrowseBox || !m_xControlAccessible.is() )
232 throw DisposedException();
233 Reference< XAccessibleContext > xMyContext( m_aContext );
234 if ( !xMyContext.is() )
235 {
236 Reference< XAccessibleContext > xInnerContext = m_xControlAccessible->getAccessibleContext();
237 Reference< XAccessible > xMe( this );
233 Reference< XAccessibleContext > xMyContext( m_aContext );
234 if ( !xMyContext.is() )
235 {
236 Reference< XAccessibleContext > xInnerContext = m_xControlAccessible->getAccessibleContext();
237 Reference< XAccessible > xMe( this );
238
238
239 xMyContext = new EditBrowseBoxTableCell( m_xParent, xMe, xInnerContext, *m_pBrowseBox, m_xFocusWindow, m_nRowPos, m_nColPos );
240 m_aContext = xMyContext;
241 }
239 xMyContext = new EditBrowseBoxTableCell( m_xParent, xMe, xInnerContext, *m_pBrowseBox, m_xFocusWindow, m_nRowPos, m_nColPos );
240 m_aContext = xMyContext;
241 }
242 return xMyContext;
243 }
244 //--------------------------------------------------------------------
245 void SAL_CALL EditBrowseBoxTableCellAccess::disposing()
246 {
242 return xMyContext;
243 }
244 //--------------------------------------------------------------------
245 void SAL_CALL EditBrowseBoxTableCellAccess::disposing()
246 {
247 // dispose our context, if it still alive
248 Reference< XComponent > xMyContext( (Reference< XAccessibleContext >)m_aContext, UNO_QUERY );
249 if ( xMyContext.is() )
250 {
251 try
252 {
253 xMyContext->dispose();
254 }
255 catch( const Exception& e )
256 {
257 (void)e;
258 OSL_ENSURE( false, "EditBrowseBoxTableCellAccess::disposing: caught an exception while disposing the context!" );
259 }
260 }
247 // dispose our context, if it is still alive
248 Reference< XComponent > xMyContext( (Reference< XAccessibleContext >)m_aContext, UNO_QUERY );
249 if ( xMyContext.is() )
250 {
251 try
252 {
253 xMyContext->dispose();
254 }
255 catch( const Exception& e )
256 {
257 (void)e;
258 OSL_ENSURE( false, "EditBrowseBoxTableCellAccess::disposing: caught an exception while disposing the context!" );
259 }
260 }
261
261
262 m_pBrowseBox = NULL;
263 m_xControlAccessible.clear();
264 m_aContext = Reference< XAccessibleContext >( );
265 // NO dispose of the inner object there: it is the XAccessible of an window, and disposing
266 // it would delete the respective VCL window
262 m_pBrowseBox = NULL;
263 m_xControlAccessible.clear();
264 m_aContext = Reference< XAccessibleContext >( );
265 // NO dispose of the inner object there: it is the XAccessible of an window, and disposing
266 // it would delete the respective VCL window
267 }
267 }
268
268// .................................................................................
269} // namespace accessibility
270// .................................................................................
269// .................................................................................
270} // namespace accessibility
271// .................................................................................