From adc295a1b2e1f2ed43e7eb587fc89d7229e0f122 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Sat, 15 Jun 2019 21:46:13 +0300 Subject: Add comphelper::getUnoTunnelImplementation template Use it instead of classname::getImplementation from UNO3_GETIMPLEMENTATION_* Change-Id: Ifcc8cfcd6369c576250008c76ce31ba79ea3a596 Reviewed-on: https://gerrit.libreoffice.org/74107 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- sd/source/ui/unoidl/unomodel.cxx | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'sd/source/ui/unoidl/unomodel.cxx') diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index e6c15f7f1cd0..b13e3d93a2a8 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -348,15 +348,6 @@ const css::uno::Sequence< sal_Int8 > & SdXImpressDocument::getUnoTunnelId() thro return theSdXImpressDocumentUnoTunnelId::get().getSeq(); } -SdXImpressDocument* SdXImpressDocument::getImplementation( const uno::Reference< uno::XInterface >& xInt ) -{ - css::uno::Reference< css::lang::XUnoTunnel > xUT( xInt, uno::UNO_QUERY ); - if( xUT.is() ) - return reinterpret_cast(sal::static_int_cast(xUT->getSomething( SdXImpressDocument::getUnoTunnelId() ))); - else - return nullptr; -} - sal_Int64 SAL_CALL SdXImpressDocument::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) { if( rIdentifier.getLength() == 16 ) @@ -683,7 +674,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdXImpressDocument::duplicate( con throw lang::DisposedException(); // get pPage from xPage and determine the Id (nPos ) afterwards - SvxDrawPage* pSvxPage = SvxDrawPage::getImplementation( xPage ); + SvxDrawPage* pSvxPage = comphelper::getUnoTunnelImplementation( xPage ); if( pSvxPage ) { SdPage* pPage = static_cast( pSvxPage->GetSdrPage() ); @@ -1070,7 +1061,7 @@ css::uno::Reference SdXImpressDocument::create( } uno::Reference< drawing::XShape > xShape( xRet, uno::UNO_QUERY ); - SvxShape* pShape = xShape.is() ? SvxShape::getImplementation(xShape) : nullptr; + SvxShape* pShape = xShape.is() ? comphelper::getUnoTunnelImplementation(xShape) : nullptr; if (pShape) { xRet.clear(); @@ -1906,7 +1897,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r if( !(xRenderDevice.is() && nPageNumber && ( nPageNumber <= mpDoc->GetSdPageCount( ePageKind ) )) ) return; - VCLXDevice* pDevice = VCLXDevice::getImplementation( xRenderDevice ); + VCLXDevice* pDevice = comphelper::getUnoTunnelImplementation( xRenderDevice ); VclPtr< OutputDevice> pOut = pDevice ? pDevice->GetOutputDevice() : VclPtr< OutputDevice >(); if( !pOut ) @@ -2200,7 +2191,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r if( xShape.is() ) { - SvxShape* pShape = SvxShape::getImplementation( xShape ); + SvxShape* pShape = comphelper::getUnoTunnelImplementation( xShape ); if( pShape ) { @@ -2930,7 +2921,7 @@ void SAL_CALL SdDrawPagesAccess::remove( const uno::Reference< drawing::XDrawPag if( nPageCount > 1 ) { // get pPage from xPage and determine the Id (nPos ) afterwards - SdDrawPage* pSvxPage = SdDrawPage::getImplementation( xPage ); + SdDrawPage* pSvxPage = comphelper::getUnoTunnelImplementation( xPage ); if( pSvxPage ) { SdPage* pPage = static_cast(pSvxPage->GetSdrPage()); @@ -3180,7 +3171,7 @@ void SAL_CALL SdMasterPagesAccess::remove( const uno::Reference< drawing::XDrawP if( nullptr == mpModel || mpModel->mpDoc == nullptr ) throw lang::DisposedException(); - SdMasterPage* pSdPage = SdMasterPage::getImplementation( xPage ); + SdMasterPage* pSdPage = comphelper::getUnoTunnelImplementation( xPage ); if(pSdPage == nullptr) return; -- cgit 'distro/collabora/libreoffice-7-6+backports'>distro/collabora/libreoffice-7-6+backports LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
sg=1'>Expand)
AgeCommit message (Expand)Author
Author