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 /reportdesign | |
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 'reportdesign')
-rw-r--r-- | reportdesign/inc/RptObject.hxx | 14 | ||||
-rw-r--r-- | reportdesign/source/core/sdr/RptObject.cxx | 26 |
2 files changed, 20 insertions, 20 deletions
diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx index 732d70947654..db60d2ba9ff8 100644 --- a/reportdesign/inc/RptObject.hxx +++ b/reportdesign/inc/RptObject.hxx @@ -83,7 +83,7 @@ protected: /** called by instances of derived classes to implement their overriding of getUnoShape */ - css::uno::Reference< css::uno::XInterface > + css::uno::Reference< css::drawing::XShape > getUnoShapeOf( SdrObject& _rSdrObject ); private: @@ -138,12 +138,12 @@ public: virtual css::uno::Reference< css::beans::XPropertySet> getAwtComponent() override; - virtual css::uno::Reference< css::uno::XInterface > getUnoShape() override; + virtual css::uno::Reference< css::drawing::XShape > getUnoShape() override; virtual SdrObjKind GetObjIdentifier() const override; virtual SdrInventor GetObjInventor() const override; private: - virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override; + virtual void impl_setUnoShape( const css::uno::Reference< css::drawing::XShape >& rxUnoShape ) override; OCustomShape( SdrModel& rSdrModel, @@ -183,7 +183,7 @@ public: virtual css::uno::Reference< css::beans::XPropertySet> getAwtComponent() override; - virtual css::uno::Reference< css::uno::XInterface > getUnoShape() override; + virtual css::uno::Reference< css::drawing::XShape > getUnoShape() override; virtual SdrObjKind GetObjIdentifier() const override; virtual SdrInventor GetObjInventor() const override; // Clone() should make a complete copy of the object. @@ -212,7 +212,7 @@ private: virtual SdrPage* GetImplPage() const override; void impl_createDataProvider_nothrow( const css::uno::Reference< css::frame::XModel>& _xModel); - virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override; + virtual void impl_setUnoShape( const css::uno::Reference< css::drawing::XShape >& rxUnoShape ) override; SdrObjKind m_nType; bool m_bOnlyOnce; @@ -266,13 +266,13 @@ public: static OUString GetDefaultName(const OUnoObject* _pObj); - virtual css::uno::Reference< css::uno::XInterface > getUnoShape() override; + virtual css::uno::Reference< css::drawing::XShape > getUnoShape() override; virtual SdrObjKind GetObjIdentifier() const override; virtual SdrInventor GetObjInventor() const override; virtual OUnoObject* CloneSdrObject(SdrModel& rTargetModel) const override; private: - virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override; + virtual void impl_setUnoShape( const css::uno::Reference< css::drawing::XShape >& rxUnoShape ) override; void impl_initializeModel_nothrow(); }; diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 75ba20f61479..284fc4c9c5ae 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -436,9 +436,9 @@ void OObjectBase::ensureSdrObjectOwnership( const uno::Reference< uno::XInterfac } -uno::Reference< uno::XInterface > OObjectBase::getUnoShapeOf( SdrObject& _rSdrObject ) +uno::Reference< drawing::XShape > OObjectBase::getUnoShapeOf( SdrObject& _rSdrObject ) { - uno::Reference< uno::XInterface > xShape( _rSdrObject.getWeakUnoShape() ); + uno::Reference< drawing::XShape > xShape( _rSdrObject.getWeakUnoShape() ); if ( xShape.is() ) return xShape; @@ -458,7 +458,7 @@ OCustomShape::OCustomShape( : SdrObjCustomShape(rSdrModel) ,OObjectBase(_xComponent) { - impl_setUnoShape( uno::Reference< uno::XInterface >(_xComponent,uno::UNO_QUERY) ); + impl_setUnoShape( uno::Reference< drawing::XShape >(_xComponent,uno::UNO_QUERY_THROW) ); m_bIsListening = true; } @@ -551,9 +551,9 @@ uno::Reference< beans::XPropertySet> OCustomShape::getAwtComponent() } -uno::Reference< uno::XInterface > OCustomShape::getUnoShape() +uno::Reference< drawing::XShape > OCustomShape::getUnoShape() { - uno::Reference< uno::XInterface> xShape = OObjectBase::getUnoShapeOf( *this ); + uno::Reference<drawing::XShape> xShape = OObjectBase::getUnoShapeOf( *this ); if ( !m_xReportComponent.is() ) { OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); @@ -563,7 +563,7 @@ uno::Reference< uno::XInterface > OCustomShape::getUnoShape() return xShape; } -void OCustomShape::impl_setUnoShape( const uno::Reference< uno::XInterface >& rxUnoShape ) +void OCustomShape::impl_setUnoShape( const uno::Reference< drawing::XShape >& rxUnoShape ) { SdrObjCustomShape::impl_setUnoShape( rxUnoShape ); releaseUnoShape(); @@ -612,7 +612,7 @@ OUnoObject::OUnoObject( // tdf#119067 ,m_bSetDefaultLabel(false) { - impl_setUnoShape( uno::Reference< uno::XInterface >( _xComponent, uno::UNO_QUERY ) ); + impl_setUnoShape( uno::Reference< drawing::XShape >( _xComponent, uno::UNO_QUERY_THROW ) ); if ( !rModelName.isEmpty() ) impl_initializeModel_nothrow(); @@ -889,12 +889,12 @@ uno::Reference< beans::XPropertySet> OUnoObject::getAwtComponent() } -uno::Reference< uno::XInterface > OUnoObject::getUnoShape() +uno::Reference< drawing::XShape > OUnoObject::getUnoShape() { return OObjectBase::getUnoShapeOf( *this ); } -void OUnoObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& rxUnoShape ) +void OUnoObject::impl_setUnoShape( const uno::Reference< drawing::XShape >& rxUnoShape ) { SdrUnoObj::impl_setUnoShape( rxUnoShape ); releaseUnoShape(); @@ -915,7 +915,7 @@ OOle2Obj::OOle2Obj( ,m_nType(_nType) ,m_bOnlyOnce(true) { - impl_setUnoShape( uno::Reference< uno::XInterface >( _xComponent, uno::UNO_QUERY ) ); + impl_setUnoShape( uno::Reference< drawing::XShape >( _xComponent, uno::UNO_QUERY_THROW ) ); m_bIsListening = true; } @@ -1078,9 +1078,9 @@ uno::Reference< beans::XPropertySet> OOle2Obj::getAwtComponent() } -uno::Reference< uno::XInterface > OOle2Obj::getUnoShape() +uno::Reference< drawing::XShape > OOle2Obj::getUnoShape() { - uno::Reference< uno::XInterface> xShape = OObjectBase::getUnoShapeOf( *this ); + uno::Reference< drawing::XShape> xShape = OObjectBase::getUnoShapeOf( *this ); if ( !m_xReportComponent.is() ) { OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); @@ -1090,7 +1090,7 @@ uno::Reference< uno::XInterface > OOle2Obj::getUnoShape() return xShape; } -void OOle2Obj::impl_setUnoShape( const uno::Reference< uno::XInterface >& rxUnoShape ) +void OOle2Obj::impl_setUnoShape( const uno::Reference< drawing::XShape >& rxUnoShape ) { SdrOle2Obj::impl_setUnoShape( rxUnoShape ); releaseUnoShape(); |