diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-09-06 00:50:24 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-09-06 11:55:50 +0200 |
commit | f599c31fe68882f510cf3d101102e71f9bf795c8 (patch) | |
tree | ced0a58620c5aea8420638847192f298d139297b /sd | |
parent | 8811516e2e9e71dd45198081d26c748cdf4d831a (diff) |
tdf#39593 use isUnoTunnelId
Adapt getUnoTunnelId methods where required: rename or make public.
Change-Id: I0fd2120bf9f0ff1aa690329a65ff64a154c89315
Reviewed-on: https://gerrit.libreoffice.org/78680
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/inc/ViewTabBar.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/view/ViewTabBar.cxx | 3 |
3 files changed, 9 insertions, 9 deletions
diff --git a/sd/source/ui/inc/ViewTabBar.hxx b/sd/source/ui/inc/ViewTabBar.hxx index 3401966657a5..4d205fb88dc0 100644 --- a/sd/source/ui/inc/ViewTabBar.hxx +++ b/sd/source/ui/inc/ViewTabBar.hxx @@ -110,6 +110,8 @@ public: //----- XUnoTunnel -------------------------------------------------------- + static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); + virtual sal_Int64 SAL_CALL getSomething (const css::uno::Sequence<sal_Int8>& rId) override; /** The returned value is calculated as the difference between the @@ -159,7 +161,6 @@ private: static vcl::Window* GetAnchorWindow( const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewTabBarId, const css::uno::Reference<css::frame::XController>& rxController); - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); }; } // end of namespace sd diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 20bdfbd110e4..c3c54fd2ef59 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -350,13 +350,13 @@ const css::uno::Sequence< sal_Int8 > & SdXImpressDocument::getUnoTunnelId() thro sal_Int64 SAL_CALL SdXImpressDocument::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) { - if( rIdentifier.getLength() == 16 ) - { - if( 0 == memcmp( SdXImpressDocument::getUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) ) - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); + if( isUnoTunnelId<SdXImpressDocument>(rIdentifier) ) + return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - if( 0 == memcmp( SdrModel::getUnoTunnelImplementationId().getConstArray(), rIdentifier.getConstArray(), 16 ) ) - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(mpDoc)); + if( (rIdentifier.getLength() == 16) && + (0 == memcmp( SdrModel::getUnoTunnelImplementationId().getConstArray(), rIdentifier.getConstArray(), 16 ))) + { + return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(mpDoc)); } return SfxBaseModel::getSomething( rIdentifier ); diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx index 969a59aa689d..9c9abdabb2c1 100644 --- a/sd/source/ui/view/ViewTabBar.cxx +++ b/sd/source/ui/view/ViewTabBar.cxx @@ -314,8 +314,7 @@ sal_Int64 SAL_CALL ViewTabBar::getSomething (const Sequence<sal_Int8>& rId) { sal_Int64 nResult = 0; - if (rId.getLength() == 16 - && memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0) + if (isUnoTunnelId<ViewTabBar>(rId)) { nResult = reinterpret_cast<sal_Int64>(this); } |