diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-12-11 15:16:51 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-12-12 08:26:40 +0100 |
commit | a62c2a5fa5d5be465b0edab6adeb1fd16ace462f (patch) | |
tree | 47cf29b4b7a0ba3ce321ce628a6b0a6175d978d7 /sd/source/filter/xml/sdxmlwrp.cxx | |
parent | cff72ec4bf87c6484be97d954966309ba7a5eb8a (diff) |
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
Diffstat (limited to 'sd/source/filter/xml/sdxmlwrp.cxx')
-rw-r--r-- | sd/source/filter/xml/sdxmlwrp.cxx | 81 |
1 files changed, 39 insertions, 42 deletions
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index ad14dde7d30f..f62bb1d99f86 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -77,8 +77,6 @@ using namespace comphelper; extern void TransformOOo2xDocument( SdDrawDocument* pDocument ); -#define MAP_LEN(x) x, sizeof(x) - 1 - #define XML_STRING(i, x) sal_Char const i[sizeof(x)] = x XML_STRING( sXML_metaStreamName, "meta.xml"); @@ -443,35 +441,35 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) // ------------------------------------- /** property map for import info set */ - PropertyMapEntry aImportInfoMap[] = + PropertyMapEntry const aImportInfoMap[] = { // necessary properties for XML progress bar at load time - { MAP_LEN( "ProgressRange" ), 0, &::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN( "ProgressMax" ), 0, &::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN( "ProgressCurrent" ), 0, &::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN( "Preview" ), 0, &::getCppuType((const sal_Bool*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN( "PageLayouts" ), 0, &::getCppuType((const uno::Reference< container::XNameAccess >*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN( "PrivateData" ), 0, - &::getCppuType( (Reference<XInterface> *)0 ), + { OUString("ProgressRange"), 0, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, + { OUString("ProgressMax"), 0, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, + { OUString("ProgressCurrent"), 0, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, + { OUString("Preview"), 0, ::getCppuType((const sal_Bool*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, + { OUString("PageLayouts"), 0, ::getCppuType((const uno::Reference< container::XNameAccess >*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, + { OUString("PrivateData"), 0, + ::getCppuType( (Reference<XInterface> *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "BaseURI" ), 0, - &::getCppuType( (OUString *)0 ), + { OUString("BaseURI"), 0, + ::getCppuType( (OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "StreamRelPath" ), 0, - &::getCppuType( (OUString *)0 ), + { OUString("StreamRelPath"), 0, + ::getCppuType( (OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "StreamName" ), 0, - &::getCppuType( (OUString *)0 ), + { OUString("StreamName"), 0, + ::getCppuType( (OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "BuildId" ), 0, - &::getCppuType( (OUString *)0 ), + { OUString("BuildId"), 0, + ::getCppuType( (OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "OrganizerMode" ), 0, - &::getBooleanCppuType(), + { OUString("OrganizerMode"), 0, + ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "SourceStorage" ), 0, &embed::XStorage::static_type(), + { OUString("SourceStorage"), 0, embed::XStorage::static_type(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { NULL, 0, 0, NULL, 0, 0 } + { OUString(), 0, css::uno::Type(), 0, 0 } }; uno::Reference< beans::XPropertySet > xInfoSet( GenericPropertySet_CreateInstance( new PropertySetInfo( aImportInfoMap ) ) ); @@ -822,33 +820,32 @@ sal_Bool SdXMLFilter::Export() uno::Reference< xml::sax::XWriter > xWriter = xml::sax::Writer::create( xContext ); /** property map for export info set */ - PropertyMapEntry aExportInfoMap[] = + PropertyMapEntry const aExportInfoMap[] = { - { MAP_LEN( "ProgressRange" ), 0, &::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN( "ProgressMax" ), 0, &::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN( "ProgressCurrent" ), 0, &::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN( "UsePrettyPrinting"),0, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - - { MAP_LEN( "PageLayoutNames" ), 0, &::getCppuType((const OUString*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN( "BaseURI" ), 0, - &::getCppuType( (OUString *)0 ), + { OUString("ProgressRange"), 0, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, + { OUString("ProgressMax"), 0, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, + { OUString("ProgressCurrent"), 0, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, + { OUString("UsePrettyPrinting"),0, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, + + { OUString("PageLayoutNames"), 0, ::getCppuType((const OUString*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, + { OUString("BaseURI"), 0, + ::getCppuType( (OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "StreamRelPath" ), 0, - &::getCppuType( (OUString *)0 ), + { OUString("StreamRelPath"), 0, + ::getCppuType( (OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "StreamName" ), 0, - &::getCppuType( (OUString *)0 ), + { OUString("StreamName"), 0, + ::getCppuType( (OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "StyleNames" ), 0, - &::getCppuType( (Sequence<OUString>*)0 ), + { OUString("StyleNames"), 0, + ::getCppuType( (Sequence<OUString>*)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "StyleFamilies" ), 0, - &::getCppuType( (Sequence<sal_Int32>*)0 ), + { OUString("StyleFamilies"), 0, + ::getCppuType( (Sequence<sal_Int32>*)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "TargetStorage" ), 0, &embed::XStorage::static_type(), + { OUString("TargetStorage"), 0, embed::XStorage::static_type(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - - { NULL, 0, 0, NULL, 0, 0 } + { OUString(), 0, css::uno::Type(), 0, 0 } }; uno::Reference< beans::XPropertySet > xInfoSet( GenericPropertySet_CreateInstance( new PropertySetInfo( aExportInfoMap ) ) ); |