summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2014-05-22 23:19:05 +0200
committerJulien Nabet <serval2412@yahoo.fr>2014-05-22 23:21:18 +0200
commitb09b5f8f7cfd2d7f3125dab93ebe996c160e1e0c (patch)
treedacb87512726af1941d0c6b072d0b3626335cc4c /basic
parent87c1aa16a95dcff9247ae12a4bb5ea2d866b1772 (diff)
Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part19
Change-Id: Iab50c52a132c90389992ef68c2d31df95a193ab9
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sbunoobj.cxx12
-rw-r--r--basic/source/uno/dlgcont.cxx4
-rw-r--r--basic/source/uno/namecont.cxx8
3 files changed, 12 insertions, 12 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 85343b2dc4ae..86881eeca526 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -847,7 +847,7 @@ Type getUnoTypeForSbxBaseType( SbxDataType eType )
Type aRetType = getCppuVoidType();
switch( eType )
{
- case SbxNULL: aRetType = ::getCppuType( (const Reference< XInterface > *)0 ); break;
+ case SbxNULL: aRetType = cppu::UnoType<XInterface>::get(); break;
case SbxINTEGER: aRetType = cppu::UnoType<sal_Int16>::get(); break;
case SbxLONG: aRetType = cppu::UnoType<sal_Int32>::get(); break;
case SbxSINGLE: aRetType = cppu::UnoType<float>::get(); break;
@@ -891,7 +891,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal )
SbxBaseRef xObj = (SbxBase*)pVal->GetObject();
if( !xObj )
{
- aRetType = getCppuType( static_cast<Reference<XInterface> *>(0) );
+ aRetType = cppu::UnoType<XInterface>::get();
return aRetType;
}
@@ -1592,7 +1592,7 @@ Any invokeAutomationMethod( const OUString& Name, Sequence< Any >& args, SbxArra
// Debugging help method to readout the imlemented interfaces of an object
OUString Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Reference< XIdlClass >& xClass, sal_uInt16 nRekLevel )
{
- Type aIfaceType = ::getCppuType( (const Reference< XInterface > *)0 );
+ Type aIfaceType = cppu::UnoType<XInterface>::get();
static Reference< XIdlClass > xIfaceClass = TypeToIdlClass( aIfaceType );
OUStringBuffer aRetStr;
@@ -2117,7 +2117,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
}
}
// get the value
- Reference< XPropertySet > xPropSet( mxUnoAccess->queryAdapter( ::getCppuType( (const Reference< XPropertySet > *)0 ) ), UNO_QUERY );
+ Reference< XPropertySet > xPropSet( mxUnoAccess->queryAdapter( cppu::UnoType<XPropertySet>::get()), UNO_QUERY );
Any aRetAny = xPropSet->getPropertyValue( pProp->GetName() );
// The use of getPropertyValue (instead of using the index) is
// suboptimal, but the refactoring to XInvocation is already pending
@@ -2188,7 +2188,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
try
{
// set the value
- Reference< XPropertySet > xPropSet( mxUnoAccess->queryAdapter( ::getCppuType( (const Reference< XPropertySet > *)0 ) ), UNO_QUERY );
+ Reference< XPropertySet > xPropSet( mxUnoAccess->queryAdapter( cppu::UnoType<XPropertySet>::get()), UNO_QUERY );
xPropSet->setPropertyValue( pProp->GetName(), aAnyValue );
// The use of getPropertyValue (instead of using the index) is
// suboptimal, but the refactoring to XInvocation is already pending
@@ -2701,7 +2701,7 @@ SbxVariable* SbUnoObject::Find( const OUString& rName, SbxClassType t )
{
try
{
- Reference< XNameAccess > xNameAccess( mxUnoAccess->queryAdapter( ::getCppuType( (const Reference< XPropertySet > *)0 ) ), UNO_QUERY );
+ Reference< XNameAccess > xNameAccess( mxUnoAccess->queryAdapter( cppu::UnoType<XPropertySet>::get()), UNO_QUERY );
OUString aUName2( rName );
if( xNameAccess.is() && xNameAccess->hasByName( aUName2 ) )
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index a759eea503da..bc4223a0e2b9 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -496,7 +496,7 @@ SfxDialogLibrary::SfxDialogLibrary( ModifiableHelper& _rModifiable,
const Reference< XComponentContext >& xContext,
const Reference< XSimpleFileAccess3 >& xSFI,
SfxDialogLibraryContainer* pParent )
- : SfxLibrary( _rModifiable, getCppuType( (const Reference< XInputStreamProvider > *)0 ), xContext, xSFI )
+ : SfxLibrary( _rModifiable, cppu::UnoType<XInputStreamProvider>::get(), xContext, xSFI )
, m_pParent( pParent )
, m_aName( aName )
{
@@ -510,7 +510,7 @@ SfxDialogLibrary::SfxDialogLibrary( ModifiableHelper& _rModifiable,
const OUString& aStorageURL,
bool ReadOnly,
SfxDialogLibraryContainer* pParent )
- : SfxLibrary( _rModifiable, getCppuType( (const Reference< XInputStreamProvider > *)0 ),
+ : SfxLibrary( _rModifiable, cppu::UnoType<XInputStreamProvider>::get(),
xContext, xSFI, aLibInfoFileURL, aStorageURL, ReadOnly)
, m_pParent( pParent )
, m_aName( aName )
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 52d3494f23ef..6bbe98854f61 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -372,7 +372,7 @@ SfxLibraryContainer::SfxLibraryContainer( void )
, mnRunningVBAScripts( 0 )
, mbVBACompat( false )
, maModifiable( *this, maMutex )
- , maNameContainer( getCppuType( (Reference< XNameAccess >*) NULL ) )
+ , maNameContainer( cppu::UnoType<XNameAccess>::get())
, mbOldInfoFormat( false )
, mbOasis2OOoFormat( false )
, mpBasMgr( NULL )
@@ -3222,9 +3222,9 @@ Sequence< Type > SfxLibrary::getTypes()
if( !s_pTypes_NameContainer )
{
static OTypeCollection s_aTypes_NameContainer(
- ::getCppuType( (const Reference< XNameContainer > *)0 ),
- ::getCppuType( (const Reference< XContainer > *)0 ),
- ::getCppuType( (const Reference< XChangesNotifier > *)0 ),
+ cppu::UnoType<XNameContainer>::get(),
+ cppu::UnoType<XContainer>::get(),
+ cppu::UnoType<XChangesNotifier>::get(),
OComponentHelper::getTypes() );
s_pTypes_NameContainer = &s_aTypes_NameContainer;
}