diff options
-rw-r--r-- | unotools/inc/unotools/accessiblestatesethelper.hxx | 6 | ||||
-rw-r--r-- | unotools/source/accessibility/accessiblestatesethelper.cxx | 33 |
2 files changed, 23 insertions, 16 deletions
diff --git a/unotools/inc/unotools/accessiblestatesethelper.hxx b/unotools/inc/unotools/accessiblestatesethelper.hxx index 5c0168444b06..ef5eb5ebf6b4 100644 --- a/unotools/inc/unotools/accessiblestatesethelper.hxx +++ b/unotools/inc/unotools/accessiblestatesethelper.hxx @@ -2,9 +2,9 @@ * * $RCSfile: accessiblestatesethelper.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: sab $ $Date: 2002-02-20 12:44:23 $ + * last change: $Author: sab $ $Date: 2002-03-20 07:23:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -180,7 +180,7 @@ public: rNewStates contains after call all states which are in the comparative set and not in the own set. */ - void Compare(const AccessibleStateSetHelper& rComparativeValue, + sal_Bool Compare(const AccessibleStateSetHelper& rComparativeValue, AccessibleStateSetHelper& rOldStates, AccessibleStateSetHelper& rNewStates) throw (::com::sun::star::uno::RuntimeException); 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); } |