wina11y: Simplify this loop a bit

Use a range-based for loop, `OUString::isEmpty`
instead of checking the length and
combine the two conditions into one.

Change-Id: Iddc75369b1600f2f540f7ec4a6f8ed0b8462fd93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130841
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2022-03-02 11:06:53 +00:00
parent 06f19fc079
commit c4c1a6e6bf

View File

@@ -2808,14 +2808,11 @@ OUString CMAccessible::get_String4Numbering(const Any& pAny, sal_Int16 numbering
Any aAny = pXIndex->getByIndex(numberingLevel);
Sequence< css::beans::PropertyValue > aProps;
aAny >>= aProps;
const css::beans::PropertyValue* pPropArray = aProps.getConstArray();
sal_Int32 nCount = aProps.getLength();
OUStringBuffer buf("Numbering:NumberingLevel=");
buf.append(sal_Int32(numberingLevel));
buf.append(',');
for( sal_Int32 i=0; i<nCount; i++ )
for (const css::beans::PropertyValue& rProp : aProps)
{
css::beans::PropertyValue rProp = pPropArray[i];
if( (rProp.Name == "BulletChar" ) ||
(rProp.Name == "NumberingType" ))
{
@@ -2825,13 +2822,10 @@ OUString CMAccessible::get_String4Numbering(const Any& pAny, sal_Int16 numbering
buf.append(pTemp);
buf.append(',');
if(rProp.Name == "NumberingType")
if (rProp.Name == "NumberingType" && !numberingPrefix.isEmpty())
{
if(numberingPrefix.getLength()!=0)
{
buf.append("NumberingPrefix=");
buf.append(numberingPrefix);
}
buf.append("NumberingPrefix=");
buf.append(numberingPrefix);
}
}
}