summaryrefslogtreecommitdiff
path: root/unotools/source/accessibility/accessiblestatesethelper.cxx
diff options
context:
space:
mode:
authorSascha Ballach <sab@openoffice.org>2002-03-20 06:24:19 +0000
committerSascha Ballach <sab@openoffice.org>2002-03-20 06:24:19 +0000
commit548fee7aedc8455e0ca0e0aa63c41aec6d13b0a5 (patch)
tree9cadba23472246ed39ae94318fade6a019f8e744 /unotools/source/accessibility/accessiblestatesethelper.cxx
parentf47fbf9596720a8ac0821ed043578dd2eb33c82e (diff)
#95584#; compare returns a bool now
Diffstat (limited to 'unotools/source/accessibility/accessiblestatesethelper.cxx')
-rw-r--r--unotools/source/accessibility/accessiblestatesethelper.cxx33
1 files changed, 20 insertions, 13 deletions
diff --git a/unotools/source/accessibility/accessiblestatesethelper.cxx b/unotools/source/accessibility/accessiblestatesethelper.cxx
index e0c21f06268f..9f33b80fbb38 100644
--- a/unotools/source/accessibility/accessiblestatesethelper.cxx
+++ b/unotools/source/accessibility/accessiblestatesethelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: accessiblestatesethelper.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: sab $ $Date: 2002-02-22 14:44:40 $
+ * last change: $Author: sab $ $Date: 2002-03-20 07:24:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -96,7 +96,7 @@ public:
throw (uno::RuntimeException);
void RemoveState(sal_Int16 aState)
throw (uno::RuntimeException);
- void Compare(const AccessibleStateSetHelperImpl* pComparativeValue,
+ sal_Bool Compare(const AccessibleStateSetHelperImpl* pComparativeValue,
AccessibleStateSetHelperImpl* pOldStates,
AccessibleStateSetHelperImpl* pNewStates)
throw (uno::RuntimeException);
@@ -168,24 +168,31 @@ void AccessibleStateSetHelperImpl::RemoveState(sal_Int16 aState)
maStates &= aTempBitSet;
}
-void AccessibleStateSetHelperImpl::Compare(
+sal_Bool AccessibleStateSetHelperImpl::Compare(
const AccessibleStateSetHelperImpl* pComparativeValue,
AccessibleStateSetHelperImpl* pOldStates,
AccessibleStateSetHelperImpl* pNewStates)
throw (uno::RuntimeException)
{
+ sal_Bool bResult(sal_False);
if (pComparativeValue && pOldStates && pNewStates)
{
+ if (maStates == pComparativeValue->maStates)
+ bResult = sal_True;
+ else
+ {
#if 0
- std::bitset<BITFIELDSIZE> aTempBitSet(maStates);
+ std::bitset<BITFIELDSIZE> aTempBitSet(maStates);
#endif
- sal_uInt64 aTempBitSet(maStates);
- aTempBitSet ^= pComparativeValue->maStates;
- pOldStates->maStates = aTempBitSet;
- pOldStates->maStates &= maStates;
- pNewStates->maStates = aTempBitSet;
- pNewStates->maStates &= pComparativeValue->maStates;
+ sal_uInt64 aTempBitSet(maStates);
+ aTempBitSet ^= pComparativeValue->maStates;
+ pOldStates->maStates = aTempBitSet;
+ pOldStates->maStates &= maStates;
+ pNewStates->maStates = aTempBitSet;
+ pNewStates->maStates &= pComparativeValue->maStates;
+ }
}
+ return bResult;
}
@@ -290,14 +297,14 @@ void AccessibleStateSetHelper::RemoveState(sal_Int16 aState)
mpHelperImpl->RemoveState(aState);
}
-void AccessibleStateSetHelper::Compare(
+sal_Bool AccessibleStateSetHelper::Compare(
const AccessibleStateSetHelper& rComparativeValue,
AccessibleStateSetHelper& rOldStates,
AccessibleStateSetHelper& rNewStates)
throw (uno::RuntimeException)
{
::vos::OGuard aGuard (maMutex);
- mpHelperImpl->Compare(rComparativeValue.mpHelperImpl,
+ return mpHelperImpl->Compare(rComparativeValue.mpHelperImpl,
rOldStates.mpHelperImpl, rNewStates.mpHelperImpl);
}