diff options
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/core/api/Section.cxx | 16 | ||||
-rw-r--r-- | reportdesign/source/core/inc/Section.hxx | 3 | ||||
-rw-r--r-- | reportdesign/source/core/sdr/RptPage.cxx | 4 |
3 files changed, 5 insertions, 18 deletions
diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx index 69be4b7fc3c8..b030ae5508e7 100644 --- a/reportdesign/source/core/api/Section.cxx +++ b/reportdesign/source/core/api/Section.cxx @@ -571,24 +571,12 @@ sal_Bool SAL_CALL OSection::hasForms() sal_Int64 OSection::getSomething( const uno::Sequence< sal_Int8 > & rId ) { - if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) + if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) return reinterpret_cast<sal_Int64>(this); return (m_xDrawPage_Tunnel.is()) ? m_xDrawPage_Tunnel->getSomething(rId) : 0; } - -OSection* OSection::getImplementation( const uno::Reference< uno::XInterface >& _rxComponent ) -{ - OSection* pContent( nullptr ); - - uno::Reference< lang::XUnoTunnel > xUnoTunnel( _rxComponent, uno::UNO_QUERY ); - if ( xUnoTunnel.is() ) - pContent = reinterpret_cast< OSection* >( xUnoTunnel->getSomething( getUnoTunnelImplementationId() ) ); - - return pContent; -} - -uno::Sequence< sal_Int8 > OSection::getUnoTunnelImplementationId() +uno::Sequence< sal_Int8 > OSection::getUnoTunnelId() { static ::cppu::OImplementationId implId; diff --git a/reportdesign/source/core/inc/Section.hxx b/reportdesign/source/core/inc/Section.hxx index fb4fe75172ad..77a92db780bd 100644 --- a/reportdesign/source/core/inc/Section.hxx +++ b/reportdesign/source/core/inc/Section.hxx @@ -223,8 +223,7 @@ namespace reportdesign // css::lang::XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static OSection* getImplementation( const css::uno::Reference< css::uno::XInterface >& _rxComponent ); - static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId(); + static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); void notifyElementAdded(const css::uno::Reference< css::drawing::XShape >& xShape); void notifyElementRemoved(const css::uno::Reference< css::drawing::XShape >& xShape); diff --git a/reportdesign/source/core/sdr/RptPage.cxx b/reportdesign/source/core/sdr/RptPage.cxx index c20f11f363cd..18484851739b 100644 --- a/reportdesign/source/core/sdr/RptPage.cxx +++ b/reportdesign/source/core/sdr/RptPage.cxx @@ -92,7 +92,7 @@ SdrObject* OReportPage::RemoveObject(size_t nObjNum) } // this code is evil, but what else shall I do - reportdesign::OSection* pSection = reportdesign::OSection::getImplementation(m_xSection); + reportdesign::OSection* pSection = comphelper::getUnoTunnelImplementation<reportdesign::OSection>(m_xSection); uno::Reference< drawing::XShape> xShape(pObj->getUnoShape(),uno::UNO_QUERY); pSection->notifyElementRemoved(xShape); if (dynamic_cast< const OUnoObject *>( pObj ) != nullptr) @@ -177,7 +177,7 @@ void OReportPage::NbcInsertObject(SdrObject* pObj, size_t nPos) } // this code is evil, but what else shall I do - reportdesign::OSection* pSection = reportdesign::OSection::getImplementation(m_xSection); + reportdesign::OSection* pSection = comphelper::getUnoTunnelImplementation<reportdesign::OSection>(m_xSection); uno::Reference< drawing::XShape> xShape(pObj->getUnoShape(),uno::UNO_QUERY); pSection->notifyElementAdded(xShape); |