Simplify OAccessibleImplementationAccess' XUnoTunnel implementation

Change-Id: Iad82fe1e0e524d2c33ab2165bd08353c4967c57f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121976
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2021-09-12 02:00:41 +02:00
parent 4a7984960b
commit 6e4d8f3af4
2 changed files with 6 additions and 11 deletions

View file

@ -18,6 +18,7 @@
*/
#include <comphelper/accimplaccess.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <string.h>
@ -38,7 +39,7 @@ namespace comphelper
{
}
Sequence< sal_Int8 > OAccessibleImplementationAccess::getUnoTunnelImplementationId()
Sequence<sal_Int8> OAccessibleImplementationAccess::getUnoTunnelId()
{
static cppu::OImplementationId implID;
@ -48,14 +49,10 @@ namespace comphelper
sal_Int64 SAL_CALL OAccessibleImplementationAccess::getSomething( const Sequence< sal_Int8 >& _rIdentifier )
{
sal_Int64 nReturn( 0 );
if (isUnoTunnelId<OAccessibleImplementationAccess>(_rIdentifier))
return reinterpret_cast<sal_Int64>(this);
if ( ( _rIdentifier.getLength() == 16 )
&& ( 0 == memcmp( getUnoTunnelImplementationId().getConstArray(), _rIdentifier.getConstArray(), 16 ) )
)
nReturn = reinterpret_cast< sal_Int64 >( this );
return nReturn;
return 0;
}
} // namespace comphelper

View file

@ -63,9 +63,7 @@ namespace comphelper
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& _rIdentifier ) override;
public:
private:
COMPHELPER_DLLPRIVATE static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
COMPHELPER_DLLPRIVATE static css::uno::Sequence<sal_Int8> getUnoTunnelId();
};
} // namespace comphelper