diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-23 13:30:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-24 14:02:09 +0200 |
commit | 912b8fa62f897fb6fdfd760108d87c4dd468b8ee (patch) | |
tree | 963e227f85d29c6cbddff0a1920ad767a8cdeb8c /reportdesign/source | |
parent | ec062c472ad58eafbb4392241119d5b53760120c (diff) |
modernize and improve PropertySetInfo
(*) use o3tl::span for the array param, which means we don't need a null
entry to terminate the array
(*) use std::unordered_map to speed things up
(*) mark the array as static at a few more call sites
Change-Id: I05b6cae7552f44459e183ec05cb94e60edb3bfe0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134832
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign/source')
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 3 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlColumn.cxx | 1 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlHelper.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlfilter.cxx | 1 |
4 files changed, 1 insertions, 6 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index e9f5393a5e7c..d6d5e8179d66 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -1309,13 +1309,12 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS } /** property map for export info set */ - comphelper::PropertyMapEntry const aExportInfoMap[] = + static comphelper::PropertyMapEntry const aExportInfoMap[] = { { OUString("UsePrettyPrinting") , 0, cppu::UnoType<sal_Bool>::get(), beans::PropertyAttribute::MAYBEVOID, 0 }, { OUString("StreamName") , 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 }, { OUString("StreamRelPath") , 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 }, { OUString("BaseURI") , 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 }, - { OUString(), 0, css::uno::Type(), 0, 0 } }; uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) ) ); diff --git a/reportdesign/source/filter/xml/xmlColumn.cxx b/reportdesign/source/filter/xml/xmlColumn.cxx index f57c8085f7c5..43464a2766a1 100644 --- a/reportdesign/source/filter/xml/xmlColumn.cxx +++ b/reportdesign/source/filter/xml/xmlColumn.cxx @@ -120,7 +120,6 @@ void OXMLRowColumn::fillStyle(const OUString& _sStyleName) {OUString(PROPERTY_WIDTH), PROPERTY_ID_WIDTH, ::cppu::UnoType<sal_Int32>::get() ,PropertyAttribute::BOUND,0}, {OUString(PROPERTY_HEIGHT), PROPERTY_ID_HEIGHT, ::cppu::UnoType<sal_Int32>::get() ,PropertyAttribute::BOUND,0 }, {OUString(PROPERTY_MINHEIGHT), PROPERTY_ID_MINHEIGHT, ::cppu::UnoType<sal_Int32>::get() ,PropertyAttribute::BOUND,0 }, - {OUString(), 0, css::uno::Type(), 0, 0 } }; pInfo->add(pMap); Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo.get()); diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx index 0f439d7dcb08..491f3e650c39 100644 --- a/reportdesign/source/filter/xml/xmlHelper.cxx +++ b/reportdesign/source/filter/xml/xmlHelper.cxx @@ -271,7 +271,6 @@ void OXMLHelper::copyStyleElements(const bool _bOld,const OUString& _sStyleName, {OUString(PROPERTY_FONTKERNING), PROPERTY_ID_FONTKERNING, cppu::UnoType<decltype(aFont.Kerning)>::get() ,PropertyAttribute::BOUND,0}, {OUString(PROPERTY_CHARWORDMODE), PROPERTY_ID_FONTWORDLINEMODE, cppu::UnoType<decltype(aFont.WordLineMode)>::get() ,PropertyAttribute::BOUND,0}, {OUString(PROPERTY_FONTTYPE), PROPERTY_ID_FONTTYPE, cppu::UnoType<decltype(aFont.Type)>::get() ,PropertyAttribute::BOUND,0}, - { OUString(), 0, css::uno::Type(), 0, 0 } }; try { @@ -321,7 +320,6 @@ uno::Reference<beans::XPropertySet> OXMLHelper::createBorderPropertySet() {OUString(PROPERTY_BORDERRIGHT), 1, cppu::UnoType<table::BorderLine2>::get(),PropertyAttribute::BOUND,0}, {OUString(PROPERTY_BORDERTOP), 2, cppu::UnoType<table::BorderLine2>::get(),PropertyAttribute::BOUND,0}, {OUString(PROPERTY_BORDERBOTTOM), 3, cppu::UnoType<table::BorderLine2>::get(),PropertyAttribute::BOUND,0}, - { OUString(), 0, css::uno::Type(), 0, 0 } }; return comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(pMap)); } diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index 371f0647a1ae..166c8c435caf 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -423,7 +423,6 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) { OUString("PrivateData"),0, cppu::UnoType<XInterface>::get(), beans::PropertyAttribute::MAYBEVOID, 0 }, { OUString("BaseURI"), 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 }, { OUString("StreamRelPath"), 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 }, - { OUString(), 0, css::uno::Type(), 0, 0 } }; utl::MediaDescriptor aDescriptor(rDescriptor); uno::Reference<beans::XPropertySet> xProp = comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(pMap)); |