From b09b5f8f7cfd2d7f3125dab93ebe996c160e1e0c Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Thu, 22 May 2014 23:19:05 +0200 Subject: Prefer cppu::UnoType::get() to ::getCppuType((T*)0) part19 Change-Id: Iab50c52a132c90389992ef68c2d31df95a193ab9 --- .../accessibility/AccessibleComponentBase.cxx | 4 +- .../accessibility/AccessibleEditableTextPara.cxx | 10 ++-- editeng/source/items/xmlcnitm.cxx | 4 +- editeng/source/uno/unofield.cxx | 8 +-- editeng/source/uno/unotext.cxx | 68 +++++++++++----------- editeng/source/uno/unotext2.cxx | 46 +++++++-------- editeng/source/xml/xmltxtexp.cxx | 2 +- 7 files changed, 71 insertions(+), 71 deletions(-) (limited to 'editeng') diff --git a/editeng/source/accessibility/AccessibleComponentBase.cxx b/editeng/source/accessibility/AccessibleComponentBase.cxx index a962414409ce..f6215a64aa56 100644 --- a/editeng/source/accessibility/AccessibleComponentBase.cxx +++ b/editeng/source/accessibility/AccessibleComponentBase.cxx @@ -210,9 +210,9 @@ uno::Sequence SAL_CALL uno::Sequence aTypeList (2); // ...and add the additional type for the component. const uno::Type aComponentType = - ::getCppuType((const uno::Reference*)0); + cppu::UnoType::get(); const uno::Type aExtendedComponentType = - ::getCppuType((const uno::Reference*)0); + cppu::UnoType::get(); aTypeList[0] = aComponentType; aTypeList[1] = aExtendedComponentType; diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 0c9e494357d1..f65a39a04771 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -96,8 +96,8 @@ namespace accessibility SVX_UNOEDIT_CHAR_PROPERTIES, SVX_UNOEDIT_PARA_PROPERTIES, SVX_UNOEDIT_NUMBERING_PROPERTIE, - {OUString("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, - {OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, + {OUString("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, cppu::UnoType::get(), 0, 0}, + {OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, cppu::UnoType::get(), 0, 0}, { OUString(), 0, css::uno::Type(), 0, 0 } }; static SvxItemPropertySet aPropSet( aPropMap, EditEngine::GetGlobalItemPool() ); @@ -672,17 +672,17 @@ namespace accessibility uno::Any aRet; // must provide XAccesibleText by hand, since it comes publicly inherited by XAccessibleEditableText - if ( rType == ::getCppuType((uno::Reference< XAccessibleText > *)0) ) + if ( rType == cppu::UnoType::get()) { uno::Reference< XAccessibleText > aAccText = static_cast< XAccessibleEditableText * >(this); aRet <<= aAccText; } - else if ( rType == ::getCppuType((uno::Reference< XAccessibleEditableText > *)0) ) + else if ( rType == cppu::UnoType::get()) { uno::Reference< XAccessibleEditableText > aAccEditText = this; aRet <<= aAccEditText; } - else if ( rType == ::getCppuType((uno::Reference< XAccessibleHypertext > *)0) ) + else if ( rType == cppu::UnoType::get()) { uno::Reference< XAccessibleHypertext > aAccHyperText = this; aRet <<= aAccHyperText; diff --git a/editeng/source/items/xmlcnitm.cxx b/editeng/source/items/xmlcnitm.cxx index ef299ec36ad0..38d24e5c5752 100644 --- a/editeng/source/items/xmlcnitm.cxx +++ b/editeng/source/items/xmlcnitm.cxx @@ -84,7 +84,7 @@ bool SvXMLAttrContainerItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uIn Reference xContainer = new SvUnoAttributeContainer( new SvXMLAttrContainerData( *pImpl ) ); - rVal.setValue( &xContainer, ::getCppuType((Reference*)0) ); + rVal.setValue( &xContainer, cppu::UnoType::get()); return true; } @@ -128,7 +128,7 @@ bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, sal const OUString aName( *pNames++ ); aAny = xContainer->getByName( aName ); - if( aAny.getValue() == NULL || aAny.getValueType() != ::getCppuType((AttributeData*)0) ) + if( aAny.getValue() == NULL || aAny.getValueType() != cppu::UnoType::get() ) return false; pData = (AttributeData*)aAny.getValue(); diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index fd44829e1a56..e84482e707e3 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -540,10 +540,10 @@ uno::Sequence< uno::Type > SAL_CALL SvxUnoTextField::getTypes() maTypeSequence.realloc( nOldCount + 4 ); // !DANGER! keep this updated uno::Type* pTypes = &maTypeSequence.getArray()[nOldCount]; - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextField >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); } return maTypeSequence; } diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 6cfad262f457..f6d95bd09a96 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -88,10 +88,10 @@ const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap() SVX_UNOEDIT_FONT_PROPERTIES, SVX_UNOEDIT_OUTLINER_PROPERTIES, SVX_UNOEDIT_PARA_PROPERTIES, - {OUString("TextField"), EE_FEATURE_FIELD, ::getCppuType((const uno::Reference< text::XTextField >*)0), beans::PropertyAttribute::READONLY, 0 }, + {OUString("TextField"), EE_FEATURE_FIELD, cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 }, {OUString("TextPortionType"), WID_PORTIONTYPE, ::cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 }, - {OUString("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, - {OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, + {OUString("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, cppu::UnoType::get(), 0, 0}, + {OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, cppu::UnoType::get(), 0, 0}, { OUString(), 0, css::uno::Type(), 0, 0 } }; return aSvxTextPortionPropertyMap; @@ -117,8 +117,8 @@ const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap() SVX_UNOEDIT_FONT_PROPERTIES, SVX_UNOEDIT_OUTLINER_PROPERTIES, SVX_UNOEDIT_PARA_PROPERTIES, - {OUString("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, - {OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, + {OUString("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, cppu::UnoType::get(), 0, 0}, + {OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, cppu::UnoType::get(), 0, 0}, { OUString(), 0, css::uno::Type(), 0, 0 } }; @@ -1566,13 +1566,13 @@ uno::Any SAL_CALL SvxUnoTextRange::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException, std::exception) { QUERYINT( text::XTextRange ); - else if( rType == ::getCppuType((const uno::Reference< beans::XMultiPropertyStates >*)0) ) + else if( rType == cppu::UnoType::get()) return uno::makeAny(uno::Reference< beans::XMultiPropertyStates >(this)); - else if( rType == ::getCppuType((const uno::Reference< beans::XPropertySet >*)0) ) + else if( rType == cppu::UnoType::get()) return uno::makeAny(uno::Reference< beans::XPropertySet >(this)); else QUERYINT( beans::XPropertyState ); else QUERYINT( text::XTextRangeCompare ); - else if( rType == ::getCppuType((const uno::Reference< beans::XMultiPropertySet >*)0) ) + else if( rType == cppu::UnoType::get()) return uno::makeAny(uno::Reference< beans::XMultiPropertySet >(this)); else QUERYINT( lang::XServiceInfo ); else QUERYINT( lang::XTypeProvider ); @@ -1613,15 +1613,15 @@ namespace aTypeSequence.realloc( 9 ); // !DANGER! keep this updated uno::Type* pTypes = aTypeSequence.getArray(); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)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(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); return aTypeSequence; } @@ -1693,7 +1693,7 @@ uno::Any SAL_CALL SvxUnoTextBase::queryAggregation( const uno::Type & rType ) { QUERYINT( text::XText ); QUERYINT( text::XSimpleText ); - if( rType == ::getCppuType((const uno::Reference< text::XTextRange >*)0) ) + if( rType == cppu::UnoType::get()) return uno::makeAny(uno::Reference< text::XTextRange >((text::XText*)(this))); QUERYINT(container::XEnumerationAccess ); QUERYINT( container::XElementAccess ); @@ -1728,21 +1728,21 @@ namespace aTypeSequence.realloc( 15 ); // !DANGER! keep this updated uno::Type* pTypes = aTypeSequence.getArray(); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XText >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< container::XEnumerationAccess >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeMover >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextAppend >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextCopy >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XParagraphAppend >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextPortionAppend >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)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(); + *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(); + *pTypes++ = cppu::UnoType::get(); return aTypeSequence; } @@ -2017,7 +2017,7 @@ uno::Reference< container::XEnumeration > SAL_CALL SvxUnoTextBase::createEnumera // XElementAccess ( container::XEnumerationAccess ) uno::Type SAL_CALL SvxUnoTextBase::getElementType( ) throw(uno::RuntimeException, std::exception) { - return ::getCppuType((const uno::Reference< text::XTextRange >*)0 ); + return cppu::UnoType::get(); } sal_Bool SAL_CALL SvxUnoTextBase::hasElements( ) throw(uno::RuntimeException, std::exception) diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index 95201133cd81..5614d76beaba 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -179,17 +179,17 @@ namespace aTypeSequence.realloc( 11 ); // !DANGER! keep this updated uno::Type* pTypes = aTypeSequence.getArray(); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextContent >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< container::XEnumerationAccess >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::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(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); return aTypeSequence; } @@ -274,7 +274,7 @@ uno::Reference< container::XEnumeration > SAL_CALL SvxUnoTextContent::createEnum uno::Type SAL_CALL SvxUnoTextContent::getElementType() throw(uno::RuntimeException, std::exception) { - return ::getCppuType((const uno::Reference< text::XTextRange >*)0); + return cppu::UnoType::get(); } sal_Bool SAL_CALL SvxUnoTextContent::hasElements() @@ -481,7 +481,7 @@ SvxUnoTextCursor::~SvxUnoTextCursor() throw() uno::Any SAL_CALL SvxUnoTextCursor::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException, std::exception) { - if( rType == ::getCppuType((const uno::Reference< text::XTextRange >*)0) ) + if( rType == cppu::UnoType::get()) return uno::makeAny(uno::Reference< text::XTextRange >((text::XText*)(this))); else QUERYINT( text::XTextCursor ); else QUERYINT( beans::XMultiPropertyStates ); @@ -524,16 +524,16 @@ namespace aTypeSequence.realloc( 10 ); // !DANGER! keep this updated uno::Type* pTypes = aTypeSequence.getArray(); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextCursor >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::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(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); + *pTypes++ = cppu::UnoType::get(); return aTypeSequence; } diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx index 65bb17a8533e..324dbccced9e 100644 --- a/editeng/source/xml/xmltxtexp.cxx +++ b/editeng/source/xml/xmltxtexp.cxx @@ -383,7 +383,7 @@ SvxXMLTextExportComponent::SvxXMLTextExportComponent( SVX_UNOEDIT_CHAR_PROPERTIES, SVX_UNOEDIT_FONT_PROPERTIES, // SVX_UNOEDIT_OUTLINER_PROPERTIES, - {OUString(UNO_NAME_NUMBERING_RULES), EE_PARA_NUMBULLET, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace>*)0), 0, 0 }, + {OUString(UNO_NAME_NUMBERING_RULES), EE_PARA_NUMBULLET, cppu::UnoType::get(), 0, 0 }, {OUString(UNO_NAME_NUMBERING), EE_PARA_BULLETSTATE,::getBooleanCppuType(), 0, 0 }, {OUString(UNO_NAME_NUMBERING_LEVEL), EE_PARA_OUTLLEVEL, ::cppu::UnoType::get(), 0, 0 }, SVX_UNOEDIT_PARA_PROPERTIES, -- cgit