summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-01-20 13:38:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-01-22 19:10:35 +0000
commit3b7c9d40cb15d3c2bc2ec047edc1592a767f5f23 (patch)
treec9a48f4862756eee789b4d995551199f960d5e89 /sd
parent89ee1addd06d913ab65d61e01cf05d688bdc9904 (diff)
XUnoTunnel->dynamic_cast in SdLayer
Change-Id: Id61d38dd9f3066d07ec325494753cd9096152e9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145970 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/unoidl/SdUnoDrawView.cxx2
-rw-r--r--sd/source/ui/unoidl/unolayer.cxx13
-rw-r--r--sd/source/ui/unoidl/unolayer.hxx4
3 files changed, 7 insertions, 12 deletions
diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx
index 7714032637c4..115a58f84b31 100644
--- a/sd/source/ui/unoidl/SdUnoDrawView.cxx
+++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx
@@ -130,7 +130,7 @@ void SdUnoDrawView::setActiveLayer (const Reference<drawing::XLayer>& rxLayer)
if ( ! rxLayer.is())
return;
- SdLayer* pLayer = comphelper::getFromUnoTunnel<SdLayer> (rxLayer);
+ SdLayer* pLayer = dynamic_cast<SdLayer*> (rxLayer.get());
if (pLayer == nullptr)
return;
diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx
index 0706ff552941..0db58c58e5a4 100644
--- a/sd/source/ui/unoidl/unolayer.cxx
+++ b/sd/source/ui/unoidl/unolayer.cxx
@@ -88,9 +88,6 @@ SdLayer::~SdLayer() noexcept
{
}
-// uno helper
-UNO3_GETIMPLEMENTATION_IMPL( SdLayer );
-
// XServiceInfo
OUString SAL_CALL SdLayer::getImplementationName()
{
@@ -456,7 +453,7 @@ void SAL_CALL SdLayerManager::remove( const uno::Reference< drawing::XLayer >& x
if( mpModel == nullptr )
throw lang::DisposedException();
- SdLayer* pSdLayer = comphelper::getFromUnoTunnel<SdLayer>(xLayer);
+ SdLayer* pSdLayer = dynamic_cast<SdLayer*>(xLayer.get());
if(pSdLayer && GetView())
{
@@ -476,8 +473,10 @@ void SAL_CALL SdLayerManager::attachShapeToLayer( const uno::Reference< drawing:
if( mpModel == nullptr )
throw lang::DisposedException();
- SdLayer* pSdLayer = comphelper::getFromUnoTunnel<SdLayer>(xLayer);
- SdrLayer* pSdrLayer = pSdLayer?pSdLayer->GetSdrLayer():nullptr;
+ SdLayer* pSdLayer = dynamic_cast<SdLayer*>(xLayer.get());
+ if(pSdLayer==nullptr)
+ return;
+ SdrLayer* pSdrLayer = pSdLayer->GetSdrLayer();
if(pSdrLayer==nullptr)
return;
@@ -662,7 +661,7 @@ bool compare_layers (const uno::WeakReference<uno::XInterface>& xRef, void const
uno::Reference<uno::XInterface> xLayer (xRef);
if (xLayer.is())
{
- SdLayer* pSdLayer = comphelper::getFromUnoTunnel<SdLayer> (xRef);
+ SdLayer* pSdLayer = dynamic_cast<SdLayer*> (xLayer.get());
if (pSdLayer != nullptr)
{
SdrLayer* pSdrLayer = pSdLayer->GetSdrLayer ();
diff --git a/sd/source/ui/unoidl/unolayer.hxx b/sd/source/ui/unoidl/unolayer.hxx
index 48160449f8d6..fe343bba438b 100644
--- a/sd/source/ui/unoidl/unolayer.hxx
+++ b/sd/source/ui/unoidl/unolayer.hxx
@@ -42,7 +42,6 @@ enum LayerAttribute { VISIBLE, PRINTABLE, LOCKED };
class SdLayer : public ::cppu::WeakImplHelper< css::drawing::XLayer,
css::lang::XServiceInfo,
css::container::XChild,
- css::lang::XUnoTunnel,
css::lang::XComponent >
{
public:
@@ -52,9 +51,6 @@ public:
// intern
SdrLayer* GetSdrLayer() const noexcept { return pLayer; }
- // uno helper
- UNO3_GETIMPLEMENTATION_DECL( SdLayer )
-
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;