From 90f91088d238469b4a2262c91de3117ba40f5bde Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 11 Dec 2013 15:16:51 +0100 Subject: Don't hold css::uno::Type instances by pointer ...in comphelper::PropertyMapEntry and SfxItemPropertyMapEntry. And as the arrays of such need to be initialized dynamically anyway, also change their name members to proper OUStrings while at it. Plus some const clean-up. Change-Id: I67d4d7b5773fb020605f369daf39528bec930606 --- .../accessibility/AccessibleEditableTextPara.cxx | 6 +-- editeng/source/uno/unofield.cxx | 50 +++++++++++----------- editeng/source/uno/unoipset.cxx | 8 ++-- editeng/source/uno/unotext.cxx | 16 +++---- editeng/source/xml/xmltxtexp.cxx | 8 ++-- editeng/source/xml/xmltxtimp.cxx | 2 +- 6 files changed, 45 insertions(+), 45 deletions(-) (limited to 'editeng') diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index b041172510c2..a54877b7115a 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -94,9 +94,9 @@ namespace accessibility SVX_UNOEDIT_CHAR_PROPERTIES, SVX_UNOEDIT_PARA_PROPERTIES, SVX_UNOEDIT_NUMBERING_PROPERTIE, - {MAP_CHAR_LEN("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, - {MAP_CHAR_LEN("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, - {0,0,0,0,0,0} + {"TextUserDefinedAttributes", EE_CHAR_XMLATTRIBS, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, + {"ParaUserDefinedAttributes", EE_PARA_XMLATTRIBS, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, + {} }; static SvxItemPropertySet aPropSet( aPropMap, EditEngine::GetGlobalItemPool() ); return &aPropSet; diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index 6c818e2a8566..baf1da9dc3d4 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -71,62 +71,62 @@ const SfxItemPropertySet* ImplGetFieldItemPropertySet( sal_Int32 mnId ) { static const SfxItemPropertyMapEntry aExDateTimeFieldPropertyMap_Impl[] = { - { MAP_CHAR_LEN(UNO_TC_PROP_DATE_TIME), WID_DATE, &::getCppuType((const util::DateTime*)0), 0, 0 }, - { MAP_CHAR_LEN(UNO_TC_PROP_IS_FIXED), WID_BOOL1, &::getBooleanCppuType(), 0, 0 }, - { MAP_CHAR_LEN(UNO_TC_PROP_IS_DATE), WID_BOOL2, &::getBooleanCppuType(), 0, 0 }, - { MAP_CHAR_LEN(UNO_TC_PROP_NUMFORMAT), WID_INT32, &::getCppuType((const sal_Int32*)0), 0, 0 }, - {0,0,0,0,0,0} + { UNO_TC_PROP_DATE_TIME, WID_DATE, ::getCppuType((const util::DateTime*)0), 0, 0 }, + { UNO_TC_PROP_IS_FIXED, WID_BOOL1, ::getBooleanCppuType(), 0, 0 }, + { UNO_TC_PROP_IS_DATE, WID_BOOL2, ::getBooleanCppuType(), 0, 0 }, + { UNO_TC_PROP_NUMFORMAT, WID_INT32, ::getCppuType((const sal_Int32*)0), 0, 0 }, + {} }; static const SfxItemPropertySet aExDateTimeFieldPropertySet_Impl(aExDateTimeFieldPropertyMap_Impl); static const SfxItemPropertyMapEntry aDateTimeFieldPropertyMap_Impl[] = { - { MAP_CHAR_LEN(UNO_TC_PROP_IS_DATE), WID_BOOL2, &::getBooleanCppuType(), 0, 0 }, - {0,0,0,0,0,0} + { UNO_TC_PROP_IS_DATE, WID_BOOL2, ::getBooleanCppuType(), 0, 0 }, + {} }; static const SfxItemPropertySet aDateTimeFieldPropertySet_Impl(aDateTimeFieldPropertyMap_Impl); static const SfxItemPropertyMapEntry aUrlFieldPropertyMap_Impl[] = { - { MAP_CHAR_LEN(UNO_TC_PROP_URL_FORMAT), WID_INT16, &::getCppuType((const sal_Int16*)0), 0, 0 }, - { MAP_CHAR_LEN(UNO_TC_PROP_URL_REPRESENTATION), WID_STRING1, &::getCppuType((const OUString*)0), 0, 0 }, - { MAP_CHAR_LEN(UNO_TC_PROP_URL_TARGET), WID_STRING2, &::getCppuType((const OUString*)0), 0, 0 }, - { MAP_CHAR_LEN(UNO_TC_PROP_URL), WID_STRING3, &::getCppuType((const OUString*)0), 0, 0 }, - {0,0,0,0,0,0} + { UNO_TC_PROP_URL_FORMAT, WID_INT16, ::getCppuType((const sal_Int16*)0), 0, 0 }, + { UNO_TC_PROP_URL_REPRESENTATION, WID_STRING1, ::getCppuType((const OUString*)0), 0, 0 }, + { UNO_TC_PROP_URL_TARGET, WID_STRING2, ::getCppuType((const OUString*)0), 0, 0 }, + { UNO_TC_PROP_URL, WID_STRING3, ::getCppuType((const OUString*)0), 0, 0 }, + {} }; static const SfxItemPropertySet aUrlFieldPropertySet_Impl(aUrlFieldPropertyMap_Impl); static const SfxItemPropertyMapEntry aEmptyPropertyMap_Impl[] = { - {0,0,0,0,0,0} + {} }; static const SfxItemPropertySet aEmptyPropertySet_Impl(aEmptyPropertyMap_Impl); static const SfxItemPropertyMapEntry aExtFileFieldPropertyMap_Impl[] = { - { MAP_CHAR_LEN(UNO_TC_PROP_IS_FIXED), WID_BOOL1, &::getBooleanCppuType(), 0, 0 }, - { MAP_CHAR_LEN(UNO_TC_PROP_FILE_FORMAT), WID_INT16, &::getCppuType((const sal_Int16*)0), 0, 0 }, - { MAP_CHAR_LEN(UNO_TC_PROP_CURRENT_PRESENTATION), WID_STRING1, &::getCppuType((const OUString*)0), 0, 0 }, - {0,0,0,0,0,0} + { UNO_TC_PROP_IS_FIXED, WID_BOOL1, ::getBooleanCppuType(), 0, 0 }, + { UNO_TC_PROP_FILE_FORMAT, WID_INT16, ::getCppuType((const sal_Int16*)0), 0, 0 }, + { UNO_TC_PROP_CURRENT_PRESENTATION, WID_STRING1, ::getCppuType((const OUString*)0), 0, 0 }, + {} }; static const SfxItemPropertySet aExtFileFieldPropertySet_Impl(aExtFileFieldPropertyMap_Impl); static const SfxItemPropertyMapEntry aAuthorFieldPropertyMap_Impl[] = { - { MAP_CHAR_LEN(UNO_TC_PROP_IS_FIXED), WID_BOOL1, &::getBooleanCppuType(), 0, 0 }, - { MAP_CHAR_LEN(UNO_TC_PROP_CURRENT_PRESENTATION), WID_STRING1,&::getCppuType((const OUString*)0), 0, 0 }, - { MAP_CHAR_LEN(UNO_TC_PROP_AUTHOR_CONTENT), WID_STRING2,&::getCppuType((const OUString*)0), 0, 0 }, - { MAP_CHAR_LEN(UNO_TC_PROP_AUTHOR_FORMAT), WID_INT16, &::getCppuType((const sal_Int16*)0), 0, 0 }, - { MAP_CHAR_LEN(UNO_TC_PROP_AUTHOR_FULLNAME), WID_BOOL2, &::getBooleanCppuType(), 0, 0 }, - {0,0,0,0,0,0} + { UNO_TC_PROP_IS_FIXED, WID_BOOL1, ::getBooleanCppuType(), 0, 0 }, + { UNO_TC_PROP_CURRENT_PRESENTATION, WID_STRING1,::getCppuType((const OUString*)0), 0, 0 }, + { UNO_TC_PROP_AUTHOR_CONTENT, WID_STRING2,::getCppuType((const OUString*)0), 0, 0 }, + { UNO_TC_PROP_AUTHOR_FORMAT, WID_INT16, ::getCppuType((const sal_Int16*)0), 0, 0 }, + { UNO_TC_PROP_AUTHOR_FULLNAME, WID_BOOL2, ::getBooleanCppuType(), 0, 0 }, + {} }; static const SfxItemPropertySet aAuthorFieldPropertySet_Impl(aAuthorFieldPropertyMap_Impl); static const SfxItemPropertyMapEntry aMeasureFieldPropertyMap_Impl[] = { - { MAP_CHAR_LEN(UNO_TC_PROP_MEASURE_KIND), WID_INT16, &::getCppuType((const sal_Int16*)0), 0, 0 }, - {0,0,0,0,0,0} + { UNO_TC_PROP_MEASURE_KIND, WID_INT16, ::getCppuType((const sal_Int16*)0), 0, 0 }, + {} }; static const SfxItemPropertySet aMeasureFieldPropertySet_Impl(aMeasureFieldPropertyMap_Impl); diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index ed16db9b4148..fe955ba8d969 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -133,13 +133,13 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* SvxUnoConvertToMM( eMapUnit, aVal ); } } - else if ( pMap->pType->getTypeClass() == uno::TypeClass_ENUM && + else if ( pMap->aType.getTypeClass() == uno::TypeClass_ENUM && aVal.getValueType() == ::getCppuType((const sal_Int32*)0) ) { // convert typeless SfxEnumItem to enum type sal_Int32 nEnum; aVal >>= nEnum; - aVal.setValue( &nEnum, *pMap->pType ); + aVal.setValue( &nEnum, pMap->aType ); } } else @@ -245,13 +245,13 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* } } - if ( pMap->pType->getTypeClass() == uno::TypeClass_ENUM && + if ( pMap->aType.getTypeClass() == uno::TypeClass_ENUM && aVal.getValueType() == ::getCppuType((const sal_Int32*)0) ) { sal_Int32 nEnum; aVal >>= nEnum; - aVal.setValue( &nEnum, *pMap->pType ); + aVal.setValue( &nEnum, pMap->aType ); } return aVal; diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 8a63ef7e3e5c..adfd06f0c84c 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -88,11 +88,11 @@ const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap() SVX_UNOEDIT_FONT_PROPERTIES, SVX_UNOEDIT_OUTLINER_PROPERTIES, SVX_UNOEDIT_PARA_PROPERTIES, - {MAP_CHAR_LEN("TextField"), EE_FEATURE_FIELD, &::getCppuType((const uno::Reference< text::XTextField >*)0), beans::PropertyAttribute::READONLY, 0 }, - {MAP_CHAR_LEN("TextPortionType"), WID_PORTIONTYPE, &::getCppuType((const OUString*)0), beans::PropertyAttribute::READONLY, 0 }, - {MAP_CHAR_LEN("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, - {MAP_CHAR_LEN("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, - {0,0,0,0,0,0} + {"TextField", EE_FEATURE_FIELD, ::getCppuType((const uno::Reference< text::XTextField >*)0), beans::PropertyAttribute::READONLY, 0 }, + {"TextPortionType", WID_PORTIONTYPE, ::getCppuType((const OUString*)0), beans::PropertyAttribute::READONLY, 0 }, + {"TextUserDefinedAttributes", EE_CHAR_XMLATTRIBS, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, + {"ParaUserDefinedAttributes", EE_PARA_XMLATTRIBS, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, + {} }; return aSvxTextPortionPropertyMap; } @@ -117,9 +117,9 @@ const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap() SVX_UNOEDIT_FONT_PROPERTIES, SVX_UNOEDIT_OUTLINER_PROPERTIES, SVX_UNOEDIT_PARA_PROPERTIES, - {MAP_CHAR_LEN("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, - {MAP_CHAR_LEN("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, - {0,0,0,0,0,0} + {"TextUserDefinedAttributes", EE_CHAR_XMLATTRIBS, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, + {"ParaUserDefinedAttributes", EE_PARA_XMLATTRIBS, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, + {} }; return aSvxUnoOutlinerTextCursorPropertyMap; diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx index 6d3523c9ab19..9a8a99c1d78e 100644 --- a/editeng/source/xml/xmltxtexp.cxx +++ b/editeng/source/xml/xmltxtexp.cxx @@ -382,11 +382,11 @@ SvxXMLTextExportComponent::SvxXMLTextExportComponent( SVX_UNOEDIT_CHAR_PROPERTIES, SVX_UNOEDIT_FONT_PROPERTIES, // SVX_UNOEDIT_OUTLINER_PROPERTIES, - {MAP_CHAR_LEN(UNO_NAME_NUMBERING_RULES), EE_PARA_NUMBULLET, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace>*)0), 0, 0 }, - {MAP_CHAR_LEN(UNO_NAME_NUMBERING), EE_PARA_BULLETSTATE,&::getBooleanCppuType(), 0, 0 }, - {MAP_CHAR_LEN(UNO_NAME_NUMBERING_LEVEL), EE_PARA_OUTLLEVEL, &::getCppuType((const sal_Int16*)0), 0, 0 }, + {UNO_NAME_NUMBERING_RULES, EE_PARA_NUMBULLET, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace>*)0), 0, 0 }, + {UNO_NAME_NUMBERING, EE_PARA_BULLETSTATE,::getBooleanCppuType(), 0, 0 }, + {UNO_NAME_NUMBERING_LEVEL, EE_PARA_OUTLLEVEL, ::getCppuType((const sal_Int16*)0), 0, 0 }, SVX_UNOEDIT_PARA_PROPERTIES, - {0,0,0,0,0,0} + {} }; static SvxItemPropertySet aSvxXMLTextExportComponentPropertySet( SvxXMLTextExportComponentPropertyMap, EditEngine::GetGlobalItemPool() ); diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx index 5220dbfdb624..e48203b2fd69 100644 --- a/editeng/source/xml/xmltxtimp.cxx +++ b/editeng/source/xml/xmltxtimp.cxx @@ -147,7 +147,7 @@ void SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& r SVX_UNOEDIT_FONT_PROPERTIES, // SVX_UNOEDIT_OUTLINER_PROPERTIES, SVX_UNOEDIT_PARA_PROPERTIES, - {0,0,0,0,0,0} + {} }; static SvxItemPropertySet aSvxXMLTextImportComponentPropertySet( SvxXMLTextImportComponentPropertyMap, EditEngine::GetGlobalItemPool() ); -- cgit