toolkit/inc/awt/vclxwindows.hxx | 3 +++ toolkit/source/awt/vclxwindows.cxx | 10 ++++++++++ toolkit/source/controls/dialogcontrol.cxx | 3 ++- 3 files changed, 15 insertions(+), 1 deletion(-)
New commits: commit 9f3022ceb036f23b4b0994c3e2fbd1001bff225a Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Thu Dec 1 15:04:59 2022 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Thu Dec 22 12:51:25 2022 +0000 loplugin:unocast (VCLXTabPage) (See the upcoming commit introducing that loplugin:unocast on why such dynamic_casts from UNO types are dangerous.) Change-Id: I90754509513cafd04fa560d76a669a47d587f353 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144750 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/toolkit/inc/awt/vclxwindows.hxx b/toolkit/inc/awt/vclxwindows.hxx index ce96248494ea..78c73c06fcba 100644 --- a/toolkit/inc/awt/vclxwindows.hxx +++ b/toolkit/inc/awt/vclxwindows.hxx @@ -151,6 +151,9 @@ public: VCLXTabPage(); virtual ~VCLXTabPage() override; + sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; + static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); + // css::awt::XView void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) override; diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 8fc6dc0277db..036e57366a6a 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2650,6 +2650,16 @@ VCLXTabPage::~VCLXTabPage() { } +sal_Int64 VCLXTabPage::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { + return comphelper::getSomethingImpl( + aIdentifier, this, comphelper::FallbackToGetSomethingOf<VCLXWindow>{}); +} + +css::uno::Sequence<sal_Int8> const & VCLXTabPage::getUnoTunnelId() { + static comphelper::UnoIdInit const id; + return id.getSeq(); +} + // css::awt::XView void SAL_CALL VCLXTabPage::draw( sal_Int32 nX, sal_Int32 nY ) { diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 67ee3bcc6719..92981a4f5fea 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -36,6 +36,7 @@ #include <cppuhelper/weak.hxx> #include <tools/debug.hxx> #include <comphelper/sequence.hxx> +#include <comphelper/servicehelper.hxx> #include <vcl/outdev.hxx> #include <vcl/image.hxx> @@ -787,7 +788,7 @@ void UnoMultiPageControl::bindPage( const uno::Reference< awt::XControl >& _rxCo uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY ); uno::Reference< beans::XPropertySet > xProps( _rxControl->getModel(), uno::UNO_QUERY ); - VCLXTabPage* pXPage = dynamic_cast< VCLXTabPage* >( xPage.get() ); + VCLXTabPage* pXPage = comphelper::getFromUnoTunnel< VCLXTabPage >( xPage ); TabPage* pPage = pXPage ? pXPage->getTabPage() : nullptr; if ( xTabCntrl.is() && pPage ) {