summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-04-23 09:08:33 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2024-04-23 20:52:49 +0200
commitb97ff95cc2ef4c1da83c5889690b7a703f5c0699 (patch)
tree8eb30d28455c71fc1891bd4789b539e01ea461d5
parent7d13e62c3d468bd249db62cfdde14f28f74b3f59 (diff)
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.weghorn@posteo.de> Tested-by: Jenkins
-rw-r--r--winaccessibility/source/UAccCOM/MAccessible.cxx13
1 files changed, 7 insertions, 6 deletions
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;