const_cast is not needed here

Change-Id: Ifdc1b9006fb325f14ce7623d9a28acc41a067167
Reviewed-on: https://gerrit.libreoffice.org/67193
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2019-01-31 10:30:25 +01:00
parent 30cc54a453
commit b7e89cd6c0

View file

@ -287,9 +287,8 @@ IntrospectionAccessStatic_Impl::IntrospectionAccessStatic_Impl( Reference< XIdlR
sal_Int32 IntrospectionAccessStatic_Impl::getPropertyIndex( const OUString& aPropertyName ) const
{
IntrospectionAccessStatic_Impl* pThis = const_cast<IntrospectionAccessStatic_Impl*>(this);
IntrospectionNameMap::iterator aIt = pThis->maPropertyNameMap.find( aPropertyName );
if (aIt != pThis->maPropertyNameMap.end())
auto aIt = maPropertyNameMap.find(aPropertyName);
if (aIt != maPropertyNameMap.end())
return aIt->second;
return -1;
@ -297,9 +296,8 @@ sal_Int32 IntrospectionAccessStatic_Impl::getPropertyIndex( const OUString& aPro
sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( const OUString& aMethodName ) const
{
IntrospectionAccessStatic_Impl* pThis = const_cast<IntrospectionAccessStatic_Impl*>(this);
IntrospectionNameMap::iterator aIt = pThis->maMethodNameMap.find( aMethodName );
if (aIt != pThis->maMethodNameMap.end())
auto aIt = maMethodNameMap.find(aMethodName);
if (aIt != maMethodNameMap.end())
{
return aIt->second;
}
@ -315,8 +313,8 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( const OUString& aMetho
OUString aPureMethodName = aMethodName.copy( nFound + 1 );
aIt = pThis->maMethodNameMap.find( aPureMethodName );
if (aIt != pThis->maMethodNameMap.end())
aIt = maMethodNameMap.find( aPureMethodName );
if (aIt != maMethodNameMap.end())
{
// Check if it can be a type?
// Problem: Does not work if package names contain _ ?!