summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-06-23 19:24:40 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-24 09:05:40 +0200
commit78e2faad8487bea76bd36004a9acc2491b7a72d8 (patch)
tree82f161b5938dbb0d59ae34a961e52209f54465f2
parentaf8304f1c49a59a5fec9f16f6d43a5c8d37365af (diff)
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@collabora.co.uk>
-rw-r--r--unotools/source/accessibility/accessiblestatesethelper.cxx12
1 files changed, 2 insertions, 10 deletions
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()