diff options
Diffstat (limited to 'connectivity/source/commontools')
-rw-r--r-- | connectivity/source/commontools/ConnectionWrapper.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/commontools/TConnection.cxx | 5 |
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; |