loplugin:stringviewparam

Change-Id: If67d685eb930a299587a711eb5f77cbe9fd0ca09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132020
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2022-03-24 08:07:03 +01:00
parent 5ace52e6ae
commit d105539a79
2 changed files with 4 additions and 3 deletions

View file

@ -2796,7 +2796,7 @@ OUString CMAccessible::get_StringFromAny(Any const & pAny)
return OUString();
}
OUString CMAccessible::get_String4Numbering(const Any& pAny, sal_Int16 numberingLevel,const OUString& numberingPrefix)
OUString CMAccessible::get_String4Numbering(const Any& pAny, sal_Int16 numberingLevel,std::u16string_view numberingPrefix)
{
Reference< css::container::XIndexReplace > pXIndex;
if((pAny>>=pXIndex) && (numberingLevel !=-1))//numbering level is -1,means invalid value
@ -2818,7 +2818,7 @@ OUString CMAccessible::get_String4Numbering(const Any& pAny, sal_Int16 numbering
buf.append(pTemp);
buf.append(',');
if (rProp.Name == "NumberingType" && !numberingPrefix.isEmpty())
if (rProp.Name == "NumberingType" && !numberingPrefix.empty())
{
buf.append("NumberingPrefix=");
buf.append(numberingPrefix);

View file

@ -22,6 +22,7 @@
#include "stdafx.h"
#include "Resource.h" // main symbols
#include <map>
#include <string_view>
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
#include <com/sun/star/accessibility/XAccessibleAction.hpp>
@ -229,7 +230,7 @@ public:
static OUString get_StringFromAny(css::uno::Any const & pAny);
static OUString get_String4Numbering(const css::uno::Any& pAny,
sal_Int16 numberingLevel, const OUString& numberingPrefix);
sal_Int16 numberingLevel, std::u16string_view numberingPrefix);
// Helper function for data conversion.
static void ConvertAnyToVariant(const css::uno::Any &rAnyVal,