summaryrefslogtreecommitdiff
path: root/package
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 /package
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 'package')
-rw-r--r--package/source/zippackage/ZipPackage.cxx5
-rw-r--r--package/source/zippackage/ZipPackageFolder.cxx6
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx6
3 files changed, 3 insertions, 14 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 4b220862c0e3..491a942e206c 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -60,7 +60,6 @@
#include <com/sun/star/xml/crypto/DigestID.hpp>
#include <com/sun/star/xml/crypto/CipherID.hpp>
#include <cppuhelper/implbase.hxx>
-#include <cppuhelper/typeprovider.hxx>
#include <rtl/uri.hxx>
#include <rtl/random.h>
#include <osl/diagnose.h>
@@ -1682,9 +1681,7 @@ Sequence< sal_Int8 > ZipPackage::getUnoTunnelId()
sal_Int64 SAL_CALL ZipPackage::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
{
- if ( comphelper::isUnoTunnelId<ZipPackage>(aIdentifier) )
- return reinterpret_cast < sal_Int64 > ( this );
- return 0;
+ return comphelper::getSomethingImpl(aIdentifier, this);
}
uno::Reference< XPropertySetInfo > SAL_CALL ZipPackage::getPropertySetInfo()
diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx
index 1c9207b1c09a..4c94a78abed9 100644
--- a/package/source/zippackage/ZipPackageFolder.cxx
+++ b/package/source/zippackage/ZipPackageFolder.cxx
@@ -30,7 +30,6 @@
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <cppuhelper/typeprovider.hxx>
#include <osl/diagnose.h>
#include <sal/log.hxx>
#include <rtl/digest.h>
@@ -344,10 +343,7 @@ void ZipPackageFolder::saveContents(
sal_Int64 SAL_CALL ZipPackageFolder::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
{
- sal_Int64 nMe = 0;
- if ( comphelper::isUnoTunnelId<ZipPackageFolder>(aIdentifier) )
- nMe = reinterpret_cast < sal_Int64 > ( this );
- return nMe;
+ return comphelper::getSomethingImpl(aIdentifier, this);
}
void SAL_CALL ZipPackageFolder::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
{
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 3facbb48addf..2b3bf5b5e7e3 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -50,7 +50,6 @@
#include <comphelper/storagehelper.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <cppuhelper/typeprovider.hxx>
#include <rtl/random.h>
#include <sal/log.hxx>
@@ -1107,10 +1106,7 @@ uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getPlainRawStream(
sal_Int64 SAL_CALL ZipPackageStream::getSomething( const Sequence< sal_Int8 >& aIdentifier )
{
- sal_Int64 nMe = 0;
- if ( comphelper::isUnoTunnelId<ZipPackageStream>(aIdentifier) )
- nMe = reinterpret_cast < sal_Int64 > ( this );
- return nMe;
+ return comphelper::getSomethingImpl(aIdentifier, this);
}
// XPropertySet