summaryrefslogtreecommitdiff
path: root/xmloff
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 /xmloff
parent6444b026b4039458d01ada5fee58eae98166585b (diff)
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 'xmloff')
-rw-r--r--xmloff/source/core/unoatrcn.cxx6
-rw-r--r--xmloff/source/core/xmlimp.cxx6
-rw-r--r--xmloff/source/transform/MutableAttrList.cxx6
-rw-r--r--xmloff/source/transform/OOo2Oasis.cxx7
-rw-r--r--xmloff/source/transform/Oasis2OOo.cxx7
5 files changed, 5 insertions, 27 deletions
diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx
index 1745e73f4bf0..9125e6cfb93c 100644
--- a/xmloff/source/core/unoatrcn.cxx
+++ b/xmloff/source/core/unoatrcn.cxx
@@ -94,11 +94,7 @@ const css::uno::Sequence< sal_Int8 > & SvUnoAttributeContainer::getUnoTunnelId()
sal_Int64 SAL_CALL SvUnoAttributeContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
{
- if( comphelper::isUnoTunnelId<SvUnoAttributeContainer>(rId) )
- {
- return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
- }
- return 0;
+ return comphelper::getSomethingImpl(rId, this);
}
// container::XNameAccess
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 4957fad331f8..3c2ae8ea7a61 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -474,11 +474,7 @@ const css::uno::Sequence<sal_Int8>& SvXMLImport::getUnoTunnelId() noexcept
// XUnoTunnel
sal_Int64 SAL_CALL SvXMLImport::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- if( comphelper::isUnoTunnelId<SvXMLImport>(rId) )
- {
- return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
- }
- return 0;
+ return comphelper::getSomethingImpl(rId, this);
}
namespace
diff --git a/xmloff/source/transform/MutableAttrList.cxx b/xmloff/source/transform/MutableAttrList.cxx
index 9373055ab1df..f6fc026ae91b 100644
--- a/xmloff/source/transform/MutableAttrList.cxx
+++ b/xmloff/source/transform/MutableAttrList.cxx
@@ -67,11 +67,7 @@ const css::uno::Sequence<sal_Int8>& XMLMutableAttributeList::getUnoTunnelId() no
sal_Int64 SAL_CALL XMLMutableAttributeList::getSomething(
const Sequence< sal_Int8 >& rId )
{
- if( comphelper::isUnoTunnelId<XMLMutableAttributeList>(rId) )
- {
- return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
- }
- return 0;
+ return comphelper::getSomethingImpl(rId, this);
}
sal_Int16 SAL_CALL XMLMutableAttributeList::getLength()
diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx
index 243fd6b708db..2a6111ca6256 100644
--- a/xmloff/source/transform/OOo2Oasis.cxx
+++ b/xmloff/source/transform/OOo2Oasis.cxx
@@ -1953,12 +1953,7 @@ const css::uno::Sequence<sal_Int8>& OOo2OasisTransformer::getUnoTunnelId() noexc
// XUnoTunnel
sal_Int64 SAL_CALL OOo2OasisTransformer::getSomething( const Sequence< sal_Int8 >& rId )
{
- if( comphelper::isUnoTunnelId<OOo2OasisTransformer>(rId) )
- {
- return reinterpret_cast< sal_Int64 >( this );
- }
-
- return sal_Int64(0);
+ return comphelper::getSomethingImpl(rId, this);
}
// XServiceInfo
diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx
index 5c9cd31a9372..3a4516dd621a 100644
--- a/xmloff/source/transform/Oasis2OOo.cxx
+++ b/xmloff/source/transform/Oasis2OOo.cxx
@@ -1952,12 +1952,7 @@ const css::uno::Sequence<sal_Int8>& Oasis2OOoTransformer::getUnoTunnelId() noexc
// XUnoTunnel
sal_Int64 SAL_CALL Oasis2OOoTransformer::getSomething( const Sequence< sal_Int8 >& rId )
{
- if( comphelper::isUnoTunnelId<Oasis2OOoTransformer>(rId) )
- {
- return reinterpret_cast< sal_Int64 >( this );
- }
-
- return sal_Int64(0);
+ return comphelper::getSomethingImpl(rId, this);
}
// XServiceInfo