summaryrefslogtreecommitdiff
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
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>
-rw-r--r--animations/source/animcore/animcore.cxx2
-rw-r--r--editeng/source/uno/unofield.cxx3
-rw-r--r--editeng/source/uno/unotext.cxx6
-rw-r--r--include/comphelper/servicehelper.hxx13
-rw-r--r--include/toolkit/controls/unocontrolmodel.hxx2
-rw-r--r--sc/source/ui/app/drwtrans.cxx3
-rw-r--r--sc/source/ui/app/transobj.cxx3
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx4
-rw-r--r--sc/source/ui/unoobj/docuno.cxx4
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx4
-rw-r--r--sc/source/ui/unoobj/textuno.cxx4
-rw-r--r--sc/source/ui/vba/vbaworksheet.cxx3
-rw-r--r--sd/source/ui/app/sdxfer.cxx3
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx3
-rw-r--r--sd/source/ui/framework/factories/Pane.cxx3
-rw-r--r--sd/source/ui/framework/factories/ViewShellWrapper.cxx3
-rw-r--r--sd/source/ui/unoidl/DrawController.cxx3
-rw-r--r--sd/source/ui/unoidl/unopage.cxx3
-rw-r--r--starmath/source/mathmlexport.cxx4
-rw-r--r--starmath/source/mathmlimport.cxx4
-rw-r--r--starmath/source/unomodel.cxx6
-rw-r--r--svx/source/fmcomp/gridcell.cxx4
-rw-r--r--svx/source/unodraw/unoshape.cxx2
-rw-r--r--sw/inc/unobaseclass.hxx5
-rw-r--r--sw/source/core/unocore/TextCursorHelper.cxx10
-rw-r--r--sw/source/core/unocore/unochart.cxx4
-rw-r--r--sw/source/core/unocore/unodraw.cxx4
-rw-r--r--sw/source/core/unocore/unoframe.cxx4
-rw-r--r--sw/source/core/unocore/unoport.cxx4
-rw-r--r--sw/source/core/unocore/unoportenum.cxx4
-rw-r--r--sw/source/core/unocore/unosett.cxx8
-rw-r--r--sw/source/core/unocore/unosrch.cxx4
-rw-r--r--sw/source/core/unocore/unotbl.cxx11
-rw-r--r--sw/source/filter/xml/xmlexp.cxx4
-rw-r--r--sw/source/filter/xml/xmlimp.cxx4
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx3
-rw-r--r--sw/source/uibase/uno/unoatxt.cxx12
-rw-r--r--sw/source/uibase/uno/unodispatch.cxx6
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx6
-rw-r--r--sw/source/uibase/uno/unotxvw.cxx10
-rw-r--r--toolkit/source/controls/grid/gridcolumn.cxx3
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx4
-rw-r--r--vcl/source/graphic/UnoGraphic.cxx3
-rw-r--r--vcl/source/treelist/transfer.cxx3
-rw-r--r--xmloff/source/core/unoatrcn.cxx3
-rw-r--r--xmlsecurity/source/gpg/CertificateImpl.cxx2
-rw-r--r--xmlsecurity/source/gpg/SecurityEnvironment.cxx2
-rw-r--r--xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx2
-rw-r--r--xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx2
49 files changed, 77 insertions, 139 deletions
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx
index 9078b2fe4649..b7e28dc15c6d 100644
--- a/animations/source/animcore/animcore.cxx
+++ b/animations/source/animcore/animcore.cxx
@@ -1935,7 +1935,7 @@ void SAL_CALL AnimationNode::removeChangesListener( const Reference< XChangesLis
// XUnoTunnel
::sal_Int64 SAL_CALL AnimationNode::getSomething( const Sequence< ::sal_Int8 >& rId )
{
- if( rId.getLength() == 16 && memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) == 0 )
+ if( isUnoTunnelId<AnimationNode>(rId) )
{
return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(this));
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index ab1b0927dceb..94ca091bead8 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -245,8 +245,7 @@ const css::uno::Sequence< sal_Int8 > & SvxUnoTextField::getUnoTunnelId() throw()
sal_Int64 SAL_CALL SvxUnoTextField::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SvxUnoTextField>(rId) )
{
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
}
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 095a26d65976..a8d80c2fb881 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -2180,8 +2180,7 @@ const uno::Sequence< sal_Int8 > & SvxUnoTextBase::getUnoTunnelId() throw()
sal_Int64 SAL_CALL SvxUnoTextBase::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SvxUnoTextBase>(rId) )
{
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
}
@@ -2259,8 +2258,7 @@ const uno::Sequence< sal_Int8 > & SvxUnoText::getUnoTunnelId() throw()
sal_Int64 SAL_CALL SvxUnoText::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SvxUnoText>(rId) )
{
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
}
diff --git a/include/comphelper/servicehelper.hxx b/include/comphelper/servicehelper.hxx
index 82c3585a9a7a..435a4c4ff5b7 100644
--- a/include/comphelper/servicehelper.hxx
+++ b/include/comphelper/servicehelper.hxx
@@ -51,6 +51,13 @@ namespace comphelper {
}
+template <typename T>
+inline bool isUnoTunnelId(const css::uno::Sequence< sal_Int8 >& rId)
+{
+ return rId.getLength() == 16
+ && memcmp( T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) == 0;
+}
+
/** the UNO3_GETIMPLEMENTATION_* macros implement a static helper function
that gives access to your implementation for a given interface reference,
if possible.
@@ -83,8 +90,7 @@ const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() throw() \
UNO3_GETIMPLEMENTATION_BASE_IMPL(classname)\
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
{ \
- if( rId.getLength() == 16 && memcmp( getUnoTunnelId().getConstArray(), \
- rId.getConstArray(), 16 ) == 0 ) \
+ if( isUnoTunnelId<classname>(rId) ) \
{ \
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); \
} \
@@ -95,8 +101,7 @@ sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >
UNO3_GETIMPLEMENTATION_BASE_IMPL(classname)\
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
{ \
- if( rId.getLength() == 16 && memcmp( getUnoTunnelId().getConstArray(), \
- rId.getConstArray(), 16 ) == 0 ) \
+ if( isUnoTunnelId<classname>(rId) ) \
{ \
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); \
} \
diff --git a/include/toolkit/controls/unocontrolmodel.hxx b/include/toolkit/controls/unocontrolmodel.hxx
index 28f834b220df..f171a59c364b 100644
--- a/include/toolkit/controls/unocontrolmodel.hxx
+++ b/include/toolkit/controls/unocontrolmodel.hxx
@@ -132,7 +132,7 @@ public:
css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
// css::lang::XUnoTunnel
- static const css::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
+ static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() throw();
sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) override;
// css::util::XCloneable
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));
}
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index fbee5519085e..5d042ff64c5a 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -707,8 +707,7 @@ sal_Int64 SAL_CALL SdTransferable::getSomething( const css::uno::Sequence< sal_I
{
sal_Int64 nRet;
- if( ( rId.getLength() == 16 ) &&
- ( 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
+ if( isUnoTunnelId<SdTransferable>(rId) )
{
nRet = sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
}
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index e2707d03928c..10af8fb6559b 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -142,8 +142,7 @@ sal_Int64 SAL_CALL SdPageObjsTLB::SdPageObjsTransferable::getSomething( const cs
{
sal_Int64 nRet;
- if( ( rId.getLength() == 16 ) &&
- ( 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
+ if( isUnoTunnelId<SdPageObjsTLB::SdPageObjsTransferable>(rId) )
{
nRet = static_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
}
diff --git a/sd/source/ui/framework/factories/Pane.cxx b/sd/source/ui/framework/factories/Pane.cxx
index 0245cdbb357f..265eb5636952 100644
--- a/sd/source/ui/framework/factories/Pane.cxx
+++ b/sd/source/ui/framework/factories/Pane.cxx
@@ -151,8 +151,7 @@ sal_Int64 SAL_CALL Pane::getSomething (const Sequence<sal_Int8>& rId)
{
sal_Int64 nResult = 0;
- if (rId.getLength() == 16
- && memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0)
+ if (isUnoTunnelId<Pane>(rId))
{
nResult = reinterpret_cast<sal_Int64>(this);
}
diff --git a/sd/source/ui/framework/factories/ViewShellWrapper.cxx b/sd/source/ui/framework/factories/ViewShellWrapper.cxx
index b63941541982..37cce7586b4f 100644
--- a/sd/source/ui/framework/factories/ViewShellWrapper.cxx
+++ b/sd/source/ui/framework/factories/ViewShellWrapper.cxx
@@ -225,8 +225,7 @@ sal_Int64 SAL_CALL ViewShellWrapper::getSomething (const Sequence<sal_Int8>& rId
{
sal_Int64 nResult = 0;
- if (rId.getLength() == 16
- && memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0)
+ if (isUnoTunnelId<ViewShellWrapper>(rId))
{
nResult = reinterpret_cast<sal_Int64>(this);
}
diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx
index 2ed605bc2bf9..558d9f5fb3fd 100644
--- a/sd/source/ui/unoidl/DrawController.cxx
+++ b/sd/source/ui/unoidl/DrawController.cxx
@@ -573,8 +573,7 @@ sal_Int64 SAL_CALL DrawController::getSomething (const Sequence<sal_Int8>& rId)
{
sal_Int64 nResult = 0;
- if (rId.getLength() == 16
- && memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0)
+ if (isUnoTunnelId<DrawController>(rId))
{
nResult = sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
}
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 6e7bca18d24f..4b2982ca115f 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -332,8 +332,7 @@ const css::uno::Sequence< sal_Int8 > & SdGenericDrawPage::getUnoTunnelId() throw
sal_Int64 SAL_CALL SdGenericDrawPage::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SdGenericDrawPage>(rId) )
{
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
}
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<SmXMLExport>(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<SmXMLImport>(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<SmModel>(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 );
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index db802b41a2d6..09251caaee8d 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -4545,9 +4545,7 @@ sal_Int64 SAL_CALL FmXFilterCell::getSomething( const Sequence< sal_Int8 >& _rId
{
sal_Int64 nReturn(0);
- if ( (_rIdentifier.getLength() == 16)
- && (0 == memcmp( getUnoTunnelId().getConstArray(), _rIdentifier.getConstArray(), 16 ))
- )
+ if ( isUnoTunnelId<FmXFilterCell>(_rIdentifier) )
{
nReturn = reinterpret_cast<sal_Int64>(this);
}
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index d7f665bc9253..7dee8bc71e30 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -297,7 +297,7 @@ const css::uno::Sequence< sal_Int8 > & SvxShape::getUnoTunnelId() throw()
sal_Int64 SAL_CALL SvxShape::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SvxShape>(rId) )
{
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
}
diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx
index 674901c36a12..5ca6bd074873 100644
--- a/sw/inc/unobaseclass.hxx
+++ b/sw/inc/unobaseclass.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XEnumeration.hpp>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/implbase.hxx>
#include <vcl/svapp.hxx>
@@ -114,9 +115,7 @@ namespace sw {
UnoTunnelImpl(const css::uno::Sequence< sal_Int8 > & rId,
C *const pThis)
{
- if ((rId.getLength() == 16) &&
- (0 == memcmp(C::getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16)))
+ if (isUnoTunnelId<C>(rId))
{
return ::sal::static_int_cast< sal_Int64 >(
reinterpret_cast< sal_IntPtr >(pThis) );
diff --git a/sw/source/core/unocore/TextCursorHelper.cxx b/sw/source/core/unocore/TextCursorHelper.cxx
index df4a49001ba4..f8bf5dd9a026 100644
--- a/sw/source/core/unocore/TextCursorHelper.cxx
+++ b/sw/source/core/unocore/TextCursorHelper.cxx
@@ -37,12 +37,10 @@ const uno::Sequence< sal_Int8 > & OTextCursorHelper::getUnoTunnelId()
sal_Int64 SAL_CALL OTextCursorHelper::getSomething(
const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
- {
- return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
- }
+ if( isUnoTunnelId<OTextCursorHelper>(rId) )
+ {
+ return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
+ }
return 0;
}
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index db84c2e13a2c..895cf5b7e5c3 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -1901,9 +1901,7 @@ const uno::Sequence< sal_Int8 > & SwChartDataSequence::getUnoTunnelId()
sal_Int64 SAL_CALL SwChartDataSequence::getSomething( const uno::Sequence< sal_Int8 > &rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwChartDataSequence>(rId) )
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
}
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index f3f4dfbf4115..69eefbb45a06 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -850,9 +850,7 @@ const uno::Sequence< sal_Int8 > & SwXShape::getUnoTunnelId()
sal_Int64 SAL_CALL SwXShape::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXShape>(rId) )
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
}
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 2481e6d4b661..5ed7b51c6cc6 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1174,9 +1174,7 @@ const ::uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId()
sal_Int64 SAL_CALL SwXFrame::getSomething( const ::uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXFrame>(rId) )
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
}
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index e97e65b32f98..3e580633b0ab 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -787,9 +787,7 @@ const uno::Sequence< sal_Int8 > & SwXTextPortion::getUnoTunnelId()
sal_Int64 SwXTextPortion::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXTextPortion>(rId) )
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
}
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index b80c9d5dd8ac..bf7fca58e5fc 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -310,9 +310,7 @@ const uno::Sequence< sal_Int8 > & SwXTextPortionEnumeration::getUnoTunnelId()
sal_Int64 SAL_CALL SwXTextPortionEnumeration::getSomething(
const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXTextPortionEnumeration>(rId) )
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ) );
}
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index f58685cd2ba6..2da70bd5cdcc 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1040,9 +1040,7 @@ const uno::Sequence< sal_Int8 > & SwXNumberingRules::getUnoTunnelId()
// return implementation specific data
sal_Int64 SwXNumberingRules::getSomething( const uno::Sequence< sal_Int8 > & rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXNumberingRules>(rId) )
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
}
@@ -2555,9 +2553,7 @@ const uno::Sequence< sal_Int8 > & SwXTextColumns::getUnoTunnelId()
sal_Int64 SAL_CALL SwXTextColumns::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXTextColumns>(rId) )
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
}
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index c324ab47d1b8..603c4063e5d4 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -463,9 +463,7 @@ const uno::Sequence< sal_Int8 > & SwXTextSearch::getUnoTunnelId()
sal_Int64 SAL_CALL SwXTextSearch::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXTextSearch>(rId) )
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
}
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 57d645baf495..48438301f112 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -773,9 +773,7 @@ const uno::Sequence< sal_Int8 > & SwXCell::getUnoTunnelId()
sal_Int64 SAL_CALL SwXCell::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXCell>(rId) )
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
}
@@ -2018,8 +2016,7 @@ const uno::Sequence< sal_Int8 > & SwXTextTable::getUnoTunnelId()
sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- if(rId.getLength() == 16
- && 0 == memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16))
+ if(isUnoTunnelId<SwXTextTable>(rId))
{
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
}
@@ -3222,9 +3219,7 @@ const uno::Sequence< sal_Int8 > & SwXCellRange::getUnoTunnelId()
sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXCellRange>(rId) )
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
}
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 20457677a024..28745ab2f023 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -489,9 +489,7 @@ const Sequence< sal_Int8 > & SwXMLExport::getUnoTunnelId() throw()
sal_Int64 SAL_CALL SwXMLExport::getSomething( const Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXMLExport>(rId) )
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
}
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index fcfdd47b6231..1c633585c8d1 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -471,9 +471,7 @@ const Sequence< sal_Int8 > & SwXMLImport::getUnoTunnelId() throw()
sal_Int64 SAL_CALL SwXMLImport::getSomething( const Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXMLImport>(rId) )
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
}
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 0d5a46119ab3..a786c4e352b3 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -3898,8 +3898,7 @@ const Sequence< sal_Int8 >& SwTransferable::getUnoTunnelId()
sal_Int64 SwTransferable::getSomething( const Sequence< sal_Int8 >& rId )
{
sal_Int64 nRet;
- if( ( rId.getLength() == 16 ) &&
- ( 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
+ if( isUnoTunnelId<SwTransferable>(rId) )
{
nRet = sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ) );
}
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index 4987717d9a25..1e3fe183463b 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -222,11 +222,9 @@ const uno::Sequence< sal_Int8 > & SwXAutoTextGroup::getUnoTunnelId()
sal_Int64 SAL_CALL SwXAutoTextGroup::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXAutoTextGroup>(rId) )
{
- return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
+ return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
}
return 0;
}
@@ -689,11 +687,9 @@ const uno::Sequence< sal_Int8 > & SwXAutoTextEntry::getUnoTunnelId()
sal_Int64 SAL_CALL SwXAutoTextEntry::getSomething( const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXAutoTextEntry>(rId) )
{
- return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
+ return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
}
return 0;
}
diff --git a/sw/source/uibase/uno/unodispatch.cxx b/sw/source/uibase/uno/unodispatch.cxx
index 40353c7baba3..822b467d35ad 100644
--- a/sw/source/uibase/uno/unodispatch.cxx
+++ b/sw/source/uibase/uno/unodispatch.cxx
@@ -163,11 +163,9 @@ const uno::Sequence< sal_Int8 > & SwXDispatchProviderInterceptor::getUnoTunnelId
sal_Int64 SwXDispatchProviderInterceptor::getSomething(
const uno::Sequence< sal_Int8 >& aIdentifier )
{
- if( aIdentifier.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- aIdentifier.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXDispatchProviderInterceptor>(aIdentifier) )
{
- return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
+ return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
}
return 0;
}
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 3299a6f043e9..6dd0738d85d1 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -298,11 +298,9 @@ const Sequence< sal_Int8 > & SwXTextDocument::getUnoTunnelId()
sal_Int64 SAL_CALL SwXTextDocument::getSomething( const Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SwXTextDocument>(rId) )
{
- return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
+ return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
}
if( rId.getLength() == 16
&& 0 == memcmp( SfxObjectShell::getUnoTunnelId().getConstArray(),
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index 9bc4abcfd985..dd04e6f53a5f 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -1680,12 +1680,10 @@ const uno::Sequence< sal_Int8 > & SwXTextViewCursor::getUnoTunnelId()
sal_Int64 SAL_CALL SwXTextViewCursor::getSomething(
const uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16
- && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
- {
- return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
- }
+ if( isUnoTunnelId<SwXTextViewCursor>(rId) )
+ {
+ return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
+ }
return OTextCursorHelper::getSomething(rId);
}
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;
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));
}
diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx
index 7af1bf24d72c..8c858cca2ca2 100644
--- a/xmloff/source/core/unoatrcn.cxx
+++ b/xmloff/source/core/unoatrcn.cxx
@@ -99,8 +99,7 @@ const css::uno::Sequence< sal_Int8 > & SvUnoAttributeContainer::getUnoTunnelId()
sal_Int64 SAL_CALL SvUnoAttributeContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
{
- if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( isUnoTunnelId<SvUnoAttributeContainer>(rId) )
{
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
}
diff --git a/xmlsecurity/source/gpg/CertificateImpl.cxx b/xmlsecurity/source/gpg/CertificateImpl.cxx
index 3b005629ba7a..525706e26748 100644
--- a/xmlsecurity/source/gpg/CertificateImpl.cxx
+++ b/xmlsecurity/source/gpg/CertificateImpl.cxx
@@ -197,7 +197,7 @@ sal_Int32 SAL_CALL CertificateImpl::getCertificateUsage()
/* XUnoTunnel */
sal_Int64 SAL_CALL CertificateImpl::getSomething(const Sequence< sal_Int8 >& aIdentifier)
{
- if( aIdentifier.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+ if( isUnoTunnelId<CertificateImpl>(aIdentifier) ) {
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
}
return 0 ;
diff --git a/xmlsecurity/source/gpg/SecurityEnvironment.cxx b/xmlsecurity/source/gpg/SecurityEnvironment.cxx
index 42fa728d83f4..468738f34c33 100644
--- a/xmlsecurity/source/gpg/SecurityEnvironment.cxx
+++ b/xmlsecurity/source/gpg/SecurityEnvironment.cxx
@@ -92,7 +92,7 @@ SecurityEnvironmentGpg::~SecurityEnvironmentGpg()
/* XUnoTunnel */
sal_Int64 SAL_CALL SecurityEnvironmentGpg::getSomething( const Sequence< sal_Int8 >& aIdentifier )
{
- if( aIdentifier.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+ if( isUnoTunnelId<SecurityEnvironmentGpg>(aIdentifier) ) {
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
}
return 0 ;
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index 6892052011b2..4c03131c07f2 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -154,7 +154,7 @@ Sequence< OUString > SAL_CALL SecurityEnvironment_NssImpl::getSupportedServiceNa
/* XUnoTunnel */
sal_Int64 SAL_CALL SecurityEnvironment_NssImpl::getSomething( const Sequence< sal_Int8 >& aIdentifier )
{
- if( aIdentifier.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+ if( isUnoTunnelId<SecurityEnvironment_NssImpl>(aIdentifier) ) {
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
}
return 0 ;
diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
index 374c9f83671e..1a323d33f32f 100644
--- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
@@ -343,7 +343,7 @@ SECKEYPrivateKey* X509Certificate_NssImpl::getPrivateKey()
/* XUnoTunnel */
sal_Int64 SAL_CALL X509Certificate_NssImpl::getSomething( const Sequence< sal_Int8 >& aIdentifier ) {
- if( aIdentifier.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+ if( isUnoTunnelId<X509Certificate_NssImpl>(aIdentifier) ) {
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
}
return 0 ;