[Libreoffice-commits] core.git: unotools/source

Arkadiy Illarionov (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 24 07:06:38 UTC 2019


 unotools/source/accessibility/accessiblestatesethelper.cxx |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit 78e2faad8487bea76bd36004a9acc2491b7a72d8
Author:     Arkadiy Illarionov <qarkai at gmail.com>
AuthorDate: Sun Jun 23 19:24:40 2019 +0300
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jun 24 09:05:40 2019 +0200

    Fix AccessibleStateSetHelper::containsAll
    
    Check if all states of the given state set are members
    of this object's state set.
    Previously it checked only last state.
    
    Change-Id: I79ffe54a5783aa1c3574bd099d2ea4bdc49a5c2d
    Reviewed-on: https://gerrit.libreoffice.org/74608
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/unotools/source/accessibility/accessiblestatesethelper.cxx b/unotools/source/accessibility/accessiblestatesethelper.cxx
index fc867063c82d..9a180a4677ad 100644
--- a/unotools/source/accessibility/accessiblestatesethelper.cxx
+++ b/unotools/source/accessibility/accessiblestatesethelper.cxx
@@ -188,16 +188,8 @@ sal_Bool SAL_CALL AccessibleStateSetHelper::containsAll
     (const uno::Sequence<sal_Int16>& rStateSet)
 {
     osl::MutexGuard aGuard (maMutex);
-    sal_Int32 nCount(rStateSet.getLength());
-    const sal_Int16* pStates = rStateSet.getConstArray();
-    sal_Int32 i = 0;
-    bool bFound(true);
-    while (i < nCount)
-    {
-        bFound = mpHelperImpl->Contains(pStates[i]);
-        i++;
-    }
-    return bFound;
+    return std::all_of(rStateSet.begin(), rStateSet.end(),
+        [this](const sal_Int16 nState) { return mpHelperImpl->Contains(nState); });
 }
 
 uno::Sequence<sal_Int16> SAL_CALL AccessibleStateSetHelper::getStates()


More information about the Libreoffice-commits mailing list