winaccessibility/source/UAccCOM/MAccessible.cxx |   14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit c4c1a6e6bfc42dddfa7a7ded826dca37c1d35dce
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Mar 2 11:06:53 2022 +0000
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Mar 2 20:39:52 2022 +0100

    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.wegh...@posteo.de>

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);
                 }
             }
         }

Reply via email to