summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-06-12 12:18:07 +0300
committerStephan Bergmann <sbergman@redhat.com>2019-08-23 09:10:49 +0200
commit24c17dab2f10ad1b7ba342fbd40dc65b7d8f9b24 (patch)
tree5449a884fc53cf66fe1f02dfa21a5abd268bc3c1 /vcl
parentdd7d90055545cb20aa5c12c0be44cccaefdeac47 (diff)
tdf#39593 extract UnoTunnelId comparison to template function
Change-Id: Ia2b5dea273c8de7b8c54e74780193a8d4cba7b45 Reviewed-on: https://gerrit.libreoffice.org/73874 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/graphic/UnoGraphic.cxx3
-rw-r--r--vcl/source/treelist/transfer.cxx3
2 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/graphic/UnoGraphic.cxx b/vcl/source/graphic/UnoGraphic.cxx
index f546389663b1..447d8d451921 100644
--- a/vcl/source/graphic/UnoGraphic.cxx
+++ b/vcl/source/graphic/UnoGraphic.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/graphic/GraphicType.hpp>
#include <com/sun/star/graphic/XGraphicTransformer.hpp>
#include <vcl/dibtools.hxx>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/typeprovider.hxx>
@@ -183,7 +184,7 @@ uno::Sequence<sal_Int8> SAL_CALL Graphic::getMaskDIB()
sal_Int64 SAL_CALL Graphic::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- return( ( rId.getLength() == 16 && 0 == memcmp( ::Graphic::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) ?
+ return( ( isUnoTunnelId<::Graphic>(rId) ) ?
reinterpret_cast<sal_Int64>(&maGraphic) : 0 );
}
diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx
index a0727a2f464a..e187dd9e8876 100644
--- a/vcl/source/treelist/transfer.cxx
+++ b/vcl/source/treelist/transfer.cxx
@@ -503,8 +503,7 @@ sal_Int64 SAL_CALL TransferableHelper::getSomething( const Sequence< sal_Int8 >&
{
sal_Int64 nRet;
- if( ( rId.getLength() == 16 ) &&
- ( 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
+ if( isUnoTunnelId<TransferableHelper>(rId) )
{
nRet = sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
}