summaryrefslogtreecommitdiff
path: root/sd/source/ui/unoidl/unomodel.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-06-15 21:46:13 +0300
committerStephan Bergmann <sbergman@redhat.com>2019-06-17 08:56:36 +0200
commitadc295a1b2e1f2ed43e7eb587fc89d7229e0f122 (patch)
treed045a927d1f88d2574bdef441bc1cbc0b81fd16b /sd/source/ui/unoidl/unomodel.cxx
parentd39846bfd16ad9873795149c370a95f42363bfd9 (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'sd/source/ui/unoidl/unomodel.cxx')
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx21
1 files changed, 6 insertions, 15 deletions
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<SdXImpressDocument*>(sal::static_int_cast<sal_IntPtr>(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<SvxDrawPage>( xPage );
if( pSvxPage )
{
SdPage* pPage = static_cast<SdPage*>( pSvxPage->GetSdrPage() );
@@ -1070,7 +1061,7 @@ css::uno::Reference<css::uno::XInterface> 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<SvxShape>(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<VCLXDevice>( 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<SvxShape>( 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<SdDrawPage>( xPage );
if( pSvxPage )
{
SdPage* pPage = static_cast<SdPage*>(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<SdMasterPage>( xPage );
if(pSdPage == nullptr)
return;