diff --git a/sfx2/source/control/thumbnailviewitemacc.cxx b/sfx2/source/control/thumbnailviewitemacc.cxx index 3b22f82141d1..3e6f3406b2dd 100644 --- a/sfx2/source/control/thumbnailviewitemacc.cxx +++ b/sfx2/source/control/thumbnailviewitemacc.cxx @@ -192,58 +192,13 @@ lang::Locale SAL_CALL ThumbnailViewItemAcc::getLocale() return aRet; } -void SAL_CALL ThumbnailViewItemAcc::addAccessibleEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener ) -{ - std::scoped_lock aGuard( maMutex ); - - if( !rxListener.is() ) - return; - - bool bFound = false; - - for (auto const& eventListener : mxEventListeners) - { - if( eventListener == rxListener ) - { - bFound = true; - break; - } - } - - if (!bFound) - mxEventListeners.push_back( rxListener ); -} - -void SAL_CALL ThumbnailViewItemAcc::removeAccessibleEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener ) -{ - std::scoped_lock aGuard( maMutex ); - - if( rxListener.is() ) - { - std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter = - std::find(mxEventListeners.begin(), mxEventListeners.end(), rxListener); - - if (aIter != mxEventListeners.end()) - mxEventListeners.erase( aIter ); - } -} - -sal_Bool SAL_CALL ThumbnailViewItemAcc::containsPoint( const awt::Point& aPoint ) -{ - const awt::Rectangle aRect( getBounds() ); - const Point aSize( aRect.Width, aRect.Height ); - const Point aNullPoint, aTestPoint( aPoint.X, aPoint.Y ); - - return tools::Rectangle( aNullPoint, aSize ).Contains( aTestPoint ); -} - uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewItemAcc::getAccessibleAtPoint( const awt::Point& ) { uno::Reference< accessibility::XAccessible > xRet; return xRet; } -awt::Rectangle SAL_CALL ThumbnailViewItemAcc::getBounds() +awt::Rectangle ThumbnailViewItemAcc::implGetBounds() { const SolarMutexGuard aSolarGuard; awt::Rectangle aRet; @@ -276,46 +231,6 @@ awt::Rectangle SAL_CALL ThumbnailViewItemAcc::getBounds() return aRet; } -awt::Point SAL_CALL ThumbnailViewItemAcc::getLocation() -{ - const awt::Rectangle aRect( getBounds() ); - awt::Point aRet; - - aRet.X = aRect.X; - aRet.Y = aRect.Y; - - return aRet; -} - -awt::Point SAL_CALL ThumbnailViewItemAcc::getLocationOnScreen() -{ - const SolarMutexGuard aSolarGuard; - awt::Point aRet; - - if (mpThumbnailViewItem) - { - const Point aPos = mpThumbnailViewItem->getDrawArea().TopLeft(); - const Point aScreenPos( - mpThumbnailViewItem->mrParent.GetDrawingArea()->get_accessible_location_on_screen()); - - aRet.X = aPos.X() + aScreenPos.X(); - aRet.Y = aPos.Y() + aScreenPos.Y(); - } - - return aRet; -} - -awt::Size SAL_CALL ThumbnailViewItemAcc::getSize() -{ - const awt::Rectangle aRect( getBounds() ); - awt::Size aRet; - - aRet.Width = aRect.Width; - aRet.Height = aRect.Height; - - return aRet; -} - void SAL_CALL ThumbnailViewItemAcc::grabFocus() { // nothing to do diff --git a/sfx2/source/control/thumbnailviewitemacc.hxx b/sfx2/source/control/thumbnailviewitemacc.hxx index ff342f698675..bd5aac054404 100644 --- a/sfx2/source/control/thumbnailviewitemacc.hxx +++ b/sfx2/source/control/thumbnailviewitemacc.hxx @@ -19,25 +19,17 @@ #pragma once +#include #include #include -#include -#include -#include - -#include class ThumbnailViewItem; -class ThumbnailViewItemAcc : public ::cppu::WeakImplHelper< css::accessibility::XAccessible, - css::accessibility::XAccessibleEventBroadcaster, - css::accessibility::XAccessibleContext, - css::accessibility::XAccessibleComponent> +class ThumbnailViewItemAcc + : public cppu::ImplInheritanceHelper { private: - - ::std::vector< css::uno::Reference< css::accessibility::XAccessibleEventListener > > - mxEventListeners; std::mutex maMutex; ThumbnailViewItem* mpThumbnailViewItem; @@ -52,10 +44,6 @@ public: // XAccessible virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override; - // XAccessibleEventBroadcaster - virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; - virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; - // XAccessibleContext virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; @@ -68,13 +56,12 @@ public: virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override; virtual css::lang::Locale SAL_CALL getLocale( ) override; + // OCommonAccessibleComponent + virtual css::awt::Rectangle implGetBounds() override; + // XAccessibleComponent - virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; - virtual css::awt::Rectangle SAL_CALL getBounds( ) override; - virtual css::awt::Point SAL_CALL getLocation( ) override; - virtual css::awt::Point SAL_CALL getLocationOnScreen( ) override; - virtual css::awt::Size SAL_CALL getSize( ) override; + virtual void SAL_CALL grabFocus( ) override; virtual sal_Int32 SAL_CALL getForeground( ) override; virtual sal_Int32 SAL_CALL getBackground( ) override;