tdf#39593 Remove reportdesign::OSection::getImplementation
Replace with comphelper::getUnoTunnelImplementation.
Change-Id: I3d0837ff3f47392e09ef276f141a8459add7a5ad
Reviewed-on: https://gerrit.libreoffice.org/74471
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx
index 69be4b7..b030ae5 100644
--- a/reportdesign/source/core/api/Section.cxx
+++ b/reportdesign/source/core/api/Section.cxx
@@ -571,24 +571,12 @@
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 fb4fe75..77a92db 100644
--- a/reportdesign/source/core/inc/Section.hxx
+++ b/reportdesign/source/core/inc/Section.hxx
@@ -223,8 +223,7 @@
// 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 c20f11f..1848485 100644
--- a/reportdesign/source/core/sdr/RptPage.cxx
+++ b/reportdesign/source/core/sdr/RptPage.cxx
@@ -92,7 +92,7 @@
}
// 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 @@
}
// 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);