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 /sw | |
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 'sw')
-rw-r--r-- | sw/source/core/unocore/unoflatpara.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/xml/swxml.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/xml/wrtxml.cxx | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index 806b5f8be55a..5d628d680540 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -79,10 +79,9 @@ SwXFlatParagraph::~SwXFlatParagraph() uno::Reference< beans::XPropertySetInfo > SAL_CALL SwXFlatParagraph::getPropertySetInfo() { - static comphelper::PropertyMapEntry s_Entries[] = { + static const comphelper::PropertyMapEntry s_Entries[] = { { OUString("FieldPositions"), -1, ::cppu::UnoType<uno::Sequence<sal_Int32>>::get(), beans::PropertyAttribute::READONLY, 0 }, { OUString("FootnotePositions"), -1, ::cppu::UnoType<uno::Sequence<sal_Int32>>::get(), beans::PropertyAttribute::READONLY, 0 }, - { OUString(), -1, css::uno::Type(), 0, 0 } }; return new comphelper::PropertySetInfo(s_Entries); } diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index fb6fe1f1d733..7e8731086078 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -518,7 +518,7 @@ ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, con // the user. // create XPropertySet with three properties for status indicator - comphelper::PropertyMapEntry const aInfoMap[] = + static comphelper::PropertyMapEntry const aInfoMap[] = { { OUString("ProgressRange"), 0, ::cppu::UnoType<sal_Int32>::get(), @@ -592,7 +592,6 @@ ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, con beans::PropertyAttribute::MAYBEVOID, 0 }, { OUString("SourceStorage"), 0, cppu::UnoType<embed::XStorage>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 }, - { OUString(), 0, css::uno::Type(), 0, 0 } }; uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index 6c553a6fc567..1ff2b3520282 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -129,7 +129,7 @@ ErrCode SwXMLWriter::Write_(const SfxItemSet* pMediumItemSet) // the user. // create XPropertySet with three properties for status indicator - comphelper::PropertyMapEntry const aInfoMap[] = + static comphelper::PropertyMapEntry const aInfoMap[] = { { OUString("ProgressRange"), 0, ::cppu::UnoType<sal_Int32>::get(), @@ -180,7 +180,6 @@ ErrCode SwXMLWriter::Write_(const SfxItemSet* pMediumItemSet) { OUString("NoEmbDataSet"), 0, cppu::UnoType<bool>::get(), beans::PropertyAttribute::MAYBEVOID, 0 }, - { OUString(), 0, css::uno::Type(), 0, 0 } }; uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( |