winaccessibility/source/UAccCOM/MAccessible.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
New commits: commit 31a4062bc0f3a751d3758a2d9b3ebb4fe9010590 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Apr 23 09:26:34 2024 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Apr 23 20:52:57 2024 +0200 wina11y: Use AccessibleRelationType::MEMBER_OF constant ... instead of hard-coded 7. Change-Id: I2ac44719043c827ce2a65687be021d7f823898d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166505 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index 3f261e9d4bd7..8694ef418bbc 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -1792,7 +1792,7 @@ static XAccessible* getTheParentOfMember(XAccessible* pXAcc) for(sal_Int32 i=0 ; i<nRelations ; i++) { AccessibleRelation accRelation = pRrelationSet->getRelation(i); - if(accRelation.RelationType == 7) + if (accRelation.RelationType == AccessibleRelationType::MEMBER_OF) { Sequence< Reference< XInterface > > xTargets = accRelation.TargetSet; return static_cast<XAccessible*>(xTargets[0].get()); @@ -1861,7 +1861,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_groupPosition(long __RPC_FAR for(int i=0 ; i<nRel ; i++) { AccessibleRelation accRelation = pRrelationSet->getRelation(i); - if(accRelation.RelationType == 7) + if (accRelation.RelationType == AccessibleRelationType::MEMBER_OF) { Sequence< Reference< XInterface > > xTargets = accRelation.TargetSet; commit b97ff95cc2ef4c1da83c5889690b7a703f5c0699 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Apr 23 09:08:33 2024 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Apr 23 20:52:49 2024 +0200 wina11y: Use AccessibleRelationType constants Use `AccessibleRelationType::LABELED_BY` and `AccessibleRelationType::LABEL_FOR` instead of hard-coded numbers 6 and 5. While at it, also rename the misspelt "pRLebelContext" to "xLabelContext". Change-Id: Id4e5cec0f04b9257eb141fd9bac64e7f01fa32ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166504 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index 6c1367185cac..3f261e9d4bd7 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -43,6 +43,7 @@ #include <o3tl/char16_t2wchar_t.hxx> #include <comphelper/AccessibleImplementationHelper.hxx> +#include <com/sun/star/accessibility/AccessibleRelationType.hpp> #include <com/sun/star/accessibility/XAccessibleText.hpp> #include <com/sun/star/accessibility/XAccessibleEditableText.hpp> #include <com/sun/star/accessibility/XAccessibleImage.hpp> @@ -706,7 +707,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT AccessibleRelation accRelation; for(int i=0; i<nRelCount ; i++) { - if( pRrelationSet->getRelation(i).RelationType == 6 ) + if (pRrelationSet->getRelation(i).RelationType == AccessibleRelationType::LABELED_BY) { accRelation = pRrelationSet->getRelation(i); paccRelation = &accRelation; @@ -721,17 +722,17 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT XAccessible* pXAcc = static_cast<XAccessible*>(pRAcc.get()); - Reference<XAccessibleContext> pRLebelContext = pXAcc->getAccessibleContext(); - if(!pRLebelContext.is()) + Reference<XAccessibleContext> xLabelContext = pXAcc->getAccessibleContext(); + if (!xLabelContext.is()) return S_FALSE; - pRrelationSet = pRLebelContext->getAccessibleRelationSet(); + pRrelationSet = xLabelContext->getAccessibleRelationSet(); nRelCount = pRrelationSet->getRelationCount(); paccRelation = nullptr; for(int j=0; j<nRelCount ; j++) { - if( pRrelationSet->getRelation(j).RelationType == 5 ) + if (pRrelationSet->getRelation(j).RelationType == AccessibleRelationType::LABEL_FOR) { accRelation = pRrelationSet->getRelation(j); paccRelation = &accRelation; @@ -746,7 +747,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT return S_FALSE; } - Reference<XAccessibleExtendedComponent> pRXIE(pRLebelContext,UNO_QUERY); + Reference<XAccessibleExtendedComponent> pRXIE(xLabelContext, UNO_QUERY); if(!pRXIE.is()) return S_FALSE;