summaryrefslogtreecommitdiff
path: root/connectivity/source/commontools
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 /connectivity/source/commontools
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 'connectivity/source/commontools')
-rw-r--r--connectivity/source/commontools/ConnectionWrapper.cxx5
-rw-r--r--connectivity/source/commontools/TConnection.cxx5
2 files changed, 6 insertions, 4 deletions
diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx b/connectivity/source/commontools/ConnectionWrapper.cxx
index e5a10447316e..fba26d8937ae 100644
--- a/connectivity/source/commontools/ConnectionWrapper.cxx
+++ b/connectivity/source/commontools/ConnectionWrapper.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <comphelper/uno3.hxx>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/hash.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
@@ -157,7 +158,7 @@ Sequence< Type > SAL_CALL OConnectionWrapper::getTypes( )
// css::lang::XUnoTunnel
sal_Int64 SAL_CALL OConnectionWrapper::getSomething( const Sequence< sal_Int8 >& rId )
{
- if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ if (isUnoTunnelId<OConnectionWrapper>(rId))
return reinterpret_cast< sal_Int64 >( this );
if(m_xUnoTunnel.is())
@@ -166,7 +167,7 @@ sal_Int64 SAL_CALL OConnectionWrapper::getSomething( const Sequence< sal_Int8 >&
}
-Sequence< sal_Int8 > OConnectionWrapper::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OConnectionWrapper::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
diff --git a/connectivity/source/commontools/TConnection.cxx b/connectivity/source/commontools/TConnection.cxx
index 779ea853520f..255776a3ceb4 100644
--- a/connectivity/source/commontools/TConnection.cxx
+++ b/connectivity/source/commontools/TConnection.cxx
@@ -20,6 +20,7 @@
#include <string.h>
#include <TConnection.hxx>
#include <cppuhelper/typeprovider.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
@@ -57,12 +58,12 @@ void OMetaConnection::disposing()
//XUnoTunnel
sal_Int64 SAL_CALL OMetaConnection::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return (isUnoTunnelId<OMetaConnection>(rId))
? reinterpret_cast< sal_Int64 >( this )
: sal_Int64(0);
}
-Sequence< sal_Int8 > OMetaConnection::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OMetaConnection::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;