diff options
Diffstat (limited to 'chart2/source/controller/accessibility/AccessibleBase.cxx')
-rw-r--r-- | chart2/source/controller/accessibility/AccessibleBase.cxx | 344 |
1 files changed, 81 insertions, 263 deletions
diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx index e5ca33bff4be..9add032de702 100644 --- a/chart2/source/controller/accessibility/AccessibleBase.cxx +++ b/chart2/source/controller/accessibility/AccessibleBase.cxx @@ -21,30 +21,26 @@ #include "AccessibleChartShape.hxx" #include <ObjectHierarchy.hxx> #include <ObjectIdentifier.hxx> -#include <chartview/ExplicitValueProvider.hxx> +#include <ChartView.hxx> +#include <ChartController.hxx> #include <com/sun/star/accessibility/AccessibleEventId.hpp> -#include <com/sun/star/accessibility/AccessibleEventObject.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> -#include <com/sun/star/view/XSelectionSupplier.hpp> -#include <com/sun/star/chart2/XChartDocument.hpp> #include <sal/log.hxx> +#include <utility> #include <vcl/svapp.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <i18nlangtag/languagetag.hxx> -#include <vcl/unohelp.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/window.hxx> #include <vcl/settings.hxx> #include <o3tl/functional.hxx> #include <o3tl/safeint.hxx> -#include <tools/diagnose_ex.h> -#include <unotools/accessiblestatesethelper.hxx> +#include <comphelper/diagnose_ex.hxx> #include <algorithm> #include <iterator> @@ -66,42 +62,27 @@ namespace chart /** @param bMayHaveChildren is false per default */ AccessibleBase::AccessibleBase( - const AccessibleElementInfo & rAccInfo, + AccessibleElementInfo aAccInfo, bool bMayHaveChildren, bool bAlwaysTransparent /* default: false */ ) : - impl::AccessibleBase_Base( m_aMutex ), - m_bIsDisposed( false ), m_bMayHaveChildren( bMayHaveChildren ), m_bChildrenInitialized( false ), - m_nEventNotifierId(0), - m_xStateSetHelper( new ::utl::AccessibleStateSetHelper() ), - m_aAccInfo( rAccInfo ), + m_nStateSet( 0 ), + m_aAccInfo(std::move( aAccInfo )), m_bAlwaysTransparent( bAlwaysTransparent ), m_bStateSetInitialized( false ) { // initialize some states - OSL_ASSERT( m_xStateSetHelper.is() ); - m_xStateSetHelper->AddState( AccessibleStateType::ENABLED ); - m_xStateSetHelper->AddState( AccessibleStateType::SHOWING ); - m_xStateSetHelper->AddState( AccessibleStateType::VISIBLE ); - m_xStateSetHelper->AddState( AccessibleStateType::SELECTABLE ); - m_xStateSetHelper->AddState( AccessibleStateType::FOCUSABLE ); + m_nStateSet |= AccessibleStateType::ENABLED; + m_nStateSet |= AccessibleStateType::SHOWING; + m_nStateSet |= AccessibleStateType::VISIBLE; + m_nStateSet |= AccessibleStateType::SELECTABLE; + m_nStateSet |= AccessibleStateType::FOCUSABLE; } AccessibleBase::~AccessibleBase() { - OSL_ASSERT( m_bIsDisposed ); -} - -bool AccessibleBase::CheckDisposeState( bool bThrowException /* default: true */ ) const -{ - if( bThrowException && - m_bIsDisposed ) - { - throw lang::DisposedException("component has state DEFUNC", - static_cast< uno::XWeak * >( const_cast< AccessibleBase * >( this ))); - } - return m_bIsDisposed; + OSL_ASSERT(!isAlive()); } bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId & rId ) @@ -118,11 +99,11 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId case EventType::GOT_SELECTION: { AddState( AccessibleStateType::SELECTED ); - BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aSelected, aEmpty ); + NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aEmpty, aSelected); AddState( AccessibleStateType::FOCUSED ); aSelected <<= AccessibleStateType::FOCUSED; - BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aSelected, aEmpty, true ); + NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aEmpty, aSelected); SAL_INFO("chart2.accessibility", "Selection acquired by: " << getAccessibleName()); } @@ -131,11 +112,11 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId case EventType::LOST_SELECTION: { RemoveState( AccessibleStateType::SELECTED ); - BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aEmpty, aSelected ); + NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aSelected, aEmpty); AddState( AccessibleStateType::FOCUSED ); aSelected <<= AccessibleStateType::FOCUSED; - BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aEmpty, aSelected, true ); + NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aSelected, aEmpty); SAL_INFO("chart2.accessibility", "Selection lost by: " << getAccessibleName()); } break; @@ -148,15 +129,12 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId ClearableMutexGuard aGuard( m_aMutex ); // make local copy for notification - ChildListVectorType aLocalChildList( m_aChildList ); + std::vector<rtl::Reference<AccessibleBase>> aLocalChildList(m_aChildList); aGuard.clear(); for (auto const& localChild : aLocalChildList) { - // Note: at this place we must be sure to have an AccessibleBase - // object in the UNO reference to XAccessible ! - bStop = (*static_cast< AccessibleBase * > - ( localChild.get() )).NotifyEvent( eEventType, rId ); + bStop = localChild->NotifyEvent(eEventType, rId); if (bStop) break; } @@ -166,18 +144,16 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId return false; } -void AccessibleBase::AddState( sal_Int16 aState ) +void AccessibleBase::AddState( sal_Int64 aState ) { - CheckDisposeState(); - OSL_ASSERT( m_xStateSetHelper.is() ); - m_xStateSetHelper->AddState( aState ); + ensureAlive(); + m_nStateSet |= aState; } -void AccessibleBase::RemoveState( sal_Int16 aState ) +void AccessibleBase::RemoveState( sal_Int64 aState ) { - CheckDisposeState(); - OSL_ASSERT( m_xStateSetHelper.is() ); - m_xStateSetHelper->RemoveState( aState ); + ensureAlive(); + m_nStateSet &= ~aState; } bool AccessibleBase::UpdateChildren() @@ -185,8 +161,7 @@ bool AccessibleBase::UpdateChildren() bool bMustUpdateChildren = false; { MutexGuard aGuard( m_aMutex ); - if( ! m_bMayHaveChildren || - m_bIsDisposed ) + if (!m_bMayHaveChildren || !isAlive()) return false; bMustUpdateChildren = ( m_bMayHaveChildren && @@ -258,7 +233,7 @@ void AccessibleBase::AddChild( AccessibleBase * pChild ) ClearableMutexGuard aGuard( m_aMutex ); - Reference< XAccessible > xChild( pChild ); + rtl::Reference<AccessibleBase> xChild(pChild); m_aChildList.push_back( xChild ); m_aChildOIDMap[ pChild->GetId() ] = xChild; @@ -267,16 +242,13 @@ void AccessibleBase::AddChild( AccessibleBase * pChild ) if( m_bChildrenInitialized ) { Any aEmpty, aNew; - aNew <<= xChild; + aNew <<= uno::Reference<XAccessible>(xChild); aGuard.clear(); - BroadcastAccEvent( AccessibleEventId::CHILD, aNew, aEmpty ); + NotifyAccessibleEvent(AccessibleEventId::CHILD, aEmpty, aNew); } } -/** in this method we imply that the Reference< XAccessible > elements in the - vector are AccessibleBase objects ! - */ void AccessibleBase::RemoveChildByOId( const ObjectIdentifier& rOId ) { ClearableMutexGuard aGuard( m_aMutex ); @@ -285,14 +257,13 @@ void AccessibleBase::RemoveChildByOId( const ObjectIdentifier& rOId ) if( aIt == m_aChildOIDMap.end()) return; - Reference< XAccessible > xChild( aIt->second ); + rtl::Reference<AccessibleBase> xChild(aIt->second); // remove from map m_aChildOIDMap.erase( aIt ); // search child in vector - ChildListVectorType::iterator aVecIter = - std::find( m_aChildList.begin(), m_aChildList.end(), xChild ); + auto aVecIter = std::find(m_aChildList.begin(), m_aChildList.end(), xChild); OSL_ENSURE( aVecIter != m_aChildList.end(), "Inconsistent ChildMap" ); @@ -308,15 +279,14 @@ void AccessibleBase::RemoveChildByOId( const ObjectIdentifier& rOId ) if( bInitialized ) { Any aEmpty, aOld; - aOld <<= xChild; + aOld <<= uno::Reference<XAccessible>(xChild); - BroadcastAccEvent( AccessibleEventId::CHILD, aEmpty, aOld ); + NotifyAccessibleEvent(AccessibleEventId::CHILD, aOld, aEmpty); } // dispose the child - Reference< lang::XComponent > xComp( xChild, UNO_QUERY ); - if( xComp.is()) - xComp->dispose(); + if (xChild.is()) + xChild->dispose(); } awt::Point AccessibleBase::GetUpperLeftOnScreen() const @@ -339,43 +309,12 @@ awt::Point AccessibleBase::GetUpperLeftOnScreen() const return aResult; } -void AccessibleBase::BroadcastAccEvent( - sal_Int16 nId, - const Any & rNew, - const Any & rOld, - bool bSendGlobally ) const -{ - ClearableMutexGuard aGuard( m_aMutex ); - - if ( !m_nEventNotifierId && !bSendGlobally ) - return; - // if we don't have a client id for the notifier, then we don't have listeners, then - // we don't need to notify anything - //except SendGlobally for focus handling? - - // the const cast is needed, because UNO parameters are never const - const AccessibleEventObject aEvent( - const_cast< uno::XWeak * >( static_cast< const uno::XWeak * >( this )), - nId, rNew, rOld ); - - if ( m_nEventNotifierId ) // let the notifier handle this event - ::comphelper::AccessibleEventNotifier::addEvent( m_nEventNotifierId, aEvent ); - - aGuard.clear(); - - // send event to global message queue - if( bSendGlobally ) - { - vcl::unohelper::NotifyAccessibleStateEventGlobally( aEvent ); - } -} - void AccessibleBase::KillAllChildren() { ClearableMutexGuard aGuard( m_aMutex ); // make local copy for notification, and remove all children - ChildListVectorType aLocalChildList; + std::vector<rtl::Reference<AccessibleBase>> aLocalChildList; aLocalChildList.swap( m_aChildList ); m_aChildOIDMap.clear(); @@ -383,16 +322,14 @@ void AccessibleBase::KillAllChildren() // call dispose for all children // and notify listeners - Reference< lang::XComponent > xComp; Any aEmpty, aOld; for (auto const& localChild : aLocalChildList) { - aOld <<= localChild; - BroadcastAccEvent( AccessibleEventId::CHILD, aEmpty, aOld ); + aOld <<= uno::Reference<XAccessible>(localChild); + NotifyAccessibleEvent(AccessibleEventId::CHILD, aOld, aEmpty); - xComp.set(localChild, UNO_QUERY); - if( xComp.is()) - xComp->dispose(); + if (localChild.is()) + localChild->dispose(); } m_bChildrenInitialized = false; } @@ -404,8 +341,7 @@ void AccessibleBase::SetInfo( const AccessibleElementInfo & rNewInfo ) { KillAllChildren(); } - BroadcastAccEvent( AccessibleEventId::INVALIDATE_ALL_CHILDREN, uno::Any(), uno::Any(), - true /* global notification */ ); + NotifyAccessibleEvent(AccessibleEventId::INVALIDATE_ALL_CHILDREN, uno::Any(), uno::Any()); } // ________ (XComponent::dispose) ________ @@ -413,26 +349,15 @@ void SAL_CALL AccessibleBase::disposing() { { MutexGuard aGuard(m_aMutex); - OSL_ENSURE(!m_bIsDisposed, "dispose() called twice"); + OSL_ENSURE(isAlive(), "dispose() called twice"); - // notify disposing to all AccessibleEvent listeners asynchronous - if (m_nEventNotifierId) - { - ::comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(m_nEventNotifierId, - *this); - m_nEventNotifierId = 0; - } + OAccessible::disposing(); // reset pointers + m_aAccInfo.m_pWindow.reset(); m_aAccInfo.m_pParent = nullptr; - // attach new empty state set helper to member reference - rtl::Reference<::utl::AccessibleStateSetHelper> pHelper = new ::utl::AccessibleStateSetHelper(); - pHelper->AddState(AccessibleStateType::DEFUNC); - // release old helper and attach new one - m_xStateSetHelper = pHelper; - - m_bIsDisposed = true; + m_nStateSet = AccessibleStateType::DEFUNC; } // call listeners unguarded @@ -445,18 +370,11 @@ void SAL_CALL AccessibleBase::disposing() OSL_ENSURE( m_aChildList.empty(), "Child list should be empty" ); } -// ________ XAccessible ________ -Reference< XAccessibleContext > SAL_CALL AccessibleBase::getAccessibleContext() -{ - return this; -} - // ________ AccessibleBase::XAccessibleContext ________ -sal_Int32 SAL_CALL AccessibleBase::getAccessibleChildCount() +sal_Int64 SAL_CALL AccessibleBase::getAccessibleChildCount() { ClearableMutexGuard aGuard( m_aMutex ); - if( ! m_bMayHaveChildren || - m_bIsDisposed ) + if (!m_bMayHaveChildren || !isAlive()) return 0; bool bMustUpdateChildren = ( m_bMayHaveChildren && @@ -471,14 +389,14 @@ sal_Int32 SAL_CALL AccessibleBase::getAccessibleChildCount() return ImplGetAccessibleChildCount(); } -sal_Int32 AccessibleBase::ImplGetAccessibleChildCount() const +sal_Int64 AccessibleBase::ImplGetAccessibleChildCount() const { return m_aChildList.size(); } -Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleChild( sal_Int32 i ) +Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleChild( sal_Int64 i ) { - CheckDisposeState(); + ensureAlive(); Reference< XAccessible > xResult; ClearableMutexGuard aGuard( m_aMutex ); @@ -495,9 +413,9 @@ Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleChild( sal_Int32 return xResult; } -Reference< XAccessible > AccessibleBase::ImplGetAccessibleChildById( sal_Int32 i ) const +Reference< XAccessible > AccessibleBase::ImplGetAccessibleChildById( sal_Int64 i ) const { - Reference< XAccessible > xResult; + rtl::Reference<AccessibleBase> xResult; MutexGuard aGuard( m_aMutex); if( ! m_bMayHaveChildren || @@ -513,14 +431,14 @@ Reference< XAccessible > AccessibleBase::ImplGetAccessibleChildById( sal_Int32 i throw aEx; } else - xResult.set( m_aChildList[ i ] ); + xResult = m_aChildList[i]; return xResult; } Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleParent() { - CheckDisposeState(); + ensureAlive(); Reference< XAccessible > aResult; if( m_aAccInfo.m_pParent ) aResult.set( m_aAccInfo.m_pParent ); @@ -528,9 +446,9 @@ Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleParent() return aResult; } -sal_Int32 SAL_CALL AccessibleBase::getAccessibleIndexInParent() +sal_Int64 SAL_CALL AccessibleBase::getAccessibleIndexInParent() { - CheckDisposeState(); + ensureAlive(); if( m_aAccInfo.m_spObjectHierarchy ) return m_aAccInfo.m_spObjectHierarchy->getIndexInParent( GetId() ); @@ -548,11 +466,11 @@ Reference< XAccessibleRelationSet > SAL_CALL AccessibleBase::getAccessibleRelati return aResult; } -Reference< XAccessibleStateSet > SAL_CALL AccessibleBase::getAccessibleStateSet() +sal_Int64 SAL_CALL AccessibleBase::getAccessibleStateSet() { if( ! m_bStateSetInitialized ) { - Reference< view::XSelectionSupplier > xSelSupp( GetInfo().m_xSelectionSupplier ); + rtl::Reference< ::chart::ChartController > xSelSupp( GetInfo().m_xChartController ); if ( xSelSupp.is() ) { ObjectIdentifier aOID( xSelSupp->getSelection() ); @@ -565,36 +483,23 @@ Reference< XAccessibleStateSet > SAL_CALL AccessibleBase::getAccessibleStateSet( m_bStateSetInitialized = true; } - return m_xStateSetHelper; + return m_nStateSet; } lang::Locale SAL_CALL AccessibleBase::getLocale() { - CheckDisposeState(); + ensureAlive(); return Application::GetSettings().GetLanguageTag().getLocale(); } // ________ AccessibleBase::XAccessibleComponent ________ -sal_Bool SAL_CALL AccessibleBase::containsPoint( const awt::Point& aPoint ) -{ - awt::Rectangle aRect( getBounds() ); - - // contains() works with relative coordinates - aRect.X = 0; - aRect.Y = 0; - - return ( aPoint.X >= aRect.X && - aPoint.Y >= aRect.Y && - aPoint.X < (aRect.X + aRect.Width) && - aPoint.Y < (aRect.Y + aRect.Height) ); -} Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleAtPoint( const awt::Point& aPoint ) { - CheckDisposeState(); - Reference< XAccessible > aResult; - awt::Rectangle aRect( getBounds()); + ensureAlive(); + rtl::Reference< AccessibleBase > aResult; + awt::Rectangle aRect( implGetBounds()); // children are positioned relative to this object, so translate bound rect aRect.X = 0; @@ -605,20 +510,18 @@ Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleAtPoint( const aw ( aRect.Y <= aPoint.Y && aPoint.Y <= (aRect.Y + aRect.Height))) { ClearableMutexGuard aGuard( m_aMutex ); - ChildListVectorType aLocalChildList( m_aChildList ); + std::vector<rtl::Reference<AccessibleBase>> aLocalChildList(m_aChildList); aGuard.clear(); - Reference< XAccessibleComponent > aComp; - for (auto const& localChild : aLocalChildList) + for (const rtl::Reference<AccessibleBase>& xLocalChild : aLocalChildList) { - aComp.set(localChild, UNO_QUERY); - if( aComp.is()) + if (xLocalChild.is()) { - aRect = aComp->getBounds(); + aRect = xLocalChild->implGetBounds(); if( ( aRect.X <= aPoint.X && aPoint.X <= (aRect.X + aRect.Width) ) && ( aRect.Y <= aPoint.Y && aPoint.Y <= (aRect.Y + aRect.Height))) { - aResult = localChild; + aResult = xLocalChild; break; } } @@ -628,14 +531,13 @@ Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleAtPoint( const aw return aResult; } -awt::Rectangle SAL_CALL AccessibleBase::getBounds() +css::awt::Rectangle AccessibleBase::implGetBounds() { - ExplicitValueProvider *pExplicitValueProvider( - comphelper::getUnoTunnelImplementation<ExplicitValueProvider>( m_aAccInfo.m_xView )); - if( pExplicitValueProvider ) + rtl::Reference<ChartView> pChartView = m_aAccInfo.m_xView.get(); + if( pChartView ) { - VclPtr<vcl::Window> pWindow( VCLUnoHelper::GetWindow( m_aAccInfo.m_xWindow )); - awt::Rectangle aLogicRect( pExplicitValueProvider->getRectangleOfObject( m_aAccInfo.m_aOID.getObjectCID() )); + VclPtr<vcl::Window> pWindow = m_aAccInfo.m_pWindow; + awt::Rectangle aLogicRect( pChartView->getRectangleOfObject( m_aAccInfo.m_aOID.getObjectCID() )); if( pWindow ) { tools::Rectangle aRect( aLogicRect.X, aLogicRect.Y, @@ -655,49 +557,19 @@ awt::Rectangle SAL_CALL AccessibleBase::getBounds() awt::Point aOffset( aParentLocOnScreen.X - aULOnScreen.X, aParentLocOnScreen.Y - aULOnScreen.Y ); - return awt::Rectangle( aRect.getX() - aOffset.X, aRect.getY() - aOffset.Y, - aRect.getWidth(), aRect.getHeight()); + return awt::Rectangle( aRect.Left() - aOffset.X, aRect.Top() - aOffset.Y, + aRect.getOpenWidth(), aRect.getOpenHeight()); } } return awt::Rectangle(); } -awt::Point SAL_CALL AccessibleBase::getLocation() -{ - CheckDisposeState(); - awt::Rectangle aBBox( getBounds() ); - return awt::Point( aBBox.X, aBBox.Y ); -} - -awt::Point SAL_CALL AccessibleBase::getLocationOnScreen() -{ - CheckDisposeState(); - - if (AccessibleBase* pParent = m_aAccInfo.m_pParent) - { - awt::Point aLocThisRel( getLocation()); - awt::Point aUpperLeft(pParent->getLocationOnScreen()); - - return awt::Point( aUpperLeft.X + aLocThisRel.X, - aUpperLeft.Y + aLocThisRel.Y ); - } - else - return getLocation(); -} - -awt::Size SAL_CALL AccessibleBase::getSize() -{ - CheckDisposeState(); - awt::Rectangle aBBox( getBounds() ); - return awt::Size( aBBox.Width, aBBox.Height ); -} - void SAL_CALL AccessibleBase::grabFocus() { - CheckDisposeState(); + ensureAlive(); - Reference< view::XSelectionSupplier > xSelSupp( GetInfo().m_xSelectionSupplier ); + rtl::Reference< ::chart::ChartController > xSelSupp( GetInfo().m_xChartController ); if ( xSelSupp.is() ) { xSelSupp->select( GetId().getAny() ); @@ -727,13 +599,13 @@ Color AccessibleBase::getColor( eColorType eColType ) if( eType == OBJECTTYPE_LEGEND_ENTRY ) { // for colors get the data series/point properties - OUString aParentParticle( ObjectIdentifier::getFullParentParticle( aObjectCID )); + std::u16string_view aParentParticle( ObjectIdentifier::getFullParentParticle( aObjectCID )); aObjectCID = ObjectIdentifier::createClassifiedIdentifierForParticle( aParentParticle ); } xObjProp = ObjectIdentifier::getObjectPropertySet( - aObjectCID, Reference< chart2::XChartDocument >( m_aAccInfo.m_xChartDocument )); + aObjectCID, m_aAccInfo.m_xChartDocument ); if( xObjProp.is()) { try @@ -778,13 +650,13 @@ Color AccessibleBase::getColor( eColorType eColType ) { if( eColType == ACC_BASE_FOREGROUND ) { - drawing::LineStyle aLStyle; + drawing::LineStyle aLStyle = drawing::LineStyle_SOLID; if( xObjProp->getPropertyValue( aStylePropName ) >>= aLStyle ) bTransparent = (aLStyle == drawing::LineStyle_NONE); } else { - drawing::FillStyle aFStyle; + drawing::FillStyle aFStyle = drawing::FillStyle_SOLID; if( xObjProp->getPropertyValue( aStylePropName ) >>= aFStyle ) bTransparent = (aFStyle == drawing::FillStyle_NONE); } @@ -806,60 +678,6 @@ Color AccessibleBase::getColor( eColorType eColType ) return nResult; } -// ________ AccessibleBase::XServiceInfo ________ -OUString SAL_CALL AccessibleBase::getImplementationName() -{ - return "AccessibleBase"; -} - -sal_Bool SAL_CALL AccessibleBase::supportsService( const OUString& ServiceName ) -{ - return cppu::supportsService( this, ServiceName ); -} - -uno::Sequence< OUString > SAL_CALL AccessibleBase::getSupportedServiceNames() -{ - return { - "com.sun.star.accessibility.Accessible", - "com.sun.star.accessibility.AccessibleContext" - }; -} - -// ________ AccessibleBase::XEventListener ________ -void SAL_CALL AccessibleBase::disposing( const lang::EventObject& /*Source*/ ) -{ -} - -// ________ XAccessibleEventBroadcasters ________ -void SAL_CALL AccessibleBase::addAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener ) -{ - MutexGuard aGuard( m_aMutex ); - - if ( xListener.is() ) - { - if ( !m_nEventNotifierId ) - m_nEventNotifierId = ::comphelper::AccessibleEventNotifier::registerClient(); - - ::comphelper::AccessibleEventNotifier::addEventListener( m_nEventNotifierId, xListener ); - } -} - -void SAL_CALL AccessibleBase::removeAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener ) -{ - MutexGuard aGuard( m_aMutex ); - - if ( xListener.is() && m_nEventNotifierId) - { - sal_Int32 nListenerCount = ::comphelper::AccessibleEventNotifier::removeEventListener( m_nEventNotifierId, xListener ); - if ( !nListenerCount ) - { - // no listeners anymore - ::comphelper::AccessibleEventNotifier::revokeClient( m_nEventNotifierId ); - m_nEventNotifierId = 0; - } - } -} - } // namespace chart /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |