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 /chart2 | |
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 'chart2')
-rw-r--r-- | chart2/source/model/filter/XMLFilter.cxx | 45 | ||||
-rw-r--r-- | chart2/source/tools/ErrorBar.cxx | 32 |
2 files changed, 38 insertions, 39 deletions
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx index 8c563b1f1f0a..54ccfaf460f5 100644 --- a/chart2/source/model/filter/XMLFilter.cxx +++ b/chart2/source/model/filter/XMLFilter.cxx @@ -61,7 +61,6 @@ using ::osl::MutexGuard; namespace { #define LOCAL_CONST_STR(i, x) sal_Char const i[sizeof(x)] = x -#define MAP_LEN(x) x, sizeof(x) - 1 LOCAL_CONST_STR( sXML_metaStreamName, "meta.xml"); LOCAL_CONST_STR( sXML_styleStreamName, "styles.xml" ); @@ -340,28 +339,28 @@ sal_Int32 XMLFilter::impl_Import( // create XPropertySet with extra informatio for the filter /** property map for import info set */ - comphelper::PropertyMapEntry aImportInfoMap[] = + comphelper::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( "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("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 }, - { NULL, 0, 0, NULL, 0, 0 } + { OUString(), 0, css::uno::Type(), 0, 0 } }; uno::Reference< beans::XPropertySet > xImportInfo( comphelper::GenericPropertySet_CreateInstance( @@ -614,14 +613,14 @@ sal_Int32 XMLFilter::impl_Export( m_xContext, xStorage ); // property map for export info set - comphelper::PropertyMapEntry aExportInfoMap[] = + comphelper::PropertyMapEntry const aExportInfoMap[] = { - { MAP_LEN("UsePrettyPrinting"), 0, &::getBooleanCppuType(), beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN("BaseURI"), 0, &::getCppuType( (OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN("StreamRelPath"), 0, &::getCppuType( (OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN("StreamName"), 0, &::getCppuType( (OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN("ExportTableNumberList"), 0, &::getBooleanCppuType(), beans::PropertyAttribute::MAYBEVOID, 0 }, - { NULL, 0, 0, NULL, 0, 0 } + { OUString("UsePrettyPrinting"), 0, ::getBooleanCppuType(), beans::PropertyAttribute::MAYBEVOID, 0}, + { OUString("BaseURI"), 0, ::getCppuType( (OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 }, + { OUString("StreamRelPath"), 0, ::getCppuType( (OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 }, + { OUString("StreamName"), 0, ::getCppuType( (OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 }, + { OUString("ExportTableNumberList"), 0, ::getBooleanCppuType(), beans::PropertyAttribute::MAYBEVOID, 0 }, + { OUString(), 0, css::uno::Type(), 0, 0 } }; uno::Reference< beans::XPropertySet > xInfoSet = diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx index 3e305b94506a..277fb866724b 100644 --- a/chart2/source/tools/ErrorBar.cxx +++ b/chart2/source/tools/ErrorBar.cxx @@ -55,22 +55,22 @@ const SfxItemPropertySet* GetErrorBarPropertySet() { static const SfxItemPropertyMapEntry aErrorBarPropertyMap_Impl[] = { - {MAP_CHAR_LEN("ShowPositiveError"),0,&getBooleanCppuType(), 0, 0}, - {MAP_CHAR_LEN("ShowNegativeError"),1,&getBooleanCppuType(), 0, 0}, - {MAP_CHAR_LEN("PositiveError"),2,&getCppuType((const double*)0),0,0}, - {MAP_CHAR_LEN("NegativeError"),3,&getCppuType((const double*)0), 0, 0}, - {MAP_CHAR_LEN("PercentageError"),4,&getCppuType((const double*)0), 0, 0}, - {MAP_CHAR_LEN("ErrorBarStyle"),5,&getCppuType((sal_Int32*)0),0,0}, - {MAP_CHAR_LEN("ErrorBarRangePositive"),6,&getCppuType((OUString*)0),0,0}, // read-only for export - {MAP_CHAR_LEN("ErrorBarRangeNegative"),7,&getCppuType((OUString*)0),0,0}, // read-only for export - {MAP_CHAR_LEN("Weight"),8,&getCppuType((const double*)0),0,0}, - {MAP_CHAR_LEN("LineStyle"),9,&getCppuType((com::sun::star::drawing::LineStyle*)0),0,0}, - {MAP_CHAR_LEN("LineDash"),10,&getCppuType((drawing::LineDash*)0),0,0}, - {MAP_CHAR_LEN("LineWidth"),11,&getCppuType((sal_Int32*)0),0,0}, - {MAP_CHAR_LEN("LineColor"),12,&getCppuType((com::sun::star::util::Color*)0),0,0}, - {MAP_CHAR_LEN("LineTransparence"),13,&getCppuType((sal_Int16*)0),0,0}, - {MAP_CHAR_LEN("LineJoint"),14,&getCppuType((com::sun::star::drawing::LineJoint*)0),0,0}, - {0,0,0,0,0,0} + {OUString("ShowPositiveError"),0,getBooleanCppuType(), 0, 0}, + {OUString("ShowNegativeError"),1,getBooleanCppuType(), 0, 0}, + {OUString("PositiveError"),2,getCppuType((const double*)0),0,0}, + {OUString("NegativeError"),3,getCppuType((const double*)0), 0, 0}, + {OUString("PercentageError"),4,getCppuType((const double*)0), 0, 0}, + {OUString("ErrorBarStyle"),5,getCppuType((sal_Int32*)0),0,0}, + {OUString("ErrorBarRangePositive"),6,getCppuType((OUString*)0),0,0}, // read-only for export + {OUString("ErrorBarRangeNegative"),7,getCppuType((OUString*)0),0,0}, // read-only for export + {OUString("Weight"),8,getCppuType((const double*)0),0,0}, + {OUString("LineStyle"),9,getCppuType((com::sun::star::drawing::LineStyle*)0),0,0}, + {OUString("LineDash"),10,getCppuType((drawing::LineDash*)0),0,0}, + {OUString("LineWidth"),11,getCppuType((sal_Int32*)0),0,0}, + {OUString("LineColor"),12,getCppuType((com::sun::star::util::Color*)0),0,0}, + {OUString("LineTransparence"),13,getCppuType((sal_Int16*)0),0,0}, + {OUString("LineJoint"),14,getCppuType((com::sun::star::drawing::LineJoint*)0),0,0}, + { OUString(), 0, css::uno::Type(), 0, 0 } }; static SfxItemPropertySet aPropSet( aErrorBarPropertyMap_Impl ); return &aPropSet; |