diff options
Diffstat (limited to 'package/source/zippackage')
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 11 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageEntry.cxx | 2 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageFolder.cxx | 10 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageStream.cxx | 6 |
4 files changed, 15 insertions, 14 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index a7bb9e818e10..3f3858070a0c 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -80,6 +80,7 @@ #include <comphelper/sequenceashashmap.hxx> #include <cppuhelper/supportsservice.hxx> #include <comphelper/sequence.hxx> +#include <comphelper/servicehelper.hxx> using namespace std; using namespace osl; @@ -245,7 +246,7 @@ void ZipPackage::parseManifest() uno::Reference < XUnoTunnel > xUnoTunnel; aAny >>= xUnoTunnel; sal_Int64 nTest=0; - if ( (nTest = xUnoTunnel->getSomething( ZipPackageFolder::static_getImplementationId() )) != 0 ) + if ( (nTest = xUnoTunnel->getSomething( ZipPackageFolder::getUnoTunnelId() )) != 0 ) { pFolder = reinterpret_cast < ZipPackageFolder* > ( nTest ); pFolder->SetMediaType ( sMediaType ); @@ -253,7 +254,7 @@ void ZipPackage::parseManifest() } else { - pStream = reinterpret_cast < ZipPackageStream* > ( xUnoTunnel->getSomething( ZipPackageStream::static_getImplementationId() )); + pStream = reinterpret_cast < ZipPackageStream* > ( xUnoTunnel->getSomething( ZipPackageStream::getUnoTunnelId() )); pStream->SetMediaType ( sMediaType ); pStream->SetFromManifest( true ); @@ -491,7 +492,7 @@ void ZipPackage::parseContentType() uno::Any aIterAny = getByHierarchicalName( aPath ); uno::Reference < lang::XUnoTunnel > xIterTunnel; aIterAny >>= xIterTunnel; - sal_Int64 nTest = xIterTunnel->getSomething( ZipPackageStream::static_getImplementationId() ); + sal_Int64 nTest = xIterTunnel->getSomething( ZipPackageStream::getUnoTunnelId() ); if ( nTest != 0 ) { // this is a package stream, in OFOPXML format only streams can have mediatype @@ -1706,7 +1707,7 @@ uno::Reference < XSingleServiceFactory > ZipPackage::createServiceFactory( uno:: static_getSupportedServiceNames() ); } -Sequence< sal_Int8 > ZipPackage::getUnoTunnelImplementationId() +Sequence< sal_Int8 > ZipPackage::getUnoTunnelId() { static ::cppu::OImplementationId implId; @@ -1715,7 +1716,7 @@ Sequence< sal_Int8 > ZipPackage::getUnoTunnelImplementationId() sal_Int64 SAL_CALL ZipPackage::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) { - if ( aIdentifier.getLength() == 16 && 0 == memcmp( getUnoTunnelImplementationId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) + if ( isUnoTunnelId<ZipPackage>(aIdentifier) ) return reinterpret_cast < sal_Int64 > ( this ); return 0; } diff --git a/package/source/zippackage/ZipPackageEntry.cxx b/package/source/zippackage/ZipPackageEntry.cxx index 118630eef80b..35789653b35d 100644 --- a/package/source/zippackage/ZipPackageEntry.cxx +++ b/package/source/zippackage/ZipPackageEntry.cxx @@ -94,7 +94,7 @@ void SAL_CALL ZipPackageEntry::setParent( const uno::Reference< XInterface >& xN { sal_Int64 nTest(0); uno::Reference < XUnoTunnel > xTunnel ( xNewParent, UNO_QUERY ); - if ( !xNewParent.is() || ( nTest = xTunnel->getSomething ( ZipPackageFolder::static_getImplementationId () ) ) == 0 ) + if ( !xNewParent.is() || ( nTest = xTunnel->getSomething ( ZipPackageFolder::getUnoTunnelId () ) ) == 0 ) throw NoSupportException(THROW_WHERE ); ZipPackageFolder *pNewParent = reinterpret_cast < ZipPackageFolder * > ( nTest ); diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index 0b5ae3623a62..2dfbb72dc567 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/packages/zip/ZipConstants.hpp> #include <com/sun/star/embed/StorageFormats.hpp> #include <comphelper/sequence.hxx> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #include <osl/diagnose.h> @@ -155,7 +156,7 @@ void ZipPackageFolder::setChildStreamsTypeByExtension( const beans::StringPair& } } -css::uno::Sequence < sal_Int8 > ZipPackageFolder::static_getImplementationId() +css::uno::Sequence < sal_Int8 > ZipPackageFolder::getUnoTunnelId() { return lcl_CachedImplId::get().getImplementationId(); } @@ -173,12 +174,12 @@ void SAL_CALL ZipPackageFolder::insertByName( const OUString& aName, const uno:: sal_Int64 nTest; ZipPackageEntry *pEntry; - if ( ( nTest = xRef->getSomething ( ZipPackageFolder::static_getImplementationId() ) ) != 0 ) + if ( ( nTest = xRef->getSomething ( ZipPackageFolder::getUnoTunnelId() ) ) != 0 ) { ZipPackageFolder *pFolder = reinterpret_cast < ZipPackageFolder * > ( nTest ); pEntry = static_cast < ZipPackageEntry * > ( pFolder ); } - else if ( ( nTest = xRef->getSomething ( ZipPackageStream::static_getImplementationId() ) ) != 0 ) + else if ( ( nTest = xRef->getSomething ( ZipPackageStream::getUnoTunnelId() ) ) != 0 ) { ZipPackageStream *pStream = reinterpret_cast < ZipPackageStream * > ( nTest ); pEntry = static_cast < ZipPackageEntry * > ( pStream ); @@ -357,8 +358,7 @@ void ZipPackageFolder::saveContents( sal_Int64 SAL_CALL ZipPackageFolder::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) { sal_Int64 nMe = 0; - if ( aIdentifier.getLength() == 16 && - 0 == memcmp(static_getImplementationId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) + if ( isUnoTunnelId<ZipPackageFolder>(aIdentifier) ) nMe = reinterpret_cast < sal_Int64 > ( this ); return nMe; } diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 25c705036a6d..f685f891c649 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -46,6 +46,7 @@ #include "wrapstreamforshare.hxx" #include <comphelper/seekableinput.hxx> +#include <comphelper/servicehelper.hxx> #include <comphelper/storagehelper.hxx> #include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/supportsservice.hxx> @@ -76,7 +77,7 @@ using namespace cppu; namespace { struct lcl_CachedImplId : public rtl::Static< cppu::OImplementationId, lcl_CachedImplId > {}; } -css::uno::Sequence < sal_Int8 > ZipPackageStream::static_getImplementationId() +css::uno::Sequence < sal_Int8 > ZipPackageStream::getUnoTunnelId() { return lcl_CachedImplId::get().getImplementationId(); } @@ -1119,8 +1120,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 ( aIdentifier.getLength() == 16 && - 0 == memcmp( static_getImplementationId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) + if ( isUnoTunnelId<ZipPackageStream>(aIdentifier) ) nMe = reinterpret_cast < sal_Int64 > ( this ); return nMe; } |