From 3558f9c0592b443f20ca1f406198f89a5385767e Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 18 May 2014 01:14:29 +0200 Subject: Prefer cppu::UnoType::get() to ::getCppuType((T*)0) part17 Change-Id: Ie6dbe87599c9cf53c7b9cc6becb9438e62cdb537 --- svtools/source/graphic/descriptor.cxx | 38 +++++++++++------------ svtools/source/graphic/graphic.cxx | 10 +++--- svtools/source/graphic/provider.cxx | 6 ++-- svtools/source/graphic/renderer.cxx | 32 +++++++++---------- svtools/source/hatchwindow/hatchwindow.cxx | 2 +- svtools/source/uno/unoiface.cxx | 16 +++++----- svtools/source/uno/unoimap.cxx | 50 +++++++++++++++--------------- 7 files changed, 77 insertions(+), 77 deletions(-) (limited to 'svtools') diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx index ed42faf3f278..d24911d60e25 100644 --- a/svtools/source/graphic/descriptor.cxx +++ b/svtools/source/graphic/descriptor.cxx @@ -198,15 +198,15 @@ uno::Any SAL_CALL GraphicDescriptor::queryAggregation( const uno::Type & rType ) { uno::Any aAny; - if( rType == ::getCppuType((const uno::Reference< lang::XServiceInfo >*)0) ) + if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< lang::XServiceInfo >(this); - else if( rType == ::getCppuType((const uno::Reference< lang::XTypeProvider >*)0) ) + else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< lang::XTypeProvider >(this); - else if( rType == ::getCppuType((const uno::Reference< beans::XPropertySet >*)0) ) + else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< beans::XPropertySet >(this); - else if( rType == ::getCppuType((const uno::Reference< beans::XPropertyState >*)0) ) + else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< beans::XPropertyState >(this); - else if( rType == ::getCppuType((const uno::Reference< beans::XMultiPropertySet >*)0) ) + else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< beans::XMultiPropertySet >(this); else aAny <<= OWeakAggObject::queryAggregation( rType ); @@ -268,12 +268,12 @@ uno::Sequence< uno::Type > SAL_CALL GraphicDescriptor::getTypes() uno::Sequence< uno::Type > aTypes( 6 ); uno::Type* pTypes = aTypes.getArray(); - *pTypes++ = ::getCppuType((const uno::Reference< uno::XAggregation>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< lang::XServiceInfo>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< lang::XTypeProvider>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< beans::XPropertySet>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< beans::XPropertyState>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< beans::XMultiPropertySet>*)0); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); return aTypes; } @@ -293,14 +293,14 @@ uno::Sequence< sal_Int8 > SAL_CALL GraphicDescriptor::getImplementationId() static ::comphelper::PropertyMapEntry const aEntries[] = { - { OUString("GraphicType"), UNOGRAPHIC_GRAPHICTYPE, ::getCppuType( (const sal_Int8*)(0)), beans::PropertyAttribute::READONLY, 0 }, - { OUString("MimeType"), UNOGRAPHIC_MIMETYPE, ::getCppuType( (const OUString*)(0)), beans::PropertyAttribute::READONLY, 0 }, - { OUString("SizePixel"), UNOGRAPHIC_SIZEPIXEL, ::getCppuType( (const awt::Size*)(0)), beans::PropertyAttribute::READONLY, 0 }, - { OUString("Size100thMM"), UNOGRAPHIC_SIZE100THMM, ::getCppuType( (const awt::Size*)(0)), beans::PropertyAttribute::READONLY, 0 }, - { OUString("BitsPerPixel"), UNOGRAPHIC_BITSPERPIXEL, ::getCppuType( (const sal_uInt8*)(0)), beans::PropertyAttribute::READONLY, 0 }, - { OUString("Transparent"), UNOGRAPHIC_TRANSPARENT, ::getCppuType( (const sal_Bool*)(0)), beans::PropertyAttribute::READONLY, 0 }, - { OUString("Alpha"), UNOGRAPHIC_ALPHA, ::getCppuType( (const sal_Bool*)(0)), beans::PropertyAttribute::READONLY, 0 }, - { OUString("Animated"), UNOGRAPHIC_ANIMATED, ::getCppuType( (const sal_Bool*)(0)), beans::PropertyAttribute::READONLY, 0 }, + { OUString("GraphicType"), UNOGRAPHIC_GRAPHICTYPE, cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 }, + { OUString("MimeType"), UNOGRAPHIC_MIMETYPE, cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 }, + { OUString("SizePixel"), UNOGRAPHIC_SIZEPIXEL, cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 }, + { OUString("Size100thMM"), UNOGRAPHIC_SIZE100THMM, cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 }, + { OUString("BitsPerPixel"), UNOGRAPHIC_BITSPERPIXEL, cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 }, + { OUString("Transparent"), UNOGRAPHIC_TRANSPARENT, cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 }, + { OUString("Alpha"), UNOGRAPHIC_ALPHA, cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 }, + { OUString("Animated"), UNOGRAPHIC_ANIMATED, cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 }, { OUString(), 0, css::uno::Type(), 0, 0 } }; diff --git a/svtools/source/graphic/graphic.cxx b/svtools/source/graphic/graphic.cxx index 3b75db9b4a6e..513063407475 100644 --- a/svtools/source/graphic/graphic.cxx +++ b/svtools/source/graphic/graphic.cxx @@ -61,11 +61,11 @@ uno::Any SAL_CALL Graphic::queryAggregation( const uno::Type& rType ) throw( uno::RuntimeException, std::exception ) { uno::Any aAny; - if( rType == ::getCppuType((const uno::Reference< graphic::XGraphic >*)0) ) + if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< graphic::XGraphic >( this ); - else if( rType == ::getCppuType((const uno::Reference< awt::XBitmap >*)0) ) + else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< awt::XBitmap >( this ); - else if( rType == ::getCppuType((const uno::Reference< lang::XUnoTunnel >*)0) ) + else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< lang::XUnoTunnel >(this); else aAny <<= ::unographic::GraphicDescriptor::queryAggregation( rType ); @@ -151,8 +151,8 @@ uno::Sequence< uno::Type > SAL_CALL Graphic::getTypes() sal_Int32 nOldCount = aRet.getLength(); aRet.realloc( nOldCount + 2 ); - aRet[ nOldCount ] = ::getCppuType((const uno::Reference< graphic::XGraphic>*)0); - aRet[ nOldCount+1 ] = ::getCppuType((const uno::Reference< awt::XBitmap>*)0); + aRet[ nOldCount ] = cppu::UnoType::get(); + aRet[ nOldCount+1 ] = cppu::UnoType::get(); return aRet; } diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 9ad16f7b7bcc..a184ae298d3d 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -84,9 +84,9 @@ uno::Sequence< uno::Type > SAL_CALL GraphicProvider::getTypes() uno::Sequence< uno::Type > aTypes( 3 ); uno::Type* pTypes = aTypes.getArray(); - *pTypes++ = ::getCppuType((const uno::Reference< lang::XServiceInfo>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< lang::XTypeProvider>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< graphic::XGraphicProvider>*)0); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); return aTypes; } diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx index e903fc9c53c8..e262f3189f43 100644 --- a/svtools/source/graphic/renderer.cxx +++ b/svtools/source/graphic/renderer.cxx @@ -61,17 +61,17 @@ uno::Any SAL_CALL GraphicRendererVCL::queryAggregation( const uno::Type & rType { uno::Any aAny; - if( rType == ::getCppuType((const uno::Reference< lang::XServiceInfo >*)0) ) + if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< lang::XServiceInfo >(this); - else if( rType == ::getCppuType((const uno::Reference< lang::XTypeProvider >*)0) ) + else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< lang::XTypeProvider >(this); - else if( rType == ::getCppuType((const uno::Reference< beans::XPropertySet >*)0) ) + else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< beans::XPropertySet >(this); - else if( rType == ::getCppuType((const uno::Reference< beans::XPropertyState >*)0) ) + else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< beans::XPropertyState >(this); - else if( rType == ::getCppuType((const uno::Reference< beans::XMultiPropertySet >*)0) ) + else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< beans::XMultiPropertySet >(this); - else if( rType == ::getCppuType((const uno::Reference< graphic::XGraphicRenderer >*)0) ) + else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< graphic::XGraphicRenderer >(this); else aAny <<= OWeakAggObject::queryAggregation( rType ); @@ -135,13 +135,13 @@ uno::Sequence< uno::Type > SAL_CALL GraphicRendererVCL::getTypes() uno::Sequence< uno::Type > aTypes( 7 ); uno::Type* pTypes = aTypes.getArray(); - *pTypes++ = ::getCppuType((const uno::Reference< uno::XAggregation>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< lang::XServiceInfo>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< lang::XTypeProvider>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< beans::XPropertySet>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< beans::XPropertyState>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< beans::XMultiPropertySet>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< graphic::XGraphicRenderer>*)0); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); return aTypes; } @@ -161,9 +161,9 @@ uno::Sequence< sal_Int8 > SAL_CALL GraphicRendererVCL::getImplementationId() static ::comphelper::PropertyMapEntry const aEntries[] = { - { OUString("Device"), UNOGRAPHIC_DEVICE, ::getCppuType( (const uno::Any*)(0)), 0, 0 }, - { OUString("DestinationRect"), UNOGRAPHIC_DESTINATIONRECT, ::getCppuType( (const awt::Rectangle*)(0)), 0, 0 }, - { OUString("RenderData"), UNOGRAPHIC_RENDERDATA, ::getCppuType( (const uno::Any*)(0)), 0, 0 }, + { OUString("Device"), UNOGRAPHIC_DEVICE, cppu::UnoType::get(), 0, 0 }, + { OUString("DestinationRect"), UNOGRAPHIC_DESTINATIONRECT, cppu::UnoType::get(), 0, 0 }, + { OUString("RenderData"), UNOGRAPHIC_RENDERDATA, cppu::UnoType::get(), 0, 0 }, { OUString(), 0, css::uno::Type(), 0, 0 } }; diff --git a/svtools/source/hatchwindow/hatchwindow.cxx b/svtools/source/hatchwindow/hatchwindow.cxx index 402d8a5f897e..eee3307916d7 100644 --- a/svtools/source/hatchwindow/hatchwindow.cxx +++ b/svtools/source/hatchwindow/hatchwindow.cxx @@ -148,7 +148,7 @@ uno::Sequence< uno::Type > SAL_CALL VCLXHatchWindow::getTypes() if ( pTypeCollection == NULL ) { static ::cppu::OTypeCollection aTypeCollection( - ::getCppuType(( const uno::Reference< embed::XHatchWindow >* )NULL ), + cppu::UnoType::get(), VCLXHatchWindow::getTypes() ); pTypeCollection = &aTypeCollection ; diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index f713f428db35..93b63da6c6d1 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -194,9 +194,9 @@ VCLXMultiLineEdit::~VCLXMultiLineEdit() // ::com::sun::star::lang::XTypeProvider IMPL_XTYPEPROVIDER_START( VCLXMultiLineEdit ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextComponent>* ) NULL ), - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextArea>* ) NULL ), - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextLayoutConstrains>* ) NULL ), + cppu::UnoType::get(), + cppu::UnoType::get(), + cppu::UnoType::get(), VCLXWindow::getTypes() IMPL_XTYPEPROVIDER_END @@ -557,8 +557,8 @@ VCLXFileControl::~VCLXFileControl() // ::com::sun::star::lang::XTypeProvider IMPL_XTYPEPROVIDER_START( VCLXFileControl ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextComponent>* ) NULL ), - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextLayoutConstrains>* ) NULL ), + cppu::UnoType::get(), + cppu::UnoType::get(), VCLXWindow::getTypes() IMPL_XTYPEPROVIDER_END @@ -1677,7 +1677,7 @@ SVTXNumericField::~SVTXNumericField() // ::com::sun::star::lang::XTypeProvider IMPL_XTYPEPROVIDER_START( SVTXNumericField ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XNumericField>* ) NULL ), + cppu::UnoType::get(), SVTXFormattedField::getTypes() IMPL_XTYPEPROVIDER_END @@ -1844,7 +1844,7 @@ SVTXCurrencyField::~SVTXCurrencyField() // ::com::sun::star::lang::XTypeProvider IMPL_XTYPEPROVIDER_START( SVTXCurrencyField ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XCurrencyField>* ) NULL ), + cppu::UnoType::get(), SVTXFormattedField::getTypes() IMPL_XTYPEPROVIDER_END @@ -2133,7 +2133,7 @@ void VCLXProgressBar::ImplUpdateValue() // ::com::sun::star::lang::XTypeProvider IMPL_XTYPEPROVIDER_START( VCLXProgressBar ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XProgressBar>* ) NULL ), + cppu::UnoType::get(), VCLXWindow::getTypes() IMPL_XTYPEPROVIDER_END diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx index 19ecf56323fc..8e55f446d6ab 100644 --- a/svtools/source/uno/unoimap.cxx +++ b/svtools/source/uno/unoimap.cxx @@ -131,11 +131,11 @@ PropertySetInfo * SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType ) { static PropertyMapEntry const aPolygonObj_Impl[] = { - { OUString("URL"), HANDLE_URL, ::getCppuType((const OUString*)0), 0, 0 }, - { OUString("Title"), HANDLE_TITLE, ::getCppuType((const OUString*)0), 0, 0 }, - { OUString("Description"), HANDLE_DESCRIPTION, ::getCppuType((const OUString*)0), 0, 0 }, - { OUString("Target"), HANDLE_TARGET, ::getCppuType((const OUString*)0), 0, 0 }, - { OUString("Name"), HANDLE_NAME, ::getCppuType((const OUString*)0), 0, 0 }, + { OUString("URL"), HANDLE_URL, cppu::UnoType::get(), 0, 0 }, + { OUString("Title"), HANDLE_TITLE, cppu::UnoType::get(), 0, 0 }, + { OUString("Description"), HANDLE_DESCRIPTION, cppu::UnoType::get(), 0, 0 }, + { OUString("Target"), HANDLE_TARGET, cppu::UnoType::get(), 0, 0 }, + { OUString("Name"), HANDLE_NAME, cppu::UnoType::get(), 0, 0 }, { OUString("IsActive"), HANDLE_ISACTIVE, ::getBooleanCppuType(), 0, 0 }, { OUString("Polygon"), HANDLE_POLYGON, ::getCppuType((const PointSequence*)0), 0, 0 }, { OUString(), 0, css::uno::Type(), 0, 0 } @@ -147,14 +147,14 @@ PropertySetInfo * SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType ) { static PropertyMapEntry const aCircleObj_Impl[] = { - { OUString("URL"), HANDLE_URL, ::getCppuType((const OUString*)0), 0, 0 }, - { OUString("Title"), HANDLE_TITLE, ::getCppuType((const OUString*)0), 0, 0 }, - { OUString("Description"), HANDLE_DESCRIPTION, ::getCppuType((const OUString*)0), 0, 0 }, - { OUString("Target"), HANDLE_TARGET, ::getCppuType((const OUString*)0), 0, 0 }, - { OUString("Name"), HANDLE_NAME, ::getCppuType((const OUString*)0), 0, 0 }, + { OUString("URL"), HANDLE_URL, cppu::UnoType::get(), 0, 0 }, + { OUString("Title"), HANDLE_TITLE, cppu::UnoType::get(), 0, 0 }, + { OUString("Description"), HANDLE_DESCRIPTION, cppu::UnoType::get(), 0, 0 }, + { OUString("Target"), HANDLE_TARGET, cppu::UnoType::get(), 0, 0 }, + { OUString("Name"), HANDLE_NAME, cppu::UnoType::get(), 0, 0 }, { OUString("IsActive"), HANDLE_ISACTIVE, ::getBooleanCppuType(), 0, 0 }, - { OUString("Center"), HANDLE_CENTER, ::getCppuType((const awt::Point*)0), 0, 0 }, - { OUString("Radius"), HANDLE_RADIUS, ::getCppuType((const sal_Int32*)0), 0, 0 }, + { OUString("Center"), HANDLE_CENTER, cppu::UnoType::get(), 0, 0 }, + { OUString("Radius"), HANDLE_RADIUS, cppu::UnoType::get(), 0, 0 }, { OUString(), 0, css::uno::Type(), 0, 0 } }; @@ -165,13 +165,13 @@ PropertySetInfo * SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType ) { static PropertyMapEntry const aRectangleObj_Impl[] = { - { OUString("URL"), HANDLE_URL, ::getCppuType((const OUString*)0), 0, 0 }, - { OUString("Title"), HANDLE_TITLE, ::getCppuType((const OUString*)0), 0, 0 }, - { OUString("Description"), HANDLE_DESCRIPTION, ::getCppuType((const OUString*)0), 0, 0 }, - { OUString("Target"), HANDLE_TARGET, ::getCppuType((const OUString*)0), 0, 0 }, - { OUString("Name"), HANDLE_NAME, ::getCppuType((const OUString*)0), 0, 0 }, + { OUString("URL"), HANDLE_URL, cppu::UnoType::get(), 0, 0 }, + { OUString("Title"), HANDLE_TITLE, cppu::UnoType::get(), 0, 0 }, + { OUString("Description"), HANDLE_DESCRIPTION, cppu::UnoType::get(), 0, 0 }, + { OUString("Target"), HANDLE_TARGET, cppu::UnoType::get(), 0, 0 }, + { OUString("Name"), HANDLE_NAME, cppu::UnoType::get(), 0, 0 }, { OUString("IsActive"), HANDLE_ISACTIVE, ::getBooleanCppuType(), 0, 0 }, - { OUString("Boundary"), HANDLE_BOUNDARY, ::getCppuType((const awt::Rectangle*)0), 0, 0 }, + { OUString("Boundary"), HANDLE_BOUNDARY, cppu::UnoType::get(), 0, 0 }, { OUString(), 0, css::uno::Type(), 0, 0 } }; @@ -350,13 +350,13 @@ uno::Sequence< uno::Type > SAL_CALL SvUnoImageMapObject::getTypes() uno::Sequence< uno::Type > aTypes( 7 ); uno::Type* pTypes = aTypes.getArray(); - *pTypes++ = ::getCppuType((const uno::Reference< XAggregation>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< XEventsSupplier>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< XServiceInfo>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< XPropertySet>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< XMultiPropertySet>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< XTypeProvider>*)0); - *pTypes++ = ::getCppuType((const uno::Reference< XUnoTunnel>*)0); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); return aTypes; } -- cgit