From fa51b556800f332b311786770b3d6e57b65f615c Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 10 May 2014 23:51:21 +0200 Subject: Prefer cppu::UnoType::get() to ::getCppuType((T*)0) part9 Change-Id: I82ed4a4868cb22566706ca0f4b1321e0d45016cf --- xmloff/source/forms/elementimport.cxx | 2 +- xmloff/source/forms/formattributes.cxx | 8 ++++---- xmloff/source/forms/layerimport.cxx | 14 +++++++------- xmloff/source/forms/propertyimport.cxx | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 8f4f34c15088..201291e3012b 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -1674,7 +1674,7 @@ namespace xmloff sal_Int16 nLinkageType = 0; PropertyConversion::convertString( m_rContext.getGlobalContext(), - ::getCppuType( static_cast< sal_Int16* >( NULL ) ), + ::cppu::UnoType::get(), _rValue, OEnumMapper::getEnumMap( OEnumMapper::epListLinkageType ) ) >>= nLinkageType; diff --git a/xmloff/source/forms/formattributes.cxx b/xmloff/source/forms/formattributes.cxx index 40532b561d91..9c61fd906b08 100644 --- a/xmloff/source/forms/formattributes.cxx +++ b/xmloff/source/forms/formattributes.cxx @@ -239,7 +239,7 @@ namespace xmloff const sal_Char* _pAttributeName, const OUString& _rPropertyName, const sal_Char* _pAttributeDefault) { - implAdd(_pAttributeName, _rPropertyName, ::getCppuType( static_cast< OUString* >(NULL) ), + implAdd(_pAttributeName, _rPropertyName, ::cppu::UnoType::get(), _pAttributeDefault ? OUString::createFromAscii(_pAttributeDefault) : OUString()); } @@ -259,7 +259,7 @@ namespace xmloff { OUStringBuffer aDefault; ::sax::Converter::convertNumber(aDefault, (sal_Int32)_nAttributeDefault); - implAdd(_pAttributeName, _rPropertyName, ::getCppuType( static_cast< sal_Int16* >(NULL) ), aDefault.makeStringAndClear()); + implAdd(_pAttributeName, _rPropertyName, ::cppu::UnoType::get(), aDefault.makeStringAndClear()); } void OAttribute2Property::addInt32Property( @@ -268,7 +268,7 @@ namespace xmloff { OUStringBuffer aDefault; ::sax::Converter::convertNumber( aDefault, _nAttributeDefault ); - implAdd( _pAttributeName, _rPropertyName, ::getCppuType( static_cast< sal_Int32* >(NULL) ), aDefault.makeStringAndClear() ); + implAdd( _pAttributeName, _rPropertyName, ::cppu::UnoType::get(), aDefault.makeStringAndClear() ); } void OAttribute2Property::addEnumProperty( @@ -279,7 +279,7 @@ namespace xmloff OUStringBuffer aDefault; SvXMLUnitConverter::convertEnum(aDefault, _nAttributeDefault, _pValueMap); AttributeAssignment& aAssignment = implAdd(_pAttributeName, _rPropertyName, - _pType ? *_pType : ::getCppuType( static_cast< sal_Int32* >(NULL) ), + _pType ? *_pType : ::cppu::UnoType::get(), // this assumes that the setPropertyValue for enums can handle int32's .... aDefault.makeStringAndClear()); aAssignment.pEnumMap = _pValueMap; diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx index 987543644432..3fa697193bf4 100644 --- a/xmloff/source/forms/layerimport.cxx +++ b/xmloff/source/forms/layerimport.cxx @@ -180,15 +180,15 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter) m_aAttributeMetaData.addEnumProperty( OAttributeMetaData::getCommonControlAttributeName( CCA_VISUAL_EFFECT ), PROPERTY_VISUAL_EFFECT, VisualEffect::LOOK3D, OEnumMapper::getEnumMap( OEnumMapper::epVisualEffect ), - &::getCppuType( static_cast< sal_Int16* >( NULL ) ) ); + &::cppu::UnoType::get() ); m_aAttributeMetaData.addEnumProperty( OAttributeMetaData::getCommonControlAttributeName( CCA_ORIENTATION ), PROPERTY_ORIENTATION, ScrollBarOrientation::HORIZONTAL, OEnumMapper::getEnumMap( OEnumMapper::epOrientation ), - &::getCppuType( static_cast< sal_Int32* >( NULL ) ) ); + &::cppu::UnoType::get() ); m_aAttributeMetaData.addEnumProperty( OAttributeMetaData::getCommonControlAttributeName(CCA_BUTTON_TYPE), PROPERTY_BUTTONTYPE, FormButtonType_PUSH, OEnumMapper::getEnumMap(OEnumMapper::epButtonType), - &::getCppuType( static_cast(NULL) )); + &::cppu::UnoType::get()); m_aAttributeMetaData.addEnumProperty( OAttributeMetaData::getDatabaseAttributeName(DA_LIST_SOURCE_TYPE), PROPERTY_LISTSOURCETYPE, ListSourceType_VALUELIST, OEnumMapper::getEnumMap(OEnumMapper::epListSourceType), @@ -196,19 +196,19 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter) m_aAttributeMetaData.addEnumProperty( OAttributeMetaData::getSpecialAttributeName(SCA_STATE), PROPERTY_DEFAULT_STATE, TRISTATE_FALSE, OEnumMapper::getEnumMap(OEnumMapper::epCheckState), - &::getCppuType( static_cast< sal_Int16* >(NULL))); + &::cppu::UnoType::get()); m_aAttributeMetaData.addEnumProperty( OAttributeMetaData::getSpecialAttributeName(SCA_CURRENT_STATE), PROPERTY_STATE, TRISTATE_FALSE, OEnumMapper::getEnumMap(OEnumMapper::epCheckState), - &::getCppuType( static_cast< sal_Int16* >(NULL))); + &::cppu::UnoType::get()); m_aAttributeMetaData.addEnumProperty( OAttributeMetaData::getFormAttributeName(faEnctype), PROPERTY_SUBMIT_ENCODING, FormSubmitEncoding_URL, OEnumMapper::getEnumMap(OEnumMapper::epSubmitEncoding), - &::getCppuType( static_cast(NULL) )); + &::cppu::UnoType::get()); m_aAttributeMetaData.addEnumProperty( OAttributeMetaData::getFormAttributeName(faMethod), PROPERTY_SUBMIT_METHOD, FormSubmitMethod_GET, OEnumMapper::getEnumMap(OEnumMapper::epSubmitMethod), - &::getCppuType( static_cast(NULL) )); + &::cppu::UnoType::get()); m_aAttributeMetaData.addEnumProperty( OAttributeMetaData::getFormAttributeName(faCommandType), PROPERTY_COMMAND_TYPE, CommandType::COMMAND, OEnumMapper::getEnumMap(OEnumMapper::epCommandType)); diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx index 59bb88163d55..50d96efb4c13 100644 --- a/xmloff/source/forms/propertyimport.cxx +++ b/xmloff/source/forms/propertyimport.cxx @@ -242,7 +242,7 @@ Type PropertyConversion::xmlTypeToUnoType( const OUString& _rType ) { s_aTypeNameMap[ token::GetXMLToken( token::XML_BOOLEAN ) ] = ::getBooleanCppuType(); s_aTypeNameMap[ token::GetXMLToken( token::XML_FLOAT ) ] = ::getCppuType( static_cast< double* >(NULL) ); - s_aTypeNameMap[ token::GetXMLToken( token::XML_STRING ) ] = ::getCppuType( static_cast< OUString* >(NULL) ); + s_aTypeNameMap[ token::GetXMLToken( token::XML_STRING ) ] = ::cppu::UnoType::get(); s_aTypeNameMap[ token::GetXMLToken( token::XML_VOID ) ] = ::getVoidCppuType(); } -- cgit