diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2022-03-02 11:06:53 +0000 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2022-03-02 20:39:52 +0100 |
commit | c4c1a6e6bfc42dddfa7a7ded826dca37c1d35dce (patch) | |
tree | b4a30cf4a3ae2924d343ed373a8fe026f8c82b96 /winaccessibility/source/UAccCOM | |
parent | 06f19fc07991ee233a870e98a9115deffa8abf6d (diff) |
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>
Diffstat (limited to 'winaccessibility/source/UAccCOM')
-rw-r--r-- | winaccessibility/source/UAccCOM/MAccessible.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index 56542b10028f..3f0253fbed19 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -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); } } } |