summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-09-06 00:50:24 +0300
committerStephan Bergmann <sbergman@redhat.com>2019-09-06 11:55:50 +0200
commitf599c31fe68882f510cf3d101102e71f9bf795c8 (patch)
treeced0a58620c5aea8420638847192f298d139297b /package
parent8811516e2e9e71dd45198081d26c748cdf4d831a (diff)
tdf#39593 use isUnoTunnelId
Adapt getUnoTunnelId methods where required: rename or make public. Change-Id: I0fd2120bf9f0ff1aa690329a65ff64a154c89315 Reviewed-on: https://gerrit.libreoffice.org/78680 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'package')
-rw-r--r--package/inc/ZipPackage.hxx2
-rw-r--r--package/inc/ZipPackageFolder.hxx2
-rw-r--r--package/inc/ZipPackageStream.hxx2
-rw-r--r--package/source/zippackage/ZipPackage.cxx11
-rw-r--r--package/source/zippackage/ZipPackageEntry.cxx2
-rw-r--r--package/source/zippackage/ZipPackageFolder.cxx10
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx6
7 files changed, 18 insertions, 17 deletions
diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx
index ff76226896f5..d1f956068327 100644
--- a/package/inc/ZipPackage.hxx
+++ b/package/inc/ZipPackage.hxx
@@ -147,7 +147,7 @@ public:
// XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
/// @throws css::uno::RuntimeException
- static css::uno::Sequence < sal_Int8 > getUnoTunnelImplementationId();
+ static css::uno::Sequence < sal_Int8 > getUnoTunnelId();
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx
index 1f65b2ca297e..c99f8f2a6b27 100644
--- a/package/inc/ZipPackageFolder.hxx
+++ b/package/inc/ZipPackageFolder.hxx
@@ -64,7 +64,7 @@ public:
ZipContentInfo& doGetByName( const OUString& aName );
- static css::uno::Sequence < sal_Int8 > static_getImplementationId();
+ static css::uno::Sequence < sal_Int8 > getUnoTunnelId();
void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; }
void setRemoveOnInsertMode_Impl( bool bRemove ) { mbAllowRemoveOnInsert = bRemove; }
diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx
index ffd791c8aca0..7f704ca59232 100644
--- a/package/inc/ZipPackageStream.hxx
+++ b/package/inc/ZipPackageStream.hxx
@@ -138,7 +138,7 @@ public:
void setZipEntryOnLoading( const ZipEntry &rInEntry);
void successfullyWritten( ZipEntry const *pEntry );
- static css::uno::Sequence < sal_Int8 > static_getImplementationId();
+ static css::uno::Sequence < sal_Int8 > getUnoTunnelId();
// XActiveDataSink
virtual void SAL_CALL setInputStream( const css::uno::Reference< css::io::XInputStream >& aStream ) override;
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;
}