From 626fe1669f7062e04db60ce7757d1c7d32842b3a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 29 Apr 2015 09:42:07 +0100 Subject: redundant cast Change-Id: Ib812a7cafabc4820946da67fb3f8896b6aad1461 --- stoc/source/inspect/introspection.cxx | 17 +++++++---------- stoc/source/servicemanager/servicemanager.cxx | 4 ++-- stoc/test/testintrosp.cxx | 4 ++-- 3 files changed, 11 insertions(+), 14 deletions(-) (limited to 'stoc') diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 86b2a38dd535..49635c149a49 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -1224,9 +1224,8 @@ Sequence< Property > ImplIntrospectionAccess::getProperties(sal_Int32 PropertyCo nCount += mpStaticImpl->mnMethodPropCount; // Sequence entsprechend der geforderten Anzahl reallocieren - ImplIntrospectionAccess* pThis = (ImplIntrospectionAccess*)this; // const umgehen - pThis->maLastPropertySeq.realloc( nCount ); - Property* pDestProps = pThis->maLastPropertySeq.getArray(); + maLastPropertySeq.realloc( nCount ); + Property* pDestProps = maLastPropertySeq.getArray(); // Alle Properties durchgehen und entsprechend der Concepte uebernehmen Sequence aPropSeq = mpStaticImpl->getProperties(); @@ -1243,7 +1242,7 @@ Sequence< Property > ImplIntrospectionAccess::getProperties(sal_Int32 PropertyCo } // PropertyConcept merken, dies entspricht maLastPropertySeq - pThis->mnLastPropertyConcept = PropertyConcepts; + mnLastPropertyConcept = PropertyConcepts; // Zusammengebastelte Sequence liefern return maLastPropertySeq; @@ -1286,8 +1285,6 @@ sal_Bool ImplIntrospectionAccess::hasMethod(const OUString& Name, sal_Int32 Meth Sequence< Reference > ImplIntrospectionAccess::getMethods(sal_Int32 MethodConcepts) throw( RuntimeException, std::exception ) { - ImplIntrospectionAccess* pThis = (ImplIntrospectionAccess*)this; // const umgehen - // Wenn alle unterstuetzten Konzepte gefordert werden, Sequence einfach durchreichen sal_Int32 nAllSupportedMask = MethodConcept::DANGEROUS | PROPERTY | @@ -1317,8 +1314,8 @@ Sequence< Reference > ImplIntrospectionAccess::getMethods(sal_Int32 // Anders als bei den Properties kann die Anzahl nicht durch // Zaehler in inspect() vorher ermittelt werden, da Methoden // mehreren Konzepten angehoeren koennen - pThis->maLastMethodSeq.realloc( nLen ); - Reference* pDestMethods = pThis->maLastMethodSeq.getArray(); + maLastMethodSeq.realloc( nLen ); + Reference* pDestMethods = maLastMethodSeq.getArray(); // Alle Methods durchgehen und entsprechend der Concepte uebernehmen sal_Int32 iDest = 0; @@ -1330,10 +1327,10 @@ Sequence< Reference > ImplIntrospectionAccess::getMethods(sal_Int32 } // Auf die richtige Laenge bringen - pThis->maLastMethodSeq.realloc( iDest ); + maLastMethodSeq.realloc( iDest ); // MethodConcept merken, dies entspricht maLastMethodSeq - pThis->mnLastMethodConcept = MethodConcepts; + mnLastMethodConcept = MethodConcepts; // Zusammengebastelte Sequence liefern return maLastMethodSeq; diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx index 33a35578e0e1..733bdb9a92f3 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -1588,9 +1588,9 @@ Reference ORegistryServiceManager::createContentEnumeration( throw(css::uno::RuntimeException, std::exception) { check_undisposed(); - MutexGuard aGuard( ((ORegistryServiceManager *)this)->m_mutex ); + MutexGuard aGuard(m_mutex); // get all implementation names registered under this service name from the registry - Sequence aImpls = ((ORegistryServiceManager *)this)->getFromServiceName( aServiceName ); + Sequence aImpls = getFromServiceName( aServiceName ); // load and insert all factories specified by the registry sal_Int32 i; OUString aImplName; diff --git a/stoc/test/testintrosp.cxx b/stoc/test/testintrosp.cxx index 9e89f6987215..b8ae54460a8c 100644 --- a/stoc/test/testintrosp.cxx +++ b/stoc/test/testintrosp.cxx @@ -581,7 +581,7 @@ Any ImplIntroTest::getByName( const OUString& aName ) Any aRetAny; if( !pNameAccessTab ) - ((ImplIntroTest*)this)->pNameAccessTab = new Reference< XIntroTest >[ DEFAULT_NAME_ACCESS_COUNT ]; + pNameAccessTab = new Reference< XIntroTest >[ DEFAULT_NAME_ACCESS_COUNT ]; sal_Int32 iIndex = getIndexForName( aName ); if( iIndex != -1 ) @@ -634,7 +634,7 @@ Any ImplIntroTest::getByIndex( sal_Int32 Index ) Any aRetAny; if( !pIndexAccessTab ) - ((ImplIntroTest*)this)->pIndexAccessTab = new Reference< XIntroTest >[ iIndexAccessCount ]; + pIndexAccessTab = new Reference< XIntroTest >[ iIndexAccessCount ]; if( Index < iIndexAccessCount ) { -- cgit