summaryrefslogtreecommitdiffstats
path: root/forms
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-09-13 11:29:37 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-09-15 06:08:14 +0200
commit3f65724ec5fc92d5a0078a99932358ef7091435c (patch)
tree94dd9bf1d0ecd42dbf7f94db45bc7e1bf29b83ce /forms
parentUse <comphelper/servicehelper.hxx> implementing XUnoTunnel part 3 [API CHANGE] (diff)
downloadcore-3f65724ec5fc92d5a0078a99932358ef7091435c.tar.gz
core-3f65724ec5fc92d5a0078a99932358ef7091435c.zip
Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 4
- Change implementations of getSomething to use getSomethingImpl Or where that's impossible, use getSomething_cast to unify this and reduce number of places where we reinterpret_cast. All static methods getting tunnel ids were renamed to getUnoTunnelId, to comply with the convention used in <comphelper/servicehelper.hxx>. TODO (in separate commits): - Revise uses of getSomething to use getFromUnoTunnel Change-Id: Ifde9e214b52e5df678de71fcc32d2199c82e85cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122100 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/Columns.cxx2
-rw-r--r--forms/source/richtext/richtextmodel.cxx3
-rw-r--r--forms/source/xforms/binding.cxx3
-rw-r--r--forms/source/xforms/model.cxx4
-rw-r--r--forms/source/xforms/submission.cxx3
5 files changed, 6 insertions, 9 deletions
diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx
index 0dbe216cc506..b92b99768912 100644
--- a/forms/source/component/Columns.cxx
+++ b/forms/source/component/Columns.cxx
@@ -119,7 +119,7 @@ sal_Int64 SAL_CALL OGridColumn::getSomething( const Sequence<sal_Int8>& _rIdenti
if ( comphelper::isUnoTunnelId<OGridColumn>(_rIdentifier) )
{
- nReturn = reinterpret_cast<sal_Int64>(this);
+ nReturn = comphelper::getSomething_cast(this);
}
else
{
diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx
index 84c103ae6a2b..7498a4a9d2b8 100644
--- a/forms/source/richtext/richtextmodel.cxx
+++ b/forms/source/richtext/richtextmodel.cxx
@@ -29,7 +29,6 @@
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
-#include <cppuhelper/typeprovider.hxx>
#include <comphelper/guarding.hxx>
#include <comphelper/servicehelper.hxx>
#include <svl/itempool.hxx>
@@ -549,7 +548,7 @@ namespace frm
sal_Int64 SAL_CALL ORichTextModel::getSomething( const Sequence< sal_Int8 >& _rId )
{
if (comphelper::isUnoTunnelId<ORichTextModel>(_rId))
- return reinterpret_cast< sal_Int64 >( m_pEngine.get() );
+ return comphelper::getSomething_cast(m_pEngine.get()); // Note returning a different type
Reference< XUnoTunnel > xAggTunnel;
if ( query_aggregation( m_xAggregate, xAggTunnel ) )
diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx
index 0d8add6108d0..3b6983f05daf 100644
--- a/forms/source/xforms/binding.cxx
+++ b/forms/source/xforms/binding.cxx
@@ -53,7 +53,6 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <comphelper/servicehelper.hxx>
-#include <cppuhelper/typeprovider.hxx>
using namespace com::sun::star::xml::xpath;
using namespace com::sun::star::xml::dom::events;
@@ -1168,7 +1167,7 @@ void Binding::handleEvent( const css::uno::Reference<css::xml::dom::events::XEve
sal_Int64 Binding::getSomething( const css::uno::Sequence<sal_Int8>& xId )
{
- return reinterpret_cast<sal_Int64>( ( xId == getUnoTunnelId() ) ? this : nullptr );
+ return comphelper::getSomethingImpl(xId, this);
}
diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx
index 0668028f5af8..d5bf2182abe7 100644
--- a/forms/source/xforms/model.cxx
+++ b/forms/source/xforms/model.cxx
@@ -35,8 +35,8 @@
#include <tools/debug.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <cppuhelper/typeprovider.hxx>
#include <algorithm>
@@ -589,7 +589,7 @@ void Model::update()
sal_Int64 Model::getSomething( const css::uno::Sequence<sal_Int8>& xId )
{
- return reinterpret_cast<sal_Int64>( ( xId == getUnoTunnelId() ) ? this : nullptr );
+ return comphelper::getSomethingImpl(xId, this);
}
Sequence<sal_Int8> Model::getImplementationId()
diff --git a/forms/source/xforms/submission.cxx b/forms/source/xforms/submission.cxx
index 909ce530bc9e..c33f1fc39f58 100644
--- a/forms/source/xforms/submission.cxx
+++ b/forms/source/xforms/submission.cxx
@@ -44,7 +44,6 @@
#include <com/sun/star/xforms/InvalidDataOnSubmitException.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <cppuhelper/exc_hlp.hxx>
-#include <cppuhelper/typeprovider.hxx>
#include <comphelper/interaction.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/servicehelper.hxx>
@@ -367,7 +366,7 @@ void SAL_CALL Submission::setName( const OUString& sID )
sal_Int64 SAL_CALL Submission::getSomething(
const Sequence<sal_Int8>& aId )
{
- return ( aId == getUnoTunnelId() ) ? reinterpret_cast<sal_Int64>(this) : 0;
+ return comphelper::getSomethingImpl(aId, this);
}