From 24c17dab2f10ad1b7ba342fbd40dc65b7d8f9b24 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Wed, 12 Jun 2019 12:18:07 +0300 Subject: 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 --- starmath/source/mathmlexport.cxx | 4 +--- starmath/source/mathmlimport.cxx | 4 +--- starmath/source/unomodel.cxx | 6 ++---- 3 files changed, 4 insertions(+), 10 deletions(-) (limited to 'starmath') diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index aa850f62f29b..3c0d3ff891c4 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -352,9 +352,7 @@ SmXMLExport::SmXMLExport( sal_Int64 SAL_CALL SmXMLExport::getSomething( const uno::Sequence< sal_Int8 >& rId ) { - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) + if ( isUnoTunnelId(rId) ) return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_uIntPtr >(this)); return SvXMLExport::getSomething( rId ); diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx index 28b3800f9a7f..946c8e240a7c 100644 --- a/starmath/source/mathmlimport.cxx +++ b/starmath/source/mathmlimport.cxx @@ -458,9 +458,7 @@ Math_XMLOasisSettingsImporter_get_implementation(uno::XComponentContext* pCtx, sal_Int64 SAL_CALL SmXMLImport::getSomething( const uno::Sequence< sal_Int8 >&rId ) { - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) + if ( isUnoTunnelId(rId) ) return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_uIntPtr >(this)); return SvXMLImport::getSomething( rId ); diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index c271f079d9d3..db7668ad08c6 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -365,11 +365,9 @@ const uno::Sequence< sal_Int8 > & SmModel::getUnoTunnelId() sal_Int64 SAL_CALL SmModel::getSomething( const uno::Sequence< sal_Int8 >& rId ) { - if( rId.getLength() == 16 - && 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) + if( isUnoTunnelId(rId) ) { - return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_uIntPtr >(this)); + return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_uIntPtr >(this)); } return SfxBaseModel::getSomething( rId ); -- cgit