summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-23 13:30:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-24 14:02:09 +0200
commit912b8fa62f897fb6fdfd760108d87c4dd468b8ee (patch)
tree963e227f85d29c6cbddff0a1920ad767a8cdeb8c /sc
parentec062c472ad58eafbb4392241119d5b53760120c (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 'sc')
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 3c1e690f3de6..cdf2a53f7b83 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -297,7 +297,7 @@ bool ScXMLImportWrapper::Import( ImportFlags nMode, ErrCode& rError )
uno::Reference<frame::XModel> xModel = mrDocShell.GetModel();
/** property map for export info set */
- comphelper::PropertyMapEntry const aImportInfoMap[] =
+ static comphelper::PropertyMapEntry const aImportInfoMap[] =
{
{ OUString("ProgressRange"), 0, ::cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
{ OUString("ProgressMax"), 0, ::cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
@@ -314,7 +314,6 @@ bool ScXMLImportWrapper::Import( ImportFlags nMode, ErrCode& rError )
{ OUString("SourceStorage"), 0, cppu::UnoType<embed::XStorage>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString(SC_UNO_ODS_LOCK_SOLAR_MUTEX), 0, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString(SC_UNO_ODS_IMPORT_STYLES), 0, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString(), 0, css::uno::Type(), 0, 0 }
};
uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aImportInfoMap ) ) );
@@ -749,7 +748,7 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
}));
/** property map for export info set */
- comphelper::PropertyMapEntry const aExportInfoMap[] =
+ static comphelper::PropertyMapEntry const aExportInfoMap[] =
{
{ OUString("ProgressRange"), 0, ::cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
{ OUString("ProgressMax"), 0, ::cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
@@ -762,7 +761,6 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
{ OUString("StyleNames"), 0, cppu::UnoType<uno::Sequence<OUString>>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("StyleFamilies"), 0, cppu::UnoType<uno::Sequence<sal_Int32>>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("TargetStorage"), 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( new comphelper::PropertySetInfo( aExportInfoMap ) ) );