diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-12-01 15:04:59 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-12-22 12:51:25 +0000 |
commit | 9f3022ceb036f23b4b0994c3e2fbd1001bff225a (patch) | |
tree | 4b1127a08254dd0138c587a199e4b2e2602ffd09 /toolkit | |
parent | 1be70dda02c12a60778b7607cff2520ae1aa611e (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/inc/awt/vclxwindows.hxx | 3 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 10 | ||||
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 3 |
3 files changed, 15 insertions, 1 deletions
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 ) { |