diff options
Diffstat (limited to 'accessibility/source/standard/vclxaccessibletoolbox.cxx')
-rw-r--r-- | accessibility/source/standard/vclxaccessibletoolbox.cxx | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index 3dc32a1e1795..bbb4e26f2efa 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -184,7 +184,7 @@ VCLXAccessibleToolBox::~VCLXAccessibleToolBox() VCLXAccessibleToolBoxItem* VCLXAccessibleToolBox::GetItem_Impl( sal_Int32 _nPos, bool _bMustHaveFocus ) { VCLXAccessibleToolBoxItem* pItem = NULL; - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pToolBox && ( !_bMustHaveFocus || pToolBox->HasFocus() ) ) { ToolBoxItemsMap::iterator aIter = m_aAccessibleChildren.find( _nPos ); @@ -198,7 +198,7 @@ VCLXAccessibleToolBoxItem* VCLXAccessibleToolBox::GetItem_Impl( sal_Int32 _nPos, void VCLXAccessibleToolBox::UpdateFocus_Impl() { - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if( !pToolBox ) return; @@ -250,7 +250,7 @@ void VCLXAccessibleToolBox::UpdateFocus_Impl() void VCLXAccessibleToolBox::ReleaseFocus_Impl( sal_Int32 _nPos ) { - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pToolBox ) // #107124#, do not check for focus because this message is also handled in losefocus { ToolBoxItemsMap::iterator aIter = m_aAccessibleChildren.find( _nPos ); @@ -266,7 +266,7 @@ void VCLXAccessibleToolBox::ReleaseFocus_Impl( sal_Int32 _nPos ) void VCLXAccessibleToolBox::UpdateChecked_Impl( sal_Int32 _nPos ) { - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pToolBox ) { sal_uInt16 nFocusId = pToolBox->GetItemId( (sal_uInt16)_nPos ); @@ -291,7 +291,7 @@ void VCLXAccessibleToolBox::UpdateChecked_Impl( sal_Int32 _nPos ) void VCLXAccessibleToolBox::UpdateIndeterminate_Impl( sal_Int32 _nPos ) { - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pToolBox ) { sal_uInt16 nItemId = pToolBox->GetItemId( (sal_uInt16)_nPos ); @@ -347,7 +347,7 @@ void VCLXAccessibleToolBox::UpdateItem_Impl( sal_Int32 _nPos, bool _bItemAdded ) return; } - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pToolBox ) { if ( !_bItemAdded ) @@ -403,7 +403,7 @@ void VCLXAccessibleToolBox::UpdateItem_Impl( sal_Int32 _nPos, bool _bItemAdded ) void VCLXAccessibleToolBox::UpdateAllItems_Impl() { - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pToolBox ) { // deregister the old items @@ -427,7 +427,7 @@ void VCLXAccessibleToolBox::UpdateAllItems_Impl() void VCLXAccessibleToolBox::UpdateCustomPopupItemp_Impl( vcl::Window* pWindow, bool bOpen ) { - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if( pWindow && pToolBox ) { const sal_uInt16 nDownItem = pToolBox->GetDownItemId(); @@ -465,7 +465,7 @@ void VCLXAccessibleToolBox::UpdateItemEnabled_Impl( sal_Int32 _nPos ) void VCLXAccessibleToolBox::HandleSubToolBarEvent( const VclWindowEvent& rVclWindowEvent, bool _bShow ) { vcl::Window* pChildWindow = static_cast<vcl::Window *>(rVclWindowEvent.GetData()); - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pChildWindow && pToolBox && pToolBox == pChildWindow->GetParent() @@ -486,7 +486,7 @@ void VCLXAccessibleToolBox::HandleSubToolBarEvent( const VclWindowEvent& rVclWin void VCLXAccessibleToolBox::ReleaseSubToolBox( ToolBox* _pSubToolBox ) { - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( !pToolBox ) return; @@ -512,7 +512,7 @@ void VCLXAccessibleToolBox::FillAccessibleStateSet( utl::AccessibleStateSetHelpe { VCLXAccessibleComponent::FillAccessibleStateSet( rStateSet ); - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pToolBox ) { rStateSet.AddState( AccessibleStateType::FOCUSABLE ); @@ -533,7 +533,7 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow case VCLEVENT_TOOLBOX_CLICK: case VCLEVENT_TOOLBOX_SELECT: { - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( rVclWindowEvent.GetData() ) { UpdateChecked_Impl( (sal_Int32)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData()) ); @@ -617,14 +617,14 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow case VCLEVENT_OBJECT_DYING : { // if this toolbox is a subtoolbox, we have to relese it from its parent - vcl::Window * pWin = GetWindow(); + VclPtr< vcl::Window > pWin = GetAs< vcl::Window >(); if ( pWin && pWin->GetParent() && pWin->GetParent()->GetType() == WINDOW_TOOLBOX ) { VCLXAccessibleToolBox* pParent = static_cast< VCLXAccessibleToolBox* >( pWin->GetParent()->GetAccessible()->getAccessibleContext().get() ); if ( pParent ) - pParent->ReleaseSubToolBox(static_cast<ToolBox *>(pWin)); + pParent->ReleaseSubToolBox(static_cast<ToolBox *>(pWin.get())); } // dispose all items @@ -704,7 +704,7 @@ sal_Int32 SAL_CALL VCLXAccessibleToolBox::getAccessibleChildCount( ) throw (Run comphelper::OExternalLockGuard aGuard( this ); sal_Int32 nCount = 0; - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pToolBox ) nCount = pToolBox->GetItemCount(); @@ -718,7 +718,7 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleChild( sal comphelper::OExternalLockGuard aGuard( this ); - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pToolBox ) { Reference< XAccessible > xChild; @@ -763,7 +763,7 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleAtPoint( c comphelper::OExternalLockGuard aGuard( this ); Reference< XAccessible > xAccessible; - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pToolBox ) { sal_uInt16 nItemPos = pToolBox->GetItemPos( VCLPoint( _rPoint ) ); @@ -778,7 +778,7 @@ Reference< XAccessible > VCLXAccessibleToolBox::GetItemWindowAccessible( const V { Reference< XAccessible > xReturn; vcl::Window* pChildWindow = static_cast<vcl::Window *>(rVclWindowEvent.GetData()); - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pChildWindow && pToolBox ) { sal_uInt16 nCount = pToolBox->GetItemCount(); @@ -808,7 +808,7 @@ void VCLXAccessibleToolBox::selectAccessibleChild( sal_Int32 nChildIndex ) throw OExternalLockGuard aGuard( this ); if ( nChildIndex < 0 || nChildIndex >= getAccessibleChildCount() ) throw IndexOutOfBoundsException(); - ToolBox * pToolBox = static_cast < ToolBox * > ( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); sal_uInt16 nPos = static_cast < sal_uInt16 > (nChildIndex); pToolBox->ChangeHighlight( nPos ); } @@ -818,9 +818,9 @@ sal_Bool VCLXAccessibleToolBox::isAccessibleChildSelected( sal_Int32 nChildIndex OExternalLockGuard aGuard( this ); if ( nChildIndex < 0 || nChildIndex >= getAccessibleChildCount() ) throw IndexOutOfBoundsException(); - ToolBox * pToolBox = static_cast < ToolBox * > ( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); sal_uInt16 nPos = static_cast < sal_uInt16 > (nChildIndex); - if ( pToolBox != NULL && pToolBox->GetHighlightItemId() == pToolBox->GetItemId( nPos ) ) + if ( pToolBox && pToolBox->GetHighlightItemId() == pToolBox->GetItemId( nPos ) ) return true; else return false; @@ -829,7 +829,7 @@ sal_Bool VCLXAccessibleToolBox::isAccessibleChildSelected( sal_Int32 nChildIndex void VCLXAccessibleToolBox::clearAccessibleSelection( ) throw (RuntimeException, std::exception) { OExternalLockGuard aGuard( this ); - ToolBox * pToolBox = static_cast < ToolBox * > ( GetWindow() ); + VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); pToolBox -> LoseFocus(); } |