diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-04-15 11:59:34 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-04-15 11:59:34 +0000 |
commit | 4eaea01881f8dc86ed66cc4857951607f8b241b8 (patch) | |
tree | 8658a28471f87eb5d65866245fef975d0c08cb12 /unotools/source/accessibility | |
parent | a9c53a4fdff1e1724ea8d8483516827bdd94f80e (diff) |
INTEGRATION: CWS aqua11y01 (1.8.76); FILE MERGED
2008/02/27 09:21:43 fne 1.8.76.2: #i82877# small fix
2008/02/26 10:47:55 fne 1.8.76.1: #i82877# fixed problem with getRelationByType
Diffstat (limited to 'unotools/source/accessibility')
-rw-r--r-- | unotools/source/accessibility/accessiblerelationsethelper.cxx | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/unotools/source/accessibility/accessiblerelationsethelper.cxx b/unotools/source/accessibility/accessiblerelationsethelper.cxx index 6d0f575dbfac..419a072678df 100644 --- a/unotools/source/accessibility/accessiblerelationsethelper.cxx +++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: accessiblerelationsethelper.cxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.10 $ * * This file is part of OpenOffice.org. * @@ -96,17 +96,9 @@ AccessibleRelation AccessibleRelationSetHelperImpl::getRelation( sal_Int32 nInde sal_Bool AccessibleRelationSetHelperImpl::containsRelation( sal_Int16 aRelationType ) throw (uno::RuntimeException) { - sal_Int32 nCount(getRelationCount()); - sal_Int32 i(0); - sal_Bool bFound(sal_False); - while ((i < nCount) && !bFound) - { - if (maRelations[i].RelationType == aRelationType) - bFound = sal_True; - else - i++; - } - return bFound; + AccessibleRelation defaultRelation; // default is INVALID + AccessibleRelation relationByType = getRelationByType(aRelationType); + return relationByType.RelationType != defaultRelation.RelationType; } AccessibleRelation AccessibleRelationSetHelperImpl::getRelationByType( sal_Int16 aRelationType ) @@ -118,11 +110,11 @@ AccessibleRelation AccessibleRelationSetHelperImpl::getRelationByType( sal_Int16 while ((i < nCount) && !bFound) { if (maRelations[i].RelationType == aRelationType) - bFound = sal_True; + return maRelations[i]; else i++; } - return maRelations[i]; + return AccessibleRelation(); } void AccessibleRelationSetHelperImpl::AddRelation(const AccessibleRelation& rRelation) |