diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-13 18:32:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-16 06:42:00 +0000 |
commit | 8a1108a0c7bf8e531d9771a5ca29a81a2aeea167 (patch) | |
tree | 8f48cdbd199eaac8d166ee6600e53a13d678ff91 /accessibility | |
parent | 96cd6623662b719f09596cb700a1f828c75228fd (diff) |
XUnoTunnel->dynamic_cast in OToolBoxWindowItem
Change-Id: I65e535d9f9a81a3712b14b50cc4906b534533e86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145536
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/standard/vclxaccessibletoolbox.cxx | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index 062ba442c32c..4722db1a0de9 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -25,7 +25,6 @@ #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <o3tl/safeint.hxx> #include <vcl/toolbox.hxx> #include <vcl/vclevent.hxx> @@ -78,14 +77,9 @@ namespace // = OToolBoxWindowItem - typedef ::cppu::ImplHelper1 < XUnoTunnel - > OToolBoxWindowItem_Base; - /** XAccessible implementation for a toolbox item which is represented by a VCL Window */ - class OToolBoxWindowItem - :public OAccessibleWrapper - ,public OToolBoxWindowItem_Base + class OToolBoxWindowItem : public OAccessibleWrapper { private: sal_Int32 m_nIndexInParent; @@ -94,8 +88,6 @@ namespace sal_Int32 getIndexInParent() const { return m_nIndexInParent; } void setIndexInParent( sal_Int32 _nNewIndex ) { m_nIndexInParent = _nNewIndex; } - static const Sequence< sal_Int8 > & getUnoTunnelId(); - public: OToolBoxWindowItem(sal_Int32 _nIndexInParent, const css::uno::Reference< css::uno::XComponentContext >& _rxContext, @@ -110,38 +102,17 @@ namespace } protected: - // XInterface - DECLARE_XINTERFACE( ) - DECLARE_XTYPEPROVIDER( ) - // OAccessibleWrapper virtual rtl::Reference<OAccessibleContextWrapper> createAccessibleContext( const css::uno::Reference< css::accessibility::XAccessibleContext >& _rxInnerContext ) override; - - // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const Sequence< sal_Int8 >& aIdentifier ) override; }; - IMPLEMENT_FORWARD_XINTERFACE2( OToolBoxWindowItem, OAccessibleWrapper, OToolBoxWindowItem_Base ) - IMPLEMENT_FORWARD_XTYPEPROVIDER2( OToolBoxWindowItem, OAccessibleWrapper, OToolBoxWindowItem_Base ) - rtl::Reference<OAccessibleContextWrapper> OToolBoxWindowItem::createAccessibleContext( const Reference< XAccessibleContext >& _rxInnerContext ) { return new OToolBoxWindowItemContext( m_nIndexInParent, getComponentContext(), _rxInnerContext, this, getParent() ); } - - const Sequence< sal_Int8 > & OToolBoxWindowItem::getUnoTunnelId() - { - static const comphelper::UnoIdInit implId; - return implId.getSeq(); - } - - sal_Int64 SAL_CALL OToolBoxWindowItem::getSomething( const Sequence< sal_Int8 >& _rId ) - { - return comphelper::getSomethingImpl(_rId, this); - } } // VCLXAccessibleToolBox @@ -296,7 +267,7 @@ void VCLXAccessibleToolBox::implReleaseToolboxItem( ToolBoxItemsMap::iterator co NotifyAccessibleEvent( AccessibleEventId::CHILD, Any( xItemAcc ), Any() ); } - auto pWindowItem = comphelper::getFromUnoTunnel<OToolBoxWindowItem>(xItemAcc); + auto pWindowItem = dynamic_cast<OToolBoxWindowItem*>(xItemAcc.get()); if ( !pWindowItem ) { static_cast< VCLXAccessibleToolBoxItem* >( xItemAcc.get() )->ReleaseToolBox(); @@ -328,7 +299,7 @@ void VCLXAccessibleToolBox::UpdateItem_Impl( ToolBox::ImplToolItems::size_type _ { Reference< XAccessible > xItemAcc( aIndexAdjust->second ); - auto pWindowItem = comphelper::getFromUnoTunnel<OToolBoxWindowItem>(xItemAcc); + auto pWindowItem = dynamic_cast<OToolBoxWindowItem*>(xItemAcc.get()); if ( !pWindowItem ) { VCLXAccessibleToolBoxItem* pItem = static_cast< VCLXAccessibleToolBoxItem* >( xItemAcc.get() ); |