diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-06-12 12:18:07 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-08-23 09:10:49 +0200 |
commit | 24c17dab2f10ad1b7ba342fbd40dc65b7d8f9b24 (patch) | |
tree | 5449a884fc53cf66fe1f02dfa21a5abd268bc3c1 /sc | |
parent | dd7d90055545cb20aa5c12c0be44cccaefdeac47 (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 'sc')
-rw-r--r-- | sc/source/ui/app/drwtrans.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/app/transobj.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/dapiuno.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/nameuno.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/textuno.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaworksheet.cxx | 3 |
7 files changed, 7 insertions, 18 deletions
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index 8805c63efe80..d159243adb1a 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -750,8 +750,7 @@ const css::uno::Sequence< sal_Int8 >& ScDrawTransferObj::getUnoTunnelId() sal_Int64 SAL_CALL ScDrawTransferObj::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) { sal_Int64 nRet; - if( ( rId.getLength() == 16 ) && - ( 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) ) + if( isUnoTunnelId<ScDrawTransferObj>(rId) ) { nRet = reinterpret_cast< sal_Int64 >( this ); } diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 88d5637222e5..0040c12437e1 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -927,8 +927,7 @@ const css::uno::Sequence< sal_Int8 >& ScTransferObj::getUnoTunnelId() sal_Int64 SAL_CALL ScTransferObj::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) { sal_Int64 nRet; - if( ( rId.getLength() == 16 ) && - ( 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) ) + if( isUnoTunnelId<ScTransferObj>(rId) ) { nRet = reinterpret_cast< sal_Int64 >( this ); } diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 195b2a1b4ac8..3d37f6f9d3d4 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -1024,9 +1024,7 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotDescriptorBase::getDataLayoutFi sal_Int64 SAL_CALL ScDataPilotDescriptorBase::getSomething( const Sequence<sal_Int8 >& rId ) { - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) + if ( isUnoTunnelId<ScDataPilotDescriptorBase>(rId) ) { return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); } diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 30067f6ada2d..bbca0b5b6de0 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -2855,9 +2855,7 @@ uno::Sequence<OUString> SAL_CALL ScModelObj::getSupportedServiceNames() sal_Int64 SAL_CALL ScModelObj::getSomething( const uno::Sequence<sal_Int8 >& rId ) { - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) + if ( isUnoTunnelId<ScModelObj>(rId) ) { return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); } diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index e2fb3da5b154..42e6a836a1b2 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -426,9 +426,7 @@ uno::Sequence<OUString> SAL_CALL ScNamedRangeObj::getSupportedServiceNames() sal_Int64 SAL_CALL ScNamedRangeObj::getSomething( const uno::Sequence<sal_Int8 >& rId ) { - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) + if ( isUnoTunnelId<ScNamedRangeObj>(rId) ) { return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); } diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index c62d834a4475..59f1b724442f 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -137,9 +137,7 @@ uno::Reference<text::XText> SAL_CALL ScHeaderFooterContentObj::getRightText() sal_Int64 SAL_CALL ScHeaderFooterContentObj::getSomething( const uno::Sequence<sal_Int8 >& rId ) { - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) + if ( isUnoTunnelId<ScHeaderFooterContentObj>(rId) ) { return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); } diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index 3ff470e89467..f579abf7005f 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -1042,8 +1042,7 @@ ScVbaWorksheet::PrintOut( const uno::Any& From, const uno::Any& To, const uno::A sal_Int64 SAL_CALL ScVbaWorksheet::getSomething(const uno::Sequence<sal_Int8 > & rId) { - if (rId.getLength() == 16 && - 0 == memcmp( ScVbaWorksheet::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 )) + if (isUnoTunnelId<ScVbaWorksheet>(rId)) { return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); } |