accessibility/source/standard/vclxaccessibletoolbox.cxx | 35 +--------------- toolkit/inc/awt/vclxpointer.hxx | 6 -- toolkit/inc/awt/vclxregion.hxx | 7 --- toolkit/source/awt/vclxpointer.cxx | 3 - toolkit/source/awt/vclxregion.cxx | 3 - toolkit/source/awt/vclxwindow.cxx | 2 toolkit/source/helper/vclunohelper.cxx | 2 7 files changed, 7 insertions(+), 51 deletions(-)
New commits: commit 8a1108a0c7bf8e531d9771a5ca29a81a2aeea167 Author: Noel Grandin <[email protected]> AuthorDate: Fri Jan 13 18:32:00 2023 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Jan 16 06:42:00 2023 +0000 XUnoTunnel->dynamic_cast in OToolBoxWindowItem Change-Id: I65e535d9f9a81a3712b14b50cc4906b534533e86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145536 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> 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() ); commit 96cd6623662b719f09596cb700a1f828c75228fd Author: Noel Grandin <[email protected]> AuthorDate: Fri Jan 13 15:34:29 2023 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Jan 16 06:41:53 2023 +0000 XUnoTunnel->dynamic_cast in VCLXPointer Change-Id: I322115c214de5d476f84650eb53dae8452d5d1a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145533 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/toolkit/inc/awt/vclxpointer.hxx b/toolkit/inc/awt/vclxpointer.hxx index 3bfcceeabf0a..103031926919 100644 --- a/toolkit/inc/awt/vclxpointer.hxx +++ b/toolkit/inc/awt/vclxpointer.hxx @@ -22,7 +22,6 @@ #include <com/sun/star/awt/XPointer.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> #include <mutex> @@ -33,7 +32,7 @@ class VCLXPointer final : public cppu::WeakImplHelper< - css::awt::XPointer, css::lang::XUnoTunnel, css::lang::XServiceInfo> + css::awt::XPointer, css::lang::XServiceInfo> { std::mutex maMutex; PointerStyle maPointer; @@ -44,9 +43,6 @@ public: PointerStyle GetPointer() const { return maPointer; } - // css::lang::XUnoTunnel - UNO3_GETIMPLEMENTATION_DECL(VCLXPointer) - // css::awt::XPointer void SAL_CALL setType( sal_Int32 nType ) override; sal_Int32 SAL_CALL getType( ) override; diff --git a/toolkit/source/awt/vclxpointer.cxx b/toolkit/source/awt/vclxpointer.cxx index 89828e48a611..b54161041373 100644 --- a/toolkit/source/awt/vclxpointer.cxx +++ b/toolkit/source/awt/vclxpointer.cxx @@ -29,9 +29,6 @@ VCLXPointer::~VCLXPointer() { } -// css::lang::XUnoTunnel -UNO3_GETIMPLEMENTATION_IMPL( VCLXPointer ); - void VCLXPointer::setType( sal_Int32 nType ) { std::scoped_lock aGuard( maMutex ); diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 284ffb75326b..f5ebe82f02db 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -1146,7 +1146,7 @@ void VCLXWindow::setPointer( const css::uno::Reference< css::awt::XPointer >& rx { SolarMutexGuard aGuard; - VCLXPointer* pPointer = comphelper::getFromUnoTunnel<VCLXPointer>( rxPointer ); + VCLXPointer* pPointer = dynamic_cast<VCLXPointer*>( rxPointer.get() ); if ( pPointer && GetWindow() ) GetWindow()->SetPointer( pPointer->GetPointer() ); } commit e5092fdf2420c81887a7e845af8e00bcedee156e Author: Noel Grandin <[email protected]> AuthorDate: Fri Jan 13 15:22:21 2023 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Jan 16 06:41:46 2023 +0000 XUnoTunnel->dynamic_cast in VCLXRegion Change-Id: I75956a2c713d52c01dcfd47fc0b8506ba526523e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145532 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/toolkit/inc/awt/vclxregion.hxx b/toolkit/inc/awt/vclxregion.hxx index 70b79990c0b3..c0c64d37a6a5 100644 --- a/toolkit/inc/awt/vclxregion.hxx +++ b/toolkit/inc/awt/vclxregion.hxx @@ -21,7 +21,6 @@ #include <com/sun/star/awt/XRegion.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> #include <mutex> @@ -32,8 +31,7 @@ class VCLXRegion final : public cppu::WeakImplHelper< - css::awt::XRegion, - css::lang::XUnoTunnel> + css::awt::XRegion> { std::mutex maMutex; vcl::Region maRegion; @@ -44,9 +42,6 @@ public: const vcl::Region& GetRegion() const { return maRegion; } - // css::lang::XUnoTunnel - UNO3_GETIMPLEMENTATION_DECL(VCLXRegion) - // css::awt::XRegion css::awt::Rectangle SAL_CALL getBounds() override; void SAL_CALL clear() override; diff --git a/toolkit/source/awt/vclxregion.cxx b/toolkit/source/awt/vclxregion.cxx index d9abedecfd54..fff7e7969d9a 100644 --- a/toolkit/source/awt/vclxregion.cxx +++ b/toolkit/source/awt/vclxregion.cxx @@ -31,9 +31,6 @@ VCLXRegion::~VCLXRegion() { } -// css::lang::XUnoTunnel -UNO3_GETIMPLEMENTATION_IMPL( VCLXRegion ); - css::awt::Rectangle VCLXRegion::getBounds() { std::scoped_lock aGuard( maMutex ); diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx index 42b55c6db04f..c0f93ca5d756 100644 --- a/toolkit/source/helper/vclunohelper.cxx +++ b/toolkit/source/helper/vclunohelper.cxx @@ -123,7 +123,7 @@ vcl::Window* VCLUnoHelper::GetWindow( const css::uno::Reference< css::awt::XWind vcl::Region VCLUnoHelper::GetRegion( const css::uno::Reference< css::awt::XRegion >& rxRegion ) { vcl::Region aRegion; - VCLXRegion* pVCLRegion = comphelper::getFromUnoTunnel<VCLXRegion>( rxRegion ); + VCLXRegion* pVCLRegion = dynamic_cast<VCLXRegion*>( rxRegion.get() ); if ( pVCLRegion ) aRegion = pVCLRegion->GetRegion(); else
