summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml
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 /sw/source/filter/xml
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 'sw/source/filter/xml')
-rw-r--r--sw/source/filter/xml/xmlexp.cxx7
-rw-r--r--sw/source/filter/xml/xmlimp.cxx7
2 files changed, 4 insertions, 10 deletions
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 3ee1856c2a16..f0255f7833f2 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -483,11 +483,8 @@ const Sequence< sal_Int8 > & SwXMLExport::getUnoTunnelId() noexcept
sal_Int64 SAL_CALL SwXMLExport::getSomething( const Sequence< sal_Int8 >& rId )
{
- if( comphelper::isUnoTunnelId<SwXMLExport>(rId) )
- {
- return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
- }
- return SvXMLExport::getSomething( rId );
+ return comphelper::getSomethingImpl(rId, this,
+ comphelper::FallbackToGetSomethingOf<SvXMLExport>{});
}
SwDoc* SwXMLExport::getDoc()
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 9e2d709f6d92..6bfdcf0f0698 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -368,11 +368,8 @@ const Sequence< sal_Int8 > & SwXMLImport::getUnoTunnelId() noexcept
sal_Int64 SAL_CALL SwXMLImport::getSomething( const Sequence< sal_Int8 >& rId )
{
- if( comphelper::isUnoTunnelId<SwXMLImport>(rId) )
- {
- return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
- }
- return SvXMLImport::getSomething( rId );
+ return comphelper::getSomethingImpl(rId, this,
+ comphelper::FallbackToGetSomethingOf<SvXMLImport>{});
}
static OTextCursorHelper *lcl_xml_GetSwXTextCursor( const Reference < XTextCursor >& rTextCursor )