From 7dafe7d3b61060b8e9469594c86ed49e55874c78 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 3 May 2024 10:25:08 +0200 Subject: replace createFromAscii with OUString literals in MultiPropertySetHelper Change-Id: I4b4cef2d7afac3963ab9b3f2fda10d11b754fd00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167165 Reviewed-by: Noel Grandin Tested-by: Jenkins --- xmloff/inc/MultiPropertySetHelper.hxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'xmloff/inc') 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 #include #include +#include namespace com::sun::star { @@ -62,10 +63,7 @@ class XPropertySetInfo; class MultiPropertySetHelper { /// names of all properties - std::unique_ptr pPropertyNames; - - /// length of pPropertyNames array - sal_Int16 nLength; + std::span 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 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; } -- cgit