diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-03 10:25:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-06 08:26:15 +0200 |
commit | 7dafe7d3b61060b8e9469594c86ed49e55874c78 (patch) | |
tree | cb0fff5266785f4cf03046a1418df7e46957c121 /xmloff/inc | |
parent | 3c5424629903299c92f27a35bb287bea824fa007 (diff) |
replace createFromAscii with OUString literals in MultiPropertySetHelper
Change-Id: I4b4cef2d7afac3963ab9b3f2fda10d11b754fd00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167165
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'xmloff/inc')
-rw-r--r-- | xmloff/inc/MultiPropertySetHelper.hxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/xmloff/inc/MultiPropertySetHelper.hxx b/xmloff/inc/MultiPropertySetHelper.hxx index 9d539fa26287..f081e92572da 100644 --- a/xmloff/inc/MultiPropertySetHelper.hxx +++ b/xmloff/inc/MultiPropertySetHelper.hxx @@ -21,6 +21,7 @@ #include <rtl/ustring.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <memory> +#include <span> namespace com::sun::star { @@ -62,10 +63,7 @@ class XPropertySetInfo; class MultiPropertySetHelper { /// names of all properties - std::unique_ptr<OUString[]> pPropertyNames; - - /// length of pPropertyNames array - sal_Int16 nLength; + std::span<const OUString> pPropertyNames; /// the sequence of property names that the current (multi) /// property set implementation supports @@ -85,7 +83,7 @@ class MultiPropertySetHelper css::uno::Any aEmptyAny; public: - MultiPropertySetHelper(const char** pNames); + MultiPropertySetHelper(std::span<const OUString> pNames); ~MultiPropertySetHelper(); @@ -169,7 +167,7 @@ const css::uno::Any& MultiPropertySetHelper::getValue(sal_Int16 nValueNo) { assert(pValues && "called getValue() without calling getValues()"); assert(pSequenceIndex && "called getValue() without calling hasProperties()"); - assert(nValueNo < nLength); + assert(o3tl::make_unsigned(nValueNo) < pPropertyNames.size()); sal_Int16 nIndex = pSequenceIndex[nValueNo]; return (nIndex != -1) ? pValues[nIndex] : aEmptyAny; @@ -178,7 +176,7 @@ const css::uno::Any& MultiPropertySetHelper::getValue(sal_Int16 nValueNo) bool MultiPropertySetHelper::hasProperty(sal_Int16 nValueNo) { assert(pSequenceIndex && "called hasProperty() without calling hasProperties()"); - assert(nValueNo < nLength); + assert(o3tl::make_unsigned(nValueNo) < pPropertyNames.size()); return pSequenceIndex[nValueNo] != -1; } |