From eef2795aa105ae52607cc158504c455da87dfd2a Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Wed, 18 Sep 2019 00:36:25 +0300 Subject: [PATCH] tdf#39593 use isUnoTunnelId in dbaccess Change-Id: I796d010c25e5d59f473b2b2f38736aebe16fe114 Reviewed-on: https://gerrit.libreoffice.org/79076 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov --- dbaccess/source/core/api/querydescriptor.cxx | 8 +++----- dbaccess/source/core/api/querydescriptor.hxx | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dbaccess/source/core/api/querydescriptor.cxx b/dbaccess/source/core/api/querydescriptor.cxx index ea31bbc7275e..ab4fa02b7409 100644 --- a/dbaccess/source/core/api/querydescriptor.cxx +++ b/dbaccess/source/core/api/querydescriptor.cxx @@ -22,6 +22,7 @@ #include "querydescriptor.hxx" #include #include +#include #include #include #include @@ -142,16 +143,13 @@ OQueryDescriptor_Base::~OQueryDescriptor_Base() sal_Int64 SAL_CALL OQueryDescriptor_Base::getSomething( const Sequence< sal_Int8 >& _rIdentifier ) { - if (_rIdentifier.getLength() != 16) - return 0; - - if (0 == memcmp(getUnoTunnelImplementationId().getConstArray(), _rIdentifier.getConstArray(), 16 ) ) + if (isUnoTunnelId(_rIdentifier)) return reinterpret_cast(this); return 0; } -css::uno::Sequence OQueryDescriptor_Base::getUnoTunnelImplementationId() +css::uno::Sequence OQueryDescriptor_Base::getUnoTunnelId() { static cppu::OImplementationId aId; return aId.getImplementationId(); diff --git a/dbaccess/source/core/api/querydescriptor.hxx b/dbaccess/source/core/api/querydescriptor.hxx index 0d2f9fe1da80..077792906126 100644 --- a/dbaccess/source/core/api/querydescriptor.hxx +++ b/dbaccess/source/core/api/querydescriptor.hxx @@ -79,7 +79,7 @@ public: // css::lang::XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; virtual css::uno::Sequence SAL_CALL getImplementationId( ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId(); + static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); // css::lang::XServiceInfo