diff options
author | Noel Grandin <noel@peralex.com> | 2021-11-06 20:58:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-07 07:29:38 +0100 |
commit | 7a61256f9e68201ef7b331ca3e1b4c3302104631 (patch) | |
tree | 42c6908cdbe521be795224fb912ca4229ba4b706 /svx/source | |
parent | b3325ef8cdfc2c82eec34e747106f75a9fccb7e4 (diff) |
return XShape from SdrObject::getUnoShape
instead of XInterface, to make it obvious what the reality of the
requirement is
Change-Id: Icdd4113f2a0ece930305f4d8ba010b81d24f43c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124802
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/dialog/signaturelinehelper.cxx | 1 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 12 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/svx/source/dialog/signaturelinehelper.cxx b/svx/source/dialog/signaturelinehelper.cxx index 52bead204d28..560b5effd732 100644 --- a/svx/source/dialog/signaturelinehelper.cxx +++ b/svx/source/dialog/signaturelinehelper.cxx @@ -9,6 +9,7 @@ #include <svx/signaturelinehelper.hxx> +#include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/graphic/GraphicProvider.hpp> #include <com/sun/star/security/DocumentDigitalSignatures.hpp> diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 15eed6733ab0..ffbfe6456e54 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -3213,7 +3213,7 @@ void SdrObjCustomShape::InvalidateRenderGeometry() mpLastShadowGeometry = nullptr; } -void SdrObjCustomShape::impl_setUnoShape(const uno::Reference<uno::XInterface>& rxUnoShape) +void SdrObjCustomShape::impl_setUnoShape(const uno::Reference<drawing::XShape>& rxUnoShape) { SdrTextObj::impl_setUnoShape(rxUnoShape); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 1191a8784e08..4c8b9d142197 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -494,7 +494,7 @@ void SdrObject::Free( SdrObject*& _rpObject ) try { pShape->InvalidateSdrObject(); - uno::Reference< lang::XComponent > xShapeComp( pObject->getWeakUnoShape(), uno::UNO_QUERY_THROW ); + uno::Reference< lang::XComponent > xShapeComp( pObject->getWeakUnoShape().get(), uno::UNO_QUERY_THROW ); xShapeComp->dispose(); } catch( const uno::Exception& ) @@ -2797,7 +2797,7 @@ void SdrObject::SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle& } } -void SdrObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& _rxUnoShape ) +void SdrObject::impl_setUnoShape( const uno::Reference< drawing::XShape >& _rxUnoShape ) { const uno::Reference< uno::XInterface>& xOldUnoShape( maWeakUnoShape ); // the UNO shape would be gutted by the following code; return early @@ -2853,10 +2853,10 @@ SvxShape* SdrObject::getSvxShape() return mpSvxShape; } -css::uno::Reference< css::uno::XInterface > SdrObject::getUnoShape() +css::uno::Reference< css::drawing::XShape > SdrObject::getUnoShape() { // try weak reference first - uno::Reference< uno::XInterface > xShape( getWeakUnoShape() ); + uno::Reference< css::drawing::XShape > xShape( getWeakUnoShape() ); if( xShape ) return xShape; @@ -2932,13 +2932,13 @@ css::uno::Reference< css::uno::XInterface > SdrObject::getUnoShape() // using this fallback (!) - what a bad trap rtl::Reference<SvxShape> xNewShape = SvxDrawPage::CreateShapeByTypeAndInventor( GetObjIdentifier(), GetObjInventor(), this ); mpSvxShape = xNewShape.get(); - maWeakUnoShape = xShape = static_cast< ::cppu::OWeakObject* >( mpSvxShape ); + maWeakUnoShape = xShape = mpSvxShape; } return xShape; } -void SdrObject::setUnoShape(const uno::Reference<uno::XInterface >& _rxUnoShape) +void SdrObject::setUnoShape(const uno::Reference<drawing::XShape >& _rxUnoShape) { impl_setUnoShape( _rxUnoShape ); } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index c7fc27260744..5965bb11cd2a 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -344,7 +344,7 @@ void SvxShape::impl_initFromSdrObject() osl_atomic_increment( &m_refCount ); { - GetSdrObject()->setUnoShape(*this); + GetSdrObject()->setUnoShape(this); } osl_atomic_decrement( &m_refCount ); |