summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-09-06 00:50:24 +0300
committerStephan Bergmann <sbergman@redhat.com>2019-09-06 11:55:50 +0200
commitf599c31fe68882f510cf3d101102e71f9bf795c8 (patch)
treeced0a58620c5aea8420638847192f298d139297b /reportdesign
parent8811516e2e9e71dd45198081d26c748cdf4d831a (diff)
tdf#39593 use isUnoTunnelId
Adapt getUnoTunnelId methods where required: rename or make public. Change-Id: I0fd2120bf9f0ff1aa690329a65ff64a154c89315 Reviewed-on: https://gerrit.libreoffice.org/78680 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/inc/ReportDefinition.hxx2
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx7
-rw-r--r--reportdesign/source/core/api/Section.cxx2
3 files changed, 6 insertions, 5 deletions
diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx
index bdcaeb8f2552..436550c9aa3f 100644
--- a/reportdesign/inc/ReportDefinition.hxx
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -192,6 +192,7 @@ namespace reportdesign
public:
//TTTT Needed? Or same as above?
+ static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
static std::shared_ptr<rptui::OReportModel> getSdrModel(const css::uno::Reference< css::report::XReportDefinition >& _xReportDefinition);
private:
@@ -354,7 +355,6 @@ namespace reportdesign
// css::lang::XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
// SvxUnoDrawMSFactory
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) override;
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 7ac5e6e09d20..e3ef88ae80dc 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -96,6 +96,7 @@
#include <comphelper/propertystatecontainer.hxx>
#include <comphelper/seqstream.hxx>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/uno3.hxx>
#include <connectivity/CommonTools.hxx>
@@ -1937,7 +1938,7 @@ uno::Sequence< OUString > SAL_CALL OReportDefinition::getAvailableMimeTypes( )
sal_Int64 SAL_CALL OReportDefinition::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
sal_Int64 nRet = 0;
- if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ if (isUnoTunnelId<OReportDefinition>(rId) )
nRet = reinterpret_cast<sal_Int64>(this);
else
{
@@ -1961,7 +1962,7 @@ uno::Sequence< sal_Int8 > SAL_CALL OReportDefinition::getImplementationId( )
return css::uno::Sequence<sal_Int8>();
}
-uno::Sequence< sal_Int8 > OReportDefinition::getUnoTunnelImplementationId()
+uno::Sequence< sal_Int8 > OReportDefinition::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -1982,7 +1983,7 @@ std::shared_ptr<rptui::OReportModel> OReportDefinition::getSdrModel(const uno::R
if( xUT.is() )
pReportModel = reinterpret_cast<OReportDefinition*>(
sal::static_int_cast<sal_uIntPtr>(
- xUT->getSomething( OReportDefinition::getUnoTunnelImplementationId()))
+ xUT->getSomething( OReportDefinition::getUnoTunnelId()))
)->m_pImpl->m_pReportModel;
return pReportModel;
}
diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx
index 1ad60a62e38e..6aa10a6acaa2 100644
--- a/reportdesign/source/core/api/Section.cxx
+++ b/reportdesign/source/core/api/Section.cxx
@@ -571,7 +571,7 @@ sal_Bool SAL_CALL OSection::hasForms()
sal_Int64 OSection::getSomething( const uno::Sequence< sal_Int8 > & rId )
{
- if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) )
+ if (isUnoTunnelId<OSection>(rId) )
return reinterpret_cast<sal_Int64>(this);
return (m_xDrawPage_Tunnel.is()) ? m_xDrawPage_Tunnel->getSomething(rId) : 0;
}