summaryrefslogtreecommitdiff
path: root/toolkit
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 /toolkit
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 'toolkit')
-rw-r--r--toolkit/source/controls/grid/gridcolumn.cxx3
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx4
2 files changed, 4 insertions, 3 deletions
diff --git a/toolkit/source/controls/grid/gridcolumn.cxx b/toolkit/source/controls/grid/gridcolumn.cxx
index 5b52b183daf4..5cada204bc77 100644
--- a/toolkit/source/controls/grid/gridcolumn.cxx
+++ b/toolkit/source/controls/grid/gridcolumn.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
@@ -285,7 +286,7 @@ namespace toolkit
sal_Int64 SAL_CALL GridColumn::getSomething( const Sequence< sal_Int8 >& i_identifier )
{
- if ( ( i_identifier.getLength() == 16 ) && ( i_identifier == getUnoTunnelId() ) )
+ if ( isUnoTunnelId<GridColumn>(i_identifier) )
return ::sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ) );
return 0;
}
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 8b9b09fe489f..b81f7ae49d83 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -433,14 +433,14 @@ namespace
class theUnoControlModelUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theUnoControlModelUnoTunnelId> {};
}
-const css::uno::Sequence< sal_Int8 >& UnoControlModel::GetUnoTunnelId() throw()
+const css::uno::Sequence< sal_Int8 >& UnoControlModel::getUnoTunnelId() throw()
{
return theUnoControlModelUnoTunnelId::get().getSeq();
}
sal_Int64 UnoControlModel::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier )
{
- if( ( rIdentifier.getLength() == 16 ) && ( memcmp( UnoControlModel::GetUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) == 0 ) )
+ if( isUnoTunnelId<UnoControlModel>(rIdentifier) )
return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(this));
return 0;