diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx index 5d8ff5ce4a98..3a2c616cabe4 100644 --- a/accessibility/source/extended/accessiblelistboxentry.cxx +++ b/accessibility/source/extended/accessiblelistboxentry.cxx @@ -466,7 +466,7 @@ namespace accessibility rtl::Reference pRelationSetHelper = new utl::AccessibleRelationSetHelper; Sequence> aSequence { xParent }; pRelationSetHelper->AddRelation( - AccessibleRelation( AccessibleRelationType::NODE_CHILD_OF, aSequence ) ); + AccessibleRelation( AccessibleRelationType_NODE_CHILD_OF, aSequence ) ); xRelSet = pRelationSetHelper; } return xRelSet; diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 8692e5fcd0ff..19867b61fcfb 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -1302,14 +1302,14 @@ Document::retrieveParagraphRelationSet( Paragraph const * pParagraph ) if (nPara > m_nVisibleBegin && nPara < m_nVisibleEnd) { css::uno::Sequence> aSequence { getAccessibleChild(getIter(nPara - 1)) }; - css::accessibility::AccessibleRelation aRelation( css::accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM, aSequence ); + css::accessibility::AccessibleRelation aRelation(css::accessibility::AccessibleRelationType_CONTENT_FLOWS_FROM, aSequence); pRelationSetHelper->AddRelation( aRelation ); } if (nPara >= m_nVisibleBegin && m_nVisibleEnd > 1 && nPara < m_nVisibleEnd - 1) { css::uno::Sequence> aSequence { getAccessibleChild(getIter(nPara + 1)) }; - css::accessibility::AccessibleRelation aRelation( css::accessibility::AccessibleRelationType::CONTENT_FLOWS_TO, aSequence ); + css::accessibility::AccessibleRelation aRelation( css::accessibility::AccessibleRelationType_CONTENT_FLOWS_TO, aSequence ); pRelationSetHelper->AddRelation( aRelation ); } @@ -1374,7 +1374,7 @@ void Document::FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& r if( getAccessibleParent()->getAccessibleContext()->getAccessibleRole() == css::accessibility::AccessibleRole::SCROLL_PANE ) { css::uno::Sequence> aSequence { getAccessibleParent() }; - rRelationSet.AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) ); + rRelationSet.AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType_MEMBER_OF, aSequence ) ); } else { diff --git a/accessibility/source/standard/floatingwindowaccessible.cxx b/accessibility/source/standard/floatingwindowaccessible.cxx index ebfd0c506905..a2ad7f2e5794 100644 --- a/accessibility/source/standard/floatingwindowaccessible.cxx +++ b/accessibility/source/standard/floatingwindowaccessible.cxx @@ -25,8 +25,8 @@ namespace uno = ::com::sun::star::uno; +using namespace com::sun::star::accessibility; using ::com::sun::star::accessibility::AccessibleRelation; -namespace AccessibleRelationType = ::com::sun::star::accessibility::AccessibleRelationType; void FloatingWindowAccessible::FillAccessibleRelationSet(utl::AccessibleRelationSetHelper& rRelationSet) { @@ -37,7 +37,7 @@ void FloatingWindowAccessible::FillAccessibleRelationSet(utl::AccessibleRelation if( pParentWindow ) { uno::Sequence> aSequence { pParentWindow->GetAccessible() }; - rRelationSet.AddRelation( AccessibleRelation( AccessibleRelationType::SUB_WINDOW_OF, aSequence ) ); + rRelationSet.AddRelation(AccessibleRelation(AccessibleRelationType_SUB_WINDOW_OF, aSequence)); } } } diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index ab3c1597caef..4895d929e1cf 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -440,7 +440,7 @@ void VCLXAccessibleList::ProcessWindowEvent (const VclWindowEvent& rVclWindowEve if (m_pListBoxHelper && (m_pListBoxHelper->GetStyle() & WB_DROPDOWN ) != WB_DROPDOWN) { uno::Sequence> aSequence { pBox->GetAccessible() }; - rRelationSet.AddRelation( com::sun::star::accessibility::AccessibleRelation( com::sun::star::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) ); + rRelationSet.AddRelation( com::sun::star::accessibility::AccessibleRelation( com::sun::star::accessibility::AccessibleRelationType_MEMBER_OF, aSequence ) ); } } else diff --git a/accessibility/source/standard/vclxaccessibleradiobutton.cxx b/accessibility/source/standard/vclxaccessibleradiobutton.cxx index 71cc0bc71e16..3e1cd085fdfb 100644 --- a/accessibility/source/standard/vclxaccessibleradiobutton.cxx +++ b/accessibility/source/standard/vclxaccessibleradiobutton.cxx @@ -85,8 +85,8 @@ void VCLXAccessibleRadioButton::FillAccessibleRelationSet( utl::AccessibleRelati aVec.reserve(aGroup.size()); std::transform(aGroup.begin(), aGroup.end(), std::back_inserter(aVec), [](const VclPtr& rxItem) { return rxItem->GetAccessible(); }); - rRelationSet.AddRelation( AccessibleRelation( AccessibleRelationType::MEMBER_OF, - comphelper::containerToSequence(aVec) ) ); + rRelationSet.AddRelation(AccessibleRelation(AccessibleRelationType_MEMBER_OF, + comphelper::containerToSequence(aVec))); } } diff --git a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx index 5e14186b0765..e586e6ae2390 100644 --- a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx +++ b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx @@ -19,11 +19,14 @@ #pragma once #include "TableConnection.hxx" +#include #include #include #include #include +using css::accessibility::AccessibleRelationType; + namespace dbaui { class OTableConnection; @@ -68,8 +71,8 @@ namespace dbaui // XAccessibleRelationSet virtual sal_Int32 SAL_CALL getRelationCount( ) override; virtual css::accessibility::AccessibleRelation SAL_CALL getRelation( sal_Int32 nIndex ) override; - virtual sal_Bool SAL_CALL containsRelation( sal_Int16 aRelationType ) override; - virtual css::accessibility::AccessibleRelation SAL_CALL getRelationByType( sal_Int16 aRelationType ) override; + virtual sal_Bool SAL_CALL containsRelation(AccessibleRelationType eRelationType) override; + virtual css::accessibility::AccessibleRelation SAL_CALL getRelationByType(AccessibleRelationType eRelationType) override; }; } diff --git a/dbaccess/source/ui/inc/TableWindowAccess.hxx b/dbaccess/source/ui/inc/TableWindowAccess.hxx index 09aa268f1e6c..e9de5af64037 100644 --- a/dbaccess/source/ui/inc/TableWindowAccess.hxx +++ b/dbaccess/source/ui/inc/TableWindowAccess.hxx @@ -19,11 +19,14 @@ #pragma once #include "TableWindow.hxx" +#include #include #include #include #include +using css::accessibility::AccessibleRelationType; + namespace dbaui { class OTableWindow; @@ -71,8 +74,8 @@ namespace dbaui // XAccessibleRelationSet virtual sal_Int32 SAL_CALL getRelationCount( ) override; virtual css::accessibility::AccessibleRelation SAL_CALL getRelation( sal_Int32 nIndex ) override; - virtual sal_Bool SAL_CALL containsRelation( sal_Int16 aRelationType ) override; - virtual css::accessibility::AccessibleRelation SAL_CALL getRelationByType( sal_Int16 aRelationType ) override; + virtual sal_Bool SAL_CALL containsRelation(AccessibleRelationType eRelationType) override; + virtual css::accessibility::AccessibleRelation SAL_CALL getRelationByType(AccessibleRelationType eRelationType) override; }; } diff --git a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx index 2815c4696115..34363d470af3 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx @@ -140,15 +140,15 @@ namespace dbaui m_pLine->GetDestWin()->GetAccessible() }; } - return AccessibleRelation(AccessibleRelationType::CONTROLLED_BY,aSeq); + return AccessibleRelation(AccessibleRelationType_CONTROLLED_BY,aSeq); } - sal_Bool SAL_CALL OConnectionLineAccess::containsRelation( sal_Int16 aRelationType ) + sal_Bool SAL_CALL OConnectionLineAccess::containsRelation(AccessibleRelationType eRelationType) { - return AccessibleRelationType::CONTROLLED_BY == aRelationType; + return AccessibleRelationType_CONTROLLED_BY == eRelationType; } - AccessibleRelation SAL_CALL OConnectionLineAccess::getRelationByType( sal_Int16 aRelationType ) + AccessibleRelation SAL_CALL OConnectionLineAccess::getRelationByType(AccessibleRelationType eRelationType) { - if( AccessibleRelationType::CONTROLLED_BY == aRelationType ) + if (AccessibleRelationType_CONTROLLED_BY == eRelationType) return getRelation(0); return AccessibleRelation(); } diff --git a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx index 699c85a9e937..41ff49ea65ed 100644 --- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx @@ -181,20 +181,20 @@ namespace dbaui OJoinTableView* pView = m_pTable->getTableView(); auto aIter = pView->getTableConnections(m_pTable) + nIndex; aRet.TargetSet = { getParentChild(aIter - pView->getTableConnections().begin()) }; - aRet.RelationType = AccessibleRelationType::CONTROLLER_FOR; + aRet.RelationType = AccessibleRelationType_CONTROLLER_FOR; } return aRet; } - sal_Bool SAL_CALL OTableWindowAccess::containsRelation( sal_Int16 aRelationType ) + sal_Bool SAL_CALL OTableWindowAccess::containsRelation(AccessibleRelationType eRelationType) { ::osl::MutexGuard aGuard( m_aMutex ); - return AccessibleRelationType::CONTROLLER_FOR == aRelationType + return AccessibleRelationType_CONTROLLER_FOR == eRelationType && m_pTable && m_pTable->getTableView()->ExistsAConn(m_pTable); } - AccessibleRelation SAL_CALL OTableWindowAccess::getRelationByType( sal_Int16 aRelationType ) + AccessibleRelation SAL_CALL OTableWindowAccess::getRelationByType(AccessibleRelationType eRelationType) { ::osl::MutexGuard aGuard( m_aMutex ); - if( AccessibleRelationType::CONTROLLER_FOR == aRelationType && m_pTable) + if (AccessibleRelationType_CONTROLLER_FOR == eRelationType && m_pTable) { OJoinTableView* pView = m_pTable->getTableView(); const auto& rConnectionList = pView->getTableConnections(); @@ -213,7 +213,7 @@ namespace dbaui } Sequence> aSeq(aRelations.data(), aRelations.size()); - return AccessibleRelation(AccessibleRelationType::CONTROLLER_FOR, aSeq); + return AccessibleRelation(AccessibleRelationType_CONTROLLER_FOR, aSeq); } return AccessibleRelation(); } diff --git a/editeng/source/accessibility/AccessibleContextBase.cxx b/editeng/source/accessibility/AccessibleContextBase.cxx index d904490751f0..64d58a39092e 100644 --- a/editeng/source/accessibility/AccessibleContextBase.cxx +++ b/editeng/source/accessibility/AccessibleContextBase.cxx @@ -132,14 +132,14 @@ void AccessibleContextBase::SetRelationSet ( { // Try to emit some meaningful events indicating differing relations in // both sets. - const std::pair aRelationDescriptors[] = { - { AccessibleRelationType::CONTROLLED_BY, AccessibleEventId::CONTROLLED_BY_RELATION_CHANGED }, - { AccessibleRelationType::CONTROLLER_FOR, AccessibleEventId::CONTROLLER_FOR_RELATION_CHANGED }, - { AccessibleRelationType::LABELED_BY, AccessibleEventId::LABELED_BY_RELATION_CHANGED }, - { AccessibleRelationType::LABEL_FOR, AccessibleEventId::LABEL_FOR_RELATION_CHANGED }, - { AccessibleRelationType::MEMBER_OF, AccessibleEventId::MEMBER_OF_RELATION_CHANGED }, + const std::pair aRelationDescriptors[] = { + { AccessibleRelationType_CONTROLLED_BY, AccessibleEventId::CONTROLLED_BY_RELATION_CHANGED }, + { AccessibleRelationType_CONTROLLER_FOR, AccessibleEventId::CONTROLLER_FOR_RELATION_CHANGED }, + { AccessibleRelationType_LABELED_BY, AccessibleEventId::LABELED_BY_RELATION_CHANGED }, + { AccessibleRelationType_LABEL_FOR, AccessibleEventId::LABEL_FOR_RELATION_CHANGED }, + { AccessibleRelationType_MEMBER_OF, AccessibleEventId::MEMBER_OF_RELATION_CHANGED }, }; - for (const std::pair& rPair : aRelationDescriptors) + for (const std::pair& rPair : aRelationDescriptors) { if (mxRelationSet->containsRelation(rPair.first) != rxNewRelationSet->containsRelation(rPair.first)) diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 94b111004544..26bee59e731d 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -738,8 +738,8 @@ namespace accessibility { uno::Sequence> aSequence { mpParaManager->GetChild( nMyParaIndex - 1 ).first.get() }; - AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_FROM, - aSequence ); + AccessibleRelation aAccRel(AccessibleRelationType_CONTENT_FLOWS_FROM, + aSequence ); pAccRelSetHelper->AddRelation( aAccRel ); } @@ -749,8 +749,8 @@ namespace accessibility { uno::Sequence> aSequence { mpParaManager->GetChild( nMyParaIndex + 1 ).first.get() }; - AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_TO, - aSequence ); + AccessibleRelation aAccRel(AccessibleRelationType_CONTENT_FLOWS_TO, + aSequence ); pAccRelSetHelper->AddRelation( aAccRel ); } diff --git a/include/test/a11y/AccessibilityTools.hxx b/include/test/a11y/AccessibilityTools.hxx index 5235faedd377..10d67f2a5338 100644 --- a/include/test/a11y/AccessibilityTools.hxx +++ b/include/test/a11y/AccessibilityTools.hxx @@ -27,11 +27,14 @@ #include #include +#include #include #include #include #include +using css::accessibility::AccessibleRelationType; + class OOO_DLLPUBLIC_TEST AccessibilityTools { public: @@ -178,7 +181,7 @@ public: static OUString getRoleName(const sal_Int16 role); static OUString getEventIdName(const sal_Int16 event_id); - static OUString getRelationTypeName(const sal_Int16 rel_type); + static OUString getRelationTypeName(AccessibleRelationType rel_type); template static std::string debugString(const css::uno::Reference& x) { diff --git a/include/test/a11y/accessibletestbase.hxx b/include/test/a11y/accessibletestbase.hxx index 6983a9b66d0f..792012e5e22b 100644 --- a/include/test/a11y/accessibletestbase.hxx +++ b/include/test/a11y/accessibletestbase.hxx @@ -77,7 +77,7 @@ protected: static css::uno::Reference getFirstRelationTargetOfType( const css::uno::Reference& xContext, - sal_Int16 relationType); + css::accessibility::AccessibleRelationType relationType); /** * @brief Tries to list all children of an accessible diff --git a/include/unotools/accessiblerelationsethelper.hxx b/include/unotools/accessiblerelationsethelper.hxx index d5adf957e4ef..23d1a5f1f35f 100644 --- a/include/unotools/accessiblerelationsethelper.hxx +++ b/include/unotools/accessiblerelationsethelper.hxx @@ -22,11 +22,14 @@ #include +#include #include #include #include #include +using css::accessibility::AccessibleRelationType; + //= XAccessibleRelationSet helper classes //... namespace utl ....................................................... @@ -77,22 +80,20 @@ public: /** Tests whether the relation set contains a relation matching the specified key. - @param aRelationType - The type of relation to look for in this set of relations. This - has to be one of the constants of - AccessibleRelationType. + @param eRelationType + The type of relation to look for in this set of relations. @return Returns if there is a (at least one) relation of the given type and if there is no such relation in the set. */ - virtual sal_Bool SAL_CALL containsRelation(sal_Int16 aRelationType) override; + virtual sal_Bool SAL_CALL + containsRelation(css::accessibility::AccessibleRelationType eRelationType) override; /** Retrieve and return the relation with the given relation type. - @param aRelationType - The type of the relation to return. This has to be one of the - constants of AccessibleRelationType. + @param eRelationType + The type of the relation to return. @return If a relation with the given type could be found than (a copy @@ -100,7 +101,7 @@ public: type INVALID is returned. */ virtual css::accessibility::AccessibleRelation SAL_CALL - getRelationByType(sal_Int16 aRelationType) override; + getRelationByType(AccessibleRelationType eRelationType) override; /// @throws uno::RuntimeException void AddRelation(const css::accessibility::AccessibleRelation& rRelation); diff --git a/offapi/com/sun/star/accessibility/AccessibleRelation.idl b/offapi/com/sun/star/accessibility/AccessibleRelation.idl index e2228dcea0cf..4c2d45295945 100644 --- a/offapi/com/sun/star/accessibility/AccessibleRelation.idl +++ b/offapi/com/sun/star/accessibility/AccessibleRelation.idl @@ -31,14 +31,13 @@ struct AccessibleRelation { /** Type of the relation. -

Its value has to be one of the constants defined by - AccessibleRelationType. If that value is INVALID then +

If that value is INVALID then the whole relation is regarded as invalid. The content of the TargetSet is then undefined.

@see AccessibleRelationType */ - short RelationType; + ::com::sun::star::accessibility::AccessibleRelationType RelationType; /** Set of objects that are the relation's targets. diff --git a/offapi/com/sun/star/accessibility/AccessibleRelationType.idl b/offapi/com/sun/star/accessibility/AccessibleRelationType.idl index d7e77900359e..03ebf9f2769e 100644 --- a/offapi/com/sun/star/accessibility/AccessibleRelationType.idl +++ b/offapi/com/sun/star/accessibility/AccessibleRelationType.idl @@ -21,70 +21,65 @@ module com { module sun { module star { module accessibility { /** Collection of relation types. -

This list of constants defines the available types of relations that +

This enum defines the available types of relations that are usable by AccessibleRelation.

-

We are using constants instead of a more typesafe enum. The reason - for this is that IDL enums may not be extended. Therefore, in order to - include future extensions to the set of roles we have to use constants - here.

- @since OOo 1.1.2 */ -constants AccessibleRelationType +enum AccessibleRelationType { /** Invalid relation type.

Indicates an invalid relation type. This is used to indicate that a retrieval method could not find a requested relation.

*/ - const short INVALID = 0; + INVALID, /** Content-flows-from relation.

Indicates a content flow between the related objects.

*/ - const short CONTENT_FLOWS_FROM = 1; + CONTENT_FLOWS_FROM, /** Content-flows-to relation.

Indicates a content flow between the related objects.

*/ - const short CONTENT_FLOWS_TO = 2; + CONTENT_FLOWS_TO, /** Controlled-by relation type.

Indicates an object is controlled by one or more target objects.

*/ - const short CONTROLLED_BY = 3; + CONTROLLED_BY, /** Controller-for relation type.

Indicates an object is a controller for one or more target objects.

*/ - const short CONTROLLER_FOR = 4; + CONTROLLER_FOR, /** Label-for relation type.

Indicates an object is a label for one or more target objects.

*/ - const short LABEL_FOR = 5; + LABEL_FOR, /** Labeled-by relation type.

Indicates an object is labeled by one or more target objects.

*/ - const short LABELED_BY = 6; + LABELED_BY, /** Member-of relation type.

Indicates an object is a member of a group of one or more target objects.

*/ - const short MEMBER_OF = 7; + MEMBER_OF, /** Sub-Window-of relation type. @@ -93,7 +88,7 @@ constants AccessibleRelationType window. Note that there is no relation that points the other way, from the parent window to the child window.

*/ - const short SUB_WINDOW_OF = 8; + SUB_WINDOW_OF, /** Node-Child-of relation type. @@ -103,7 +98,7 @@ constants AccessibleRelationType @since OOo 3.0 */ - const short NODE_CHILD_OF = 9; + NODE_CHILD_OF, /** Described-by relation type. @@ -111,7 +106,7 @@ constants AccessibleRelationType @since OOo 3.5 */ - const short DESCRIBED_BY = 10; + DESCRIBED_BY }; }; }; }; }; diff --git a/offapi/com/sun/star/accessibility/XAccessibleRelationSet.idl b/offapi/com/sun/star/accessibility/XAccessibleRelationSet.idl index c58fb38b5a1a..a93258fd9490 100644 --- a/offapi/com/sun/star/accessibility/XAccessibleRelationSet.idl +++ b/offapi/com/sun/star/accessibility/XAccessibleRelationSet.idl @@ -61,29 +61,26 @@ interface XAccessibleRelationSet : ::com::sun::star::uno::XInterface /** Tests whether the relation set contains a relation matching the specified key. - @param aRelationType - The type of relation to look for in this set of relations. This - has to be one of the constants of - AccessibleRelationType. + @param eRelationType + The type of relation to look for in this set of relations. @return Returns `TRUE` if there is a (at least one) relation of the given type and `FALSE` if there is no such relation in the set. */ - boolean containsRelation ([in] short aRelationType); + boolean containsRelation ([in] ::com::sun::star::accessibility::AccessibleRelationType eRelationType); /** Retrieve and return the relation with the given relation type. @param aRelationType - The type of the relation to return. This has to be one of the - constants of AccessibleRelationType. + The type of the relation to return. @return If a relation with the given type could be found than (a copy of) this relation is returned. Otherwise a relation with the type INVALID is returned. */ - AccessibleRelation getRelationByType ([in] short aRelationType); + AccessibleRelation getRelationByType ([in] ::com::sun::star::accessibility::AccessibleRelationType eRelationType); }; }; }; }; }; diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index 89b219a5d411..dd7f189738b9 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -414,7 +414,7 @@ void ScAccessibleCell::FillDependents(utl::AccessibleRelationSetHelper* pRelatio bFound = true; } if (bFound) - AddRelation(aCellIter.GetPos(), AccessibleRelationType::CONTROLLER_FOR, pRelationSet); + AddRelation(aCellIter.GetPos(), AccessibleRelationType_CONTROLLER_FOR, pRelationSet); } } } @@ -432,20 +432,20 @@ void ScAccessibleCell::FillPrecedents(utl::AccessibleRelationSetHelper* pRelatio ScRange aRef; while ( aIter.GetNextRef( aRef ) ) { - AddRelation( aRef, AccessibleRelationType::CONTROLLED_BY, pRelationSet); + AddRelation( aRef, AccessibleRelationType_CONTROLLED_BY, pRelationSet); } } } void ScAccessibleCell::AddRelation(const ScAddress& rCell, - const sal_uInt16 aRelationType, + const AccessibleRelationType eRelationType, utl::AccessibleRelationSetHelper* pRelationSet) { - AddRelation(ScRange(rCell, rCell), aRelationType, pRelationSet); + AddRelation(ScRange(rCell, rCell), eRelationType, pRelationSet); } void ScAccessibleCell::AddRelation(const ScRange& rRange, - const sal_uInt16 aRelationType, + const AccessibleRelationType eRelationType, utl::AccessibleRelationSetHelper* pRelationSet) { uno::Reference < XAccessibleTable > xTable ( getAccessibleParent()->getAccessibleContext(), uno::UNO_QUERY ); @@ -477,7 +477,7 @@ void ScAccessibleCell::AddRelation(const ScRange& rRange, } OSL_ENSURE(nCount == nPos, "something went wrong"); AccessibleRelation aRelation; - aRelation.RelationType = aRelationType; + aRelation.RelationType = eRelationType; aRelation.TargetSet = std::move(aTargetSet); pRelationSet->AddRelation(aRelation); } diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index 166e1482b057..47c15602f174 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -301,7 +301,7 @@ Reference< XAccessibleRelationSet > SAL_CALL ScAccessibleCsvRuler::getAccessible if( xAccObj.is() ) { Sequence> aSeq{ xAccObj }; - pRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType::CONTROLLER_FOR, aSeq ) ); + pRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType_CONTROLLER_FOR, aSeq ) ); } return pRelationSet; @@ -840,7 +840,7 @@ Reference< XAccessibleRelationSet > SAL_CALL ScAccessibleCsvGrid::getAccessibleR if( xAccObj.is() ) { Sequence> aSeq{ xAccObj }; - pRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType::CONTROLLED_BY, aSeq ) ); + pRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType_CONTROLLED_BY, aSeq ) ); } } diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 28b6ed5517a3..29387480a107 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -894,7 +894,7 @@ rtl::Reference ScChildrenShapes::GetRelationSe AccessibleRelation aRelation; aRelation.TargetSet = { Get(pAccShapeData) }; - aRelation.RelationType = AccessibleRelationType::CONTROLLER_FOR; + aRelation.RelationType = AccessibleRelationType_CONTROLLER_FOR; pRelationSet->AddRelation(aRelation); } @@ -1147,7 +1147,7 @@ rtl::Reference ScChildrenShapes::GetRelationSe } AccessibleRelation aRelation; aRelation.TargetSet = { xAccessible }; - aRelation.RelationType = AccessibleRelationType::CONTROLLED_BY; + aRelation.RelationType = AccessibleRelationType_CONTROLLED_BY; pRelationSet->AddRelation(aRelation); } diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx index 06244da2b41e..9a7d2e6809af 100644 --- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx +++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx @@ -518,13 +518,13 @@ uno::Reference< XAccessibleRelationSet > ScAccessibleEditObject::getAccessibleRe if ( pLabeledBy && pLabeledBy != pWindow ) { uno::Sequence> aSequence { pLabeledBy->GetAccessible() }; - rRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType::LABELED_BY, aSequence ) ); + rRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType_LABELED_BY, aSequence ) ); } vcl::Window* pMemberOf = pWindow->GetAccessibleRelationMemberOf(); if ( pMemberOf && pMemberOf != pWindow ) { uno::Sequence< uno::Reference > aSequence { pMemberOf->GetAccessible() }; - rRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType::MEMBER_OF, aSequence ) ); + rRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType_MEMBER_OF, aSequence ) ); } return rRelationSet; } diff --git a/sc/source/ui/inc/AccessibleCell.hxx b/sc/source/ui/inc/AccessibleCell.hxx index db6b4c3944fd..f5c3f8d2821f 100644 --- a/sc/source/ui/inc/AccessibleCell.hxx +++ b/sc/source/ui/inc/AccessibleCell.hxx @@ -22,6 +22,7 @@ #include #include "AccessibleCellBase.hxx" #include "viewdata.hxx" +#include #include #include #include @@ -36,6 +37,8 @@ class ScAccessibleDocument; typedef cppu::ImplHelper1< css::accessibility::XAccessibleExtendedAttributes> ScAccessibleCellAttributeImpl; +using css::accessibility::AccessibleRelationType; + /** @descr This base class provides an implementation of the AccessibleCell service. @@ -152,10 +155,10 @@ private: void FillDependents(utl::AccessibleRelationSetHelper* pRelationSet); void FillPrecedents(utl::AccessibleRelationSetHelper* pRelationSet); void AddRelation(const ScAddress& rCell, - const sal_uInt16 aRelationType, + const AccessibleRelationType eRelationType, ::utl::AccessibleRelationSetHelper* pRelationSet); void AddRelation(const ScRange& rRange, - const sal_uInt16 aRelationType, + const AccessibleRelationType eRelationType, ::utl::AccessibleRelationSetHelper* pRelationSet); bool IsFormulaMode(); bool IsDropdown() const; diff --git a/sd/source/console/PresenterAccessibility.cxx b/sd/source/console/PresenterAccessibility.cxx index 6b100c8d634b..91c5f950bb31 100644 --- a/sd/source/console/PresenterAccessibility.cxx +++ b/sd/source/console/PresenterAccessibility.cxx @@ -210,7 +210,7 @@ public: AccessibleRelationSet(); void AddRelation ( - const sal_Int16 nRelationType, + const AccessibleRelationType eRelationType, const Reference& rxObject); //----- XAccessibleRelationSet -------------------------------------------- @@ -219,9 +219,9 @@ public: virtual AccessibleRelation SAL_CALL getRelation (sal_Int32 nIndex) override; - virtual sal_Bool SAL_CALL containsRelation (sal_Int16 nRelationType) override; + virtual sal_Bool SAL_CALL containsRelation(css::accessibility::AccessibleRelationType eRelationType) override; - virtual AccessibleRelation SAL_CALL getRelationByType (sal_Int16 nRelationType) override; + virtual AccessibleRelation SAL_CALL getRelationByType(AccessibleRelationType eRelationType) override; private: ::std::vector maRelations; @@ -1193,11 +1193,11 @@ AccessibleRelationSet::AccessibleRelationSet() } void AccessibleRelationSet::AddRelation ( - const sal_Int16 nRelationType, + const AccessibleRelationType eRelationType, const Reference& rxObject) { maRelations.emplace_back(); - maRelations.back().RelationType = nRelationType; + maRelations.back().RelationType = eRelationType; maRelations.back().TargetSet = { rxObject }; } @@ -1216,16 +1216,16 @@ AccessibleRelation SAL_CALL AccessibleRelationSet::getRelation (sal_Int32 nIndex return maRelations[nIndex]; } -sal_Bool SAL_CALL AccessibleRelationSet::containsRelation (sal_Int16 nRelationType) +sal_Bool SAL_CALL AccessibleRelationSet::containsRelation(AccessibleRelationType eRelationType) { return std::any_of(maRelations.begin(), maRelations.end(), - [nRelationType](const AccessibleRelation& rRelation) { return rRelation.RelationType == nRelationType; }); + [eRelationType](const AccessibleRelation& rRelation) { return rRelation.RelationType == eRelationType; }); } -AccessibleRelation SAL_CALL AccessibleRelationSet::getRelationByType (sal_Int16 nRelationType) +AccessibleRelation SAL_CALL AccessibleRelationSet::getRelationByType(AccessibleRelationType eRelationType) { auto iRelation = std::find_if(maRelations.begin(), maRelations.end(), - [nRelationType](const AccessibleRelation& rRelation) { return rRelation.RelationType == nRelationType; }); + [eRelationType](const AccessibleRelation& rRelation) { return rRelation.RelationType == eRelationType; }); if (iRelation != maRelations.end()) return *iRelation; return AccessibleRelation(); @@ -1260,12 +1260,12 @@ Reference SAL_CALL { if (mnParagraphIndex>0) pSet->AddRelation( - AccessibleRelationType::CONTENT_FLOWS_FROM, + AccessibleRelationType_CONTENT_FLOWS_FROM, xParentContext->getAccessibleChild(mnParagraphIndex-1)); if (mnParagraphIndexgetAccessibleChildCount()-1) pSet->AddRelation( - AccessibleRelationType::CONTENT_FLOWS_TO, + AccessibleRelationType_CONTENT_FLOWS_TO, xParentContext->getAccessibleChild(mnParagraphIndex+1)); } } diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index ed04609bbfbd..a98cf6d184fd 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++ b/svx/source/accessibility/AccessibleControlShape.cxx @@ -554,11 +554,11 @@ Reference< XAccessibleRelationSet > SAL_CALL AccessibleControlShape::getAccessib css::uno::Sequence> aSequence { xAcc }; if( getAccessibleRole() == AccessibleRole::RADIO_BUTTON ) { - pRelationSetHelper->AddRelation( AccessibleRelation( AccessibleRelationType::MEMBER_OF, aSequence ) ); + pRelationSetHelper->AddRelation( AccessibleRelation( AccessibleRelationType_MEMBER_OF, aSequence ) ); } else { - pRelationSetHelper->AddRelation( AccessibleRelation( AccessibleRelationType::LABELED_BY, aSequence ) ); + pRelationSetHelper->AddRelation( AccessibleRelation( AccessibleRelationType_LABELED_BY, aSequence ) ); } } return pRelationSetHelper; diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 91dc32a2ec48..7f3eb9986fe6 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -364,7 +364,7 @@ uno::Reference SAL_CALL if(aSequence[0]) { pRelationSet->AddRelation( - AccessibleRelation( AccessibleRelationType::DESCRIBED_BY, aSequence ) ); + AccessibleRelation(AccessibleRelationType_DESCRIBED_BY, aSequence)); } return pRelationSet; } diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index cd0f879ee0b1..b081c03a1e08 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -481,7 +481,7 @@ Reference SAL_CALL SvxRectCtlChildAccessibleContext::get if( mxParent.is() ) { uno::Sequence> aSequence { mxParent }; - pRelationSetHelper->AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) ); + pRelationSetHelper->AddRelation(css::accessibility::AccessibleRelation(css::accessibility::AccessibleRelationType_MEMBER_OF, aSequence)); } return pRelationSetHelper; diff --git a/sw/qa/extras/accessibility/accessible_relation_set.cxx b/sw/qa/extras/accessibility/accessible_relation_set.cxx index 29f6961859ab..378a588a8e01 100644 --- a/sw/qa/extras/accessibility/accessible_relation_set.cxx +++ b/sw/qa/extras/accessibility/accessible_relation_set.cxx @@ -109,13 +109,13 @@ void AccessibleRelationSet::contents_flows_to_and_from() { CPPUNIT_ASSERT_EQUAL_MESSAGE("didn't gain correct count of relations", sal_Int32(1), set->getRelationCount()); - sal_Int16 firstrelation = set->getRelation(0).RelationType; + AccessibleRelationType firstrelation = set->getRelation(0).RelationType; css::uno::Reference adummy( set->getRelation(0).TargetSet[0], uno::UNO_QUERY_THROW); atarget = adummy; CPPUNIT_ASSERT_EQUAL_MESSAGE("didn't gain correct relation type for paragraph 0", AccessibilityTools::getRelationTypeName( - accessibility::AccessibleRelationType::CONTENT_FLOWS_TO), + accessibility::AccessibleRelationType_CONTENT_FLOWS_TO), AccessibilityTools::getRelationTypeName(firstrelation)); css::uno::Reference paraText2(para2, @@ -129,23 +129,23 @@ void AccessibleRelationSet::contents_flows_to_and_from() css::uno::Reference set2 = oObj2->getAccessibleRelationSet(); - sal_Int16 relationtypes[2] = { accessibility::AccessibleRelationType::INVALID, - accessibility::AccessibleRelationType::INVALID }; + AccessibleRelationType relationtypes[2] = { accessibility::AccessibleRelationType_INVALID, + accessibility::AccessibleRelationType_INVALID }; css::uno::Reference atargets[2]; if (set2.is()) { CPPUNIT_ASSERT_EQUAL_MESSAGE("didn't gain correct count of relations", sal_Int32(2), set2->getRelationCount()); - sal_Int16 tmprelation = set2->getRelation(0).RelationType; - if (tmprelation == accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM) + AccessibleRelationType tmprelation = set2->getRelation(0).RelationType; + if (tmprelation == accessibility::AccessibleRelationType_CONTENT_FLOWS_FROM) { css::uno::Reference adummy( set2->getRelation(0).TargetSet[0], uno::UNO_QUERY_THROW); atargets[0] = adummy; relationtypes[0] = tmprelation; } - else if (tmprelation == accessibility::AccessibleRelationType::CONTENT_FLOWS_TO) + else if (tmprelation == accessibility::AccessibleRelationType_CONTENT_FLOWS_TO) { css::uno::Reference adummy( set2->getRelation(0).TargetSet[0], uno::UNO_QUERY_THROW); @@ -157,14 +157,14 @@ void AccessibleRelationSet::contents_flows_to_and_from() CPPUNIT_FAIL("didn't gain correct relation type"); } tmprelation = set2->getRelation(1).RelationType; - if (tmprelation == accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM) + if (tmprelation == accessibility::AccessibleRelationType_CONTENT_FLOWS_FROM) { css::uno::Reference adummy( set2->getRelation(1).TargetSet[0], uno::UNO_QUERY_THROW); atargets[0] = adummy; relationtypes[0] = tmprelation; } - else if (tmprelation == accessibility::AccessibleRelationType::CONTENT_FLOWS_TO) + else if (tmprelation == accessibility::AccessibleRelationType_CONTENT_FLOWS_TO) { css::uno::Reference adummy( set2->getRelation(1).TargetSet[0], uno::UNO_QUERY_THROW); @@ -179,7 +179,7 @@ void AccessibleRelationSet::contents_flows_to_and_from() CPPUNIT_ASSERT_EQUAL_MESSAGE("didn't gain correct relation type for paragraph 1", AccessibilityTools::getRelationTypeName( - accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM), + accessibility::AccessibleRelationType_CONTENT_FLOWS_FROM), AccessibilityTools::getRelationTypeName(relationtypes[0])); css::uno::Reference paraText1(para1, uno::UNO_QUERY_THROW); @@ -188,7 +188,7 @@ void AccessibleRelationSet::contents_flows_to_and_from() CPPUNIT_ASSERT_EQUAL_MESSAGE("didn't gain correct relation type for paragraph 3", AccessibilityTools::getRelationTypeName( - accessibility::AccessibleRelationType::CONTENT_FLOWS_TO), + accessibility::AccessibleRelationType_CONTENT_FLOWS_TO), AccessibilityTools::getRelationTypeName(relationtypes[1])); css::uno::Reference paraText3(para3, uno::UNO_QUERY_THROW); diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 1a5634124777..f945d792e660 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -756,8 +756,7 @@ uno::Reference SAL_CALL SwAccessibleParagraph::getAccess if ( pPrevContentFrame ) { uno::Sequence> aSequence { GetMap()->GetContext(pPrevContentFrame) }; - AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_FROM, - aSequence ); + AccessibleRelation aAccRel(AccessibleRelationType_CONTENT_FLOWS_FROM, aSequence); pHelper->AddRelation( aAccRel ); } @@ -765,8 +764,7 @@ uno::Reference SAL_CALL SwAccessibleParagraph::getAccess if ( pNextContentFrame ) { uno::Sequence> aSequence { GetMap()->GetContext(pNextContentFrame) }; - AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_TO, - aSequence ); + AccessibleRelation aAccRel(AccessibleRelationType_CONTENT_FLOWS_TO, aSequence); pHelper->AddRelation( aAccRel ); } } diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx index 39c44120bb99..c9eaf34dd94d 100644 --- a/sw/source/core/access/acctextframe.cxx +++ b/sw/source/core/access/acctextframe.cxx @@ -269,10 +269,10 @@ SwFlyFrame* SwAccessibleTextFrame::getFlyFrame() const return pFlyFrame; } -AccessibleRelation SwAccessibleTextFrame::makeRelation( sal_Int16 nType, const SwFlyFrame* pFrame ) +AccessibleRelation SwAccessibleTextFrame::makeRelation(AccessibleRelationType eType, const SwFlyFrame* pFrame ) { uno::Sequence> aSequence { GetMap()->GetContext(pFrame) }; - return AccessibleRelation( nType, aSequence ); + return AccessibleRelation(eType, aSequence); } uno::Reference SAL_CALL SwAccessibleTextFrame::getAccessibleRelationSet( ) @@ -291,12 +291,12 @@ uno::Reference SAL_CALL SwAccessibleTextFrame::getAccess const SwFlyFrame* pPrevFrame = pFlyFrame->GetPrevLink(); if( pPrevFrame != nullptr ) pHelper->AddRelation( makeRelation( - AccessibleRelationType::CONTENT_FLOWS_FROM, pPrevFrame ) ); + AccessibleRelationType_CONTENT_FLOWS_FROM, pPrevFrame ) ); const SwFlyFrame* pNextFrame = pFlyFrame->GetNextLink(); if( pNextFrame != nullptr ) pHelper->AddRelation( makeRelation( - AccessibleRelationType::CONTENT_FLOWS_TO, pNextFrame ) ); + AccessibleRelationType_CONTENT_FLOWS_TO, pNextFrame ) ); return pHelper; } diff --git a/sw/source/core/access/acctextframe.hxx b/sw/source/core/access/acctextframe.hxx index 036e1e85d326..699877954b2d 100644 --- a/sw/source/core/access/acctextframe.hxx +++ b/sw/source/core/access/acctextframe.hxx @@ -104,7 +104,7 @@ private: SwFlyFrame* getFlyFrame() const; css::accessibility::AccessibleRelation makeRelation( - sal_Int16 nType, const SwFlyFrame* pFrame ); + css::accessibility::AccessibleRelationType eType, const SwFlyFrame* pFrame); public: virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet> SAL_CALL getAccessibleRelationSet() override; diff --git a/test/source/a11y/AccessibilityTools.cxx b/test/source/a11y/AccessibilityTools.cxx index 4c01d1674b6a..e972836198c7 100644 --- a/test/source/a11y/AccessibilityTools.cxx +++ b/test/source/a11y/AccessibilityTools.cxx @@ -620,34 +620,35 @@ OUString AccessibilityTools::getEventIdName(const sal_Int16 event_id) return unknownName(event_id); } -OUString AccessibilityTools::getRelationTypeName(const sal_Int16 rel_type) +OUString AccessibilityTools::getRelationTypeName(AccessibleRelationType rel_type) { switch (rel_type) { - case accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM: + case accessibility::AccessibleRelationType_CONTENT_FLOWS_FROM: return u"CONTENT_FLOWS_FROM"_ustr; - case accessibility::AccessibleRelationType::CONTENT_FLOWS_TO: + case accessibility::AccessibleRelationType_CONTENT_FLOWS_TO: return u"CONTENT_FLOWS_TO"_ustr; - case accessibility::AccessibleRelationType::CONTROLLED_BY: + case accessibility::AccessibleRelationType_CONTROLLED_BY: return u"CONTROLLED_BY"_ustr; - case accessibility::AccessibleRelationType::CONTROLLER_FOR: + case accessibility::AccessibleRelationType_CONTROLLER_FOR: return u"CONTROLLER_FOR"_ustr; - case accessibility::AccessibleRelationType::DESCRIBED_BY: + case accessibility::AccessibleRelationType_DESCRIBED_BY: return u"DESCRIBED_BY"_ustr; - case accessibility::AccessibleRelationType::INVALID: + case accessibility::AccessibleRelationType_INVALID: return u"INVALID"_ustr; - case accessibility::AccessibleRelationType::LABELED_BY: + case accessibility::AccessibleRelationType_LABELED_BY: return u"LABELED_BY"_ustr; - case accessibility::AccessibleRelationType::LABEL_FOR: + case accessibility::AccessibleRelationType_LABEL_FOR: return u"LABEL_FOR"_ustr; - case accessibility::AccessibleRelationType::MEMBER_OF: + case accessibility::AccessibleRelationType_MEMBER_OF: return u"MEMBER_OF"_ustr; - case accessibility::AccessibleRelationType::NODE_CHILD_OF: + case accessibility::AccessibleRelationType_NODE_CHILD_OF: return u"NODE_CHILD_OF"_ustr; - case accessibility::AccessibleRelationType::SUB_WINDOW_OF: + case accessibility::AccessibleRelationType_SUB_WINDOW_OF: return u"SUB_WINDOW_OF"_ustr; + default: + return unknownName(static_cast(rel_type)); } - return unknownName(rel_type); } OUString AccessibilityTools::debugName(accessibility::XAccessibleContext* ctx) diff --git a/test/source/a11y/accessibletestbase.cxx b/test/source/a11y/accessibletestbase.cxx index 6a5d2e39e630..38d07312c990 100644 --- a/test/source/a11y/accessibletestbase.cxx +++ b/test/source/a11y/accessibletestbase.cxx @@ -117,14 +117,14 @@ test::AccessibleTestBase::getPreviousFlowingSibling( const uno::Reference& xContext) { return getFirstRelationTargetOfType(xContext, - accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM); + accessibility::AccessibleRelationType_CONTENT_FLOWS_FROM); } uno::Reference test::AccessibleTestBase::getNextFlowingSibling( const uno::Reference& xContext) { return getFirstRelationTargetOfType(xContext, - accessibility::AccessibleRelationType::CONTENT_FLOWS_TO); + accessibility::AccessibleRelationType_CONTENT_FLOWS_TO); } /* Care has to be taken not to walk sideways as the relation is also used @@ -234,7 +234,8 @@ OUString test::AccessibleTestBase::collectText( uno::Reference test::AccessibleTestBase::getFirstRelationTargetOfType( - const uno::Reference& xContext, sal_Int16 relationType) + const uno::Reference& xContext, + css::accessibility::AccessibleRelationType relationType) { auto relset = xContext->getAccessibleRelationSet(); @@ -281,7 +282,7 @@ void test::AccessibleTestBase::dumpA11YTree( const auto& rel = xRelSet->getRelation(i); std::cout << "(type=" << AccessibilityTools::getRelationTypeName(rel.RelationType) - << " (" << rel.RelationType << ")"; + << " (" << static_cast(rel.RelationType) << ")"; std::cout << " targets=["; int j = 0; for (const uno::Reference& xTarget : rel.TargetSet) diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index 65b6f665d7cd..b53e56bf5921 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -394,21 +394,21 @@ void VCLXAccessibleComponent::FillAccessibleRelationSet( utl::AccessibleRelation if ( pLabeledBy && pLabeledBy != pWindow ) { uno::Sequence> aSequence { pLabeledBy->GetAccessible() }; - rRelationSet.AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::LABELED_BY, aSequence ) ); + rRelationSet.AddRelation(accessibility::AccessibleRelation(accessibility::AccessibleRelationType_LABELED_BY, aSequence)); } vcl::Window* pLabelFor = pWindow->GetAccessibleRelationLabelFor(); if ( pLabelFor && pLabelFor != pWindow ) { uno::Sequence> aSequence { pLabelFor->GetAccessible() }; - rRelationSet.AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::LABEL_FOR, aSequence ) ); + rRelationSet.AddRelation(accessibility::AccessibleRelation(accessibility::AccessibleRelationType_LABEL_FOR, aSequence)); } vcl::Window* pMemberOf = pWindow->GetAccessibleRelationMemberOf(); if ( pMemberOf && pMemberOf != pWindow ) { uno::Sequence> aSequence { pMemberOf->GetAccessible() }; - rRelationSet.AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) ); + rRelationSet.AddRelation(accessibility::AccessibleRelation(accessibility::AccessibleRelationType_MEMBER_OF, aSequence)); } } diff --git a/toolkit/test/accessibility/tools/NameProvider.java b/toolkit/test/accessibility/tools/NameProvider.java index 7a859fcea626..b2b40c7d303b 100644 --- a/toolkit/test/accessibility/tools/NameProvider.java +++ b/toolkit/test/accessibility/tools/NameProvider.java @@ -75,24 +75,22 @@ public class NameProvider /** Return the name of the specified relation. - @param nRelation - Id of the relation for which to return its name. This is one of - the ids listed in the AccessibleRelationType - constants group. + @param eRelation + Id of the relation for which to return its name. @return Returns the name of the specified relation type or an empty - string if an invalid / unknown role id was given. + string if an invalid / unknown relation type id was given. */ - public static String getRelationName (int nRelation) + public static String getRelationName (AccessibleRelationType eRelation) { - return maRelationMap.get (Integer.valueOf(nRelation)); + return maRelationMap.get(eRelation); } private static HashMap maStateMap = new HashMap(); private static HashMap maEventMap = new HashMap(); private static HashMap maRoleMap = new HashMap(); - private static HashMap maRelationMap = new HashMap(); + private static HashMap maRelationMap = new HashMap(); static { maStateMap.put (Integer.valueOf(AccessibleStateType.INVALID), "INVALID"); @@ -264,14 +262,14 @@ public class NameProvider maRoleMap.put (Integer.valueOf(AccessibleRole.VIEW_PORT), "VIEW_PORT"); maRoleMap.put (Integer.valueOf(AccessibleRole.WINDOW), "WINDOW"); - maRelationMap.put (Integer.valueOf(AccessibleRelationType.INVALID), "INVALID"); - maRelationMap.put (Integer.valueOf(AccessibleRelationType.CONTENT_FLOWS_FROM), "CONTENT_FLOWS_FROM"); - maRelationMap.put (Integer.valueOf(AccessibleRelationType.CONTENT_FLOWS_TO), "CONTENT_FLOWS_TO"); - maRelationMap.put (Integer.valueOf(AccessibleRelationType.CONTROLLED_BY), "CONTROLLED_BY"); - maRelationMap.put (Integer.valueOf(AccessibleRelationType.CONTROLLER_FOR), "CONTROLLER_FOR"); - maRelationMap.put (Integer.valueOf(AccessibleRelationType.LABEL_FOR), "LABEL_FOR"); - maRelationMap.put (Integer.valueOf(AccessibleRelationType.LABELED_BY), "LABELED_BY"); - maRelationMap.put (Integer.valueOf(AccessibleRelationType.MEMBER_OF), "MEMBER_OF"); - maRelationMap.put (Integer.valueOf(AccessibleRelationType.SUB_WINDOW_OF), "SUB_WINDOW_OF"); + maRelationMap.put (AccessibleRelationType.INVALID, "INVALID"); + maRelationMap.put (AccessibleRelationType.CONTENT_FLOWS_FROM, "CONTENT_FLOWS_FROM"); + maRelationMap.put (AccessibleRelationType.CONTENT_FLOWS_TO, "CONTENT_FLOWS_TO"); + maRelationMap.put (AccessibleRelationType.CONTROLLED_BY, "CONTROLLED_BY"); + maRelationMap.put (AccessibleRelationType.CONTROLLER_FOR, "CONTROLLER_FOR"); + maRelationMap.put (AccessibleRelationType.LABEL_FOR, "LABEL_FOR"); + maRelationMap.put (AccessibleRelationType.LABELED_BY, "LABELED_BY"); + maRelationMap.put (AccessibleRelationType.MEMBER_OF, "MEMBER_OF"); + maRelationMap.put (AccessibleRelationType.SUB_WINDOW_OF, "SUB_WINDOW_OF"); } } diff --git a/unotools/source/accessibility/accessiblerelationsethelper.cxx b/unotools/source/accessibility/accessiblerelationsethelper.cxx index 3bd58454462f..f5624cd1be3e 100644 --- a/unotools/source/accessibility/accessiblerelationsethelper.cxx +++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx @@ -30,11 +30,11 @@ using namespace ::com::sun::star::accessibility; namespace { - AccessibleRelation lcl_getRelationByType( std::vector& raRelations, sal_Int16 aRelationType ) + AccessibleRelation lcl_getRelationByType( std::vector& raRelations, AccessibleRelationType eRelationType) { for (const auto& aRelation: raRelations) { - if (aRelation.RelationType == aRelationType) + if (aRelation.RelationType == eRelationType) return aRelation; } return AccessibleRelation(); @@ -114,32 +114,31 @@ sal_Int32 SAL_CALL given type and if there is no such relation in the set. */ sal_Bool SAL_CALL - AccessibleRelationSetHelper::containsRelation( sal_Int16 aRelationType ) + AccessibleRelationSetHelper::containsRelation(AccessibleRelationType eRelationType) { std::scoped_lock aGuard (maMutex); AccessibleRelation defaultRelation; // default is INVALID - AccessibleRelation relationByType = lcl_getRelationByType(maRelations, aRelationType); + AccessibleRelation relationByType = lcl_getRelationByType(maRelations, eRelationType); return relationByType.RelationType != defaultRelation.RelationType; } /** Retrieve and return the relation with the given relation type. - @param aRelationType - The type of the relation to return. This has to be one of the - constants of AccessibleRelationType. + @param eRelationType + The type of the relation to return. @return - If a relation with the given type could be found than (a copy + If a relation with the given type could be found, then (a copy of) this relation is returned. Otherwise a relation with the type INVALID is returned. */ AccessibleRelation SAL_CALL - AccessibleRelationSetHelper::getRelationByType( sal_Int16 aRelationType ) + AccessibleRelationSetHelper::getRelationByType(AccessibleRelationType eRelationType) { std::scoped_lock aGuard (maMutex); - return lcl_getRelationByType(maRelations, aRelationType); + return lcl_getRelationByType(maRelations, eRelationType); } void AccessibleRelationSetHelper::AddRelation(const AccessibleRelation& rRelation) diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm index e05e951e81c9..d268d8668143 100644 --- a/vcl/osx/a11ywrapper.mm +++ b/vcl/osx/a11ywrapper.mm @@ -206,8 +206,8 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { Reference < XAccessibleRelationSet > rxAccessibleRelationSet = [ self accessibleContext ] -> getAccessibleRelationSet(); if( rxAccessibleRelationSet.is() ) { - AccessibleRelation relationMemberOf = rxAccessibleRelationSet -> getRelationByType ( AccessibleRelationType::MEMBER_OF ); - if ( relationMemberOf.RelationType == AccessibleRelationType::MEMBER_OF && relationMemberOf.TargetSet.hasElements() ) + AccessibleRelation relationMemberOf = rxAccessibleRelationSet -> getRelationByType ( AccessibleRelationType_MEMBER_OF ); + if ( relationMemberOf.RelationType == AccessibleRelationType_MEMBER_OF && relationMemberOf.TargetSet.hasElements() ) return relationMemberOf.TargetSet[0]; } return Reference < XAccessible > (); @@ -341,8 +341,8 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { if ( mActsAsRadioGroup ) { NSMutableArray * children = [ [ NSMutableArray alloc ] init ]; Reference < XAccessibleRelationSet > rxAccessibleRelationSet = [ self accessibleContext ] -> getAccessibleRelationSet(); - AccessibleRelation const relationMemberOf = rxAccessibleRelationSet -> getRelationByType ( AccessibleRelationType::MEMBER_OF ); - if ( relationMemberOf.RelationType == AccessibleRelationType::MEMBER_OF && relationMemberOf.TargetSet.hasElements() ) { + AccessibleRelation const relationMemberOf = rxAccessibleRelationSet -> getRelationByType ( AccessibleRelationType_MEMBER_OF ); + if ( relationMemberOf.RelationType == AccessibleRelationType_MEMBER_OF && relationMemberOf.TargetSet.hasElements() ) { for (Reference const & rMateAccessible : relationMemberOf.TargetSet ) { if ( rMateAccessible.is() ) { Reference< XAccessibleContext > rMateAccessibleContext( rMateAccessible -> getAccessibleContext() ); @@ -677,8 +677,8 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { NSString * title = [ self titleAttribute ]; id titleElement = nil; if ( [ title length ] == 0 ) { - AccessibleRelation relationLabeledBy = [ self accessibleContext ] -> getAccessibleRelationSet() -> getRelationByType ( AccessibleRelationType::LABELED_BY ); - if ( relationLabeledBy.RelationType == AccessibleRelationType::LABELED_BY && relationLabeledBy.TargetSet.hasElements() ) { + AccessibleRelation relationLabeledBy = [ self accessibleContext ] -> getAccessibleRelationSet() -> getRelationByType ( AccessibleRelationType_LABELED_BY ); + if ( relationLabeledBy.RelationType == AccessibleRelationType_LABELED_BY && relationLabeledBy.TargetSet.hasElements() ) { Reference rxAccessible = relationLabeledBy.TargetSet[0]; titleElement = [ AquaA11yFactory wrapperForAccessibleContext: rxAccessible -> getAccessibleContext() ]; } @@ -692,8 +692,8 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { -(id)servesAsTitleForUIElementsAttribute { if ( [ self accessibleContext ] -> getAccessibleRelationSet().is() ) { id titleForElement = nil; - AccessibleRelation relationLabelFor = [ self accessibleContext ] -> getAccessibleRelationSet() -> getRelationByType ( AccessibleRelationType::LABEL_FOR ); - if ( relationLabelFor.RelationType == AccessibleRelationType::LABEL_FOR && relationLabelFor.TargetSet.hasElements() ) { + AccessibleRelation relationLabelFor = [ self accessibleContext ] -> getAccessibleRelationSet() -> getRelationByType ( AccessibleRelationType_LABEL_FOR ); + if ( relationLabelFor.RelationType == AccessibleRelationType_LABEL_FOR && relationLabelFor.TargetSet.hasElements() ) { Reference rxAccessible = relationLabelFor.TargetSet[0]; titleForElement = [ AquaA11yFactory wrapperForAccessibleContext: rxAccessible -> getAccessibleContext() ]; } @@ -839,10 +839,10 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { if ( title && ! [ title isEqualToString: @"" ] ) { [ attributeNames addObject: NSAccessibilityTitleAttribute ]; } - if ( [ title length ] == 0 && rxRelationSet.is() && rxRelationSet -> containsRelation ( AccessibleRelationType::LABELED_BY ) ) { + if ( [ title length ] == 0 && rxRelationSet.is() && rxRelationSet -> containsRelation ( AccessibleRelationType_LABELED_BY ) ) { [ attributeNames addObject: NSAccessibilityTitleUIElementAttribute ]; } - if ( rxRelationSet.is() && rxRelationSet -> containsRelation ( AccessibleRelationType::LABEL_FOR ) ) { + if ( rxRelationSet.is() && rxRelationSet -> containsRelation ( AccessibleRelationType_LABEL_FOR ) ) { [ attributeNames addObject: NSAccessibilityServesAsTitleForUIElementsAttribute ]; } // Special Attributes depending on interface @@ -1156,9 +1156,9 @@ static Reference < XAccessibleContext > hitTestRunner ( css::awt::Point point, if ( [ element isKindOfClass: [ SalFrameWindow class ] ] && [ self isViewElement: element hitByPoint: point ] ) { // we have a child window that is hit Reference < XAccessibleRelationSet > relationSet = [ static_cast(element) accessibleContext ] -> getAccessibleRelationSet(); - if ( relationSet.is() && relationSet -> containsRelation ( AccessibleRelationType::SUB_WINDOW_OF )) { + if ( relationSet.is() && relationSet -> containsRelation ( AccessibleRelationType_SUB_WINDOW_OF )) { // we have a valid relation to the parent element - AccessibleRelation const relation = relationSet -> getRelationByType ( AccessibleRelationType::SUB_WINDOW_OF ); + AccessibleRelation const relation = relationSet -> getRelationByType ( AccessibleRelationType_SUB_WINDOW_OF ); for (Reference const & rxAccessible : relation.TargetSet) { if ( rxAccessible.is() && rxAccessible -> getAccessibleContext().is() ) { // hit test for children of parent diff --git a/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx b/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx index 527a5e73fdda..904788594242 100644 --- a/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx +++ b/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx @@ -194,33 +194,33 @@ static AtspiStateType mapAtspiState(sal_Int64 nState) } } -static AtspiRelationType mapRelationType(sal_Int16 nRelation) +static AtspiRelationType mapRelationType(AccessibleRelationType eRelation) { - switch (nRelation) + switch (eRelation) { - case accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM: + case accessibility::AccessibleRelationType_CONTENT_FLOWS_FROM: return ATSPI_RELATION_FLOWS_FROM; - case accessibility::AccessibleRelationType::CONTENT_FLOWS_TO: + case accessibility::AccessibleRelationType_CONTENT_FLOWS_TO: return ATSPI_RELATION_FLOWS_TO; - case accessibility::AccessibleRelationType::CONTROLLED_BY: + case accessibility::AccessibleRelationType_CONTROLLED_BY: return ATSPI_RELATION_CONTROLLED_BY; - case accessibility::AccessibleRelationType::CONTROLLER_FOR: + case accessibility::AccessibleRelationType_CONTROLLER_FOR: return ATSPI_RELATION_CONTROLLER_FOR; - case accessibility::AccessibleRelationType::DESCRIBED_BY: + case accessibility::AccessibleRelationType_DESCRIBED_BY: return ATSPI_RELATION_DESCRIBED_BY; - case accessibility::AccessibleRelationType::LABEL_FOR: + case accessibility::AccessibleRelationType_LABEL_FOR: return ATSPI_RELATION_LABEL_FOR; - case accessibility::AccessibleRelationType::LABELED_BY: + case accessibility::AccessibleRelationType_LABELED_BY: return ATSPI_RELATION_LABELLED_BY; - case accessibility::AccessibleRelationType::MEMBER_OF: + case accessibility::AccessibleRelationType_MEMBER_OF: return ATSPI_RELATION_MEMBER_OF; - case accessibility::AccessibleRelationType::SUB_WINDOW_OF: + case accessibility::AccessibleRelationType_SUB_WINDOW_OF: return ATSPI_RELATION_SUBWINDOW_OF; - case accessibility::AccessibleRelationType::NODE_CHILD_OF: + case accessibility::AccessibleRelationType_NODE_CHILD_OF: return ATSPI_RELATION_NODE_CHILD_OF; + default: + return ATSPI_RELATION_NULL; } - - return ATSPI_RELATION_NULL; } static std::string debugString(const Atspi::Accessible& pAtspiAccessible) @@ -470,13 +470,13 @@ CPPUNIT_TEST_FIXTURE(Atspi2TestTree, Test1) CPPUNIT_ASSERT(xLODocFirstChild.is()); CPPUNIT_ASSERT( !getFirstRelationTargetOfType(xLODocFirstChild->getAccessibleContext(), - accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM)); + accessibility::AccessibleRelationType_CONTENT_FLOWS_FROM)); const auto nLODocChildCount = xLODocContext->getAccessibleChildCount(); const auto xLODocLastChild = xLODocContext->getAccessibleChild(nLODocChildCount - 1); CPPUNIT_ASSERT(xLODocLastChild.is()); CPPUNIT_ASSERT( !getFirstRelationTargetOfType(xLODocLastChild->getAccessibleContext(), - accessibility::AccessibleRelationType::CONTENT_FLOWS_TO)); + accessibility::AccessibleRelationType_CONTENT_FLOWS_TO)); // END HACK auto xContext = getWindowAccessibleContext(); diff --git a/vcl/qa/cppunit/a11y/atspi2/atspi2text.cxx b/vcl/qa/cppunit/a11y/atspi2/atspi2text.cxx index a711ba16e15f..ac25e1414003 100644 --- a/vcl/qa/cppunit/a11y/atspi2/atspi2text.cxx +++ b/vcl/qa/cppunit/a11y/atspi2/atspi2text.cxx @@ -938,7 +938,7 @@ sal_Int64 Atspi2TestTree::swChildIndex(uno::Reference= QT_VERSION_CHECK(6, 6, 0) - case AccessibleRelationType::CONTENT_FLOWS_FROM: + case AccessibleRelationType_CONTENT_FLOWS_FROM: return QAccessible::FlowsTo; - case AccessibleRelationType::CONTENT_FLOWS_TO: + case AccessibleRelationType_CONTENT_FLOWS_TO: return QAccessible::FlowsFrom; #endif - case AccessibleRelationType::CONTROLLED_BY: + case AccessibleRelationType_CONTROLLED_BY: return QAccessible::Controller; - case AccessibleRelationType::CONTROLLER_FOR: + case AccessibleRelationType_CONTROLLER_FOR: return QAccessible::Controlled; #if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0) - case AccessibleRelationType::DESCRIBED_BY: + case AccessibleRelationType_DESCRIBED_BY: return QAccessible::DescriptionFor; #endif - case AccessibleRelationType::LABELED_BY: + case AccessibleRelationType_LABELED_BY: return QAccessible::Label; - case AccessibleRelationType::LABEL_FOR: + case AccessibleRelationType_LABEL_FOR: return QAccessible::Labelled; - case AccessibleRelationType::INVALID: - case AccessibleRelationType::MEMBER_OF: - case AccessibleRelationType::SUB_WINDOW_OF: - case AccessibleRelationType::NODE_CHILD_OF: + case AccessibleRelationType_INVALID: + case AccessibleRelationType_MEMBER_OF: + case AccessibleRelationType_SUB_WINDOW_OF: + case AccessibleRelationType_NODE_CHILD_OF: default: - SAL_WARN("vcl.qt", "Unmatched relation: " << relationType); + SAL_WARN("vcl.qt", "Unmatched relation: " << static_cast(eRelationType)); return {}; } } diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index f0092dd7e558..256586f6b732 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -6308,7 +6308,7 @@ a11yrelationset SalInstanceDrawingArea::get_accessible_relation_set() pLabeledBy->GetAccessible() }; pRelationSetHelper->AddRelation(css::accessibility::AccessibleRelation( - css::accessibility::AccessibleRelationType::LABELED_BY, aSequence)); + css::accessibility::AccessibleRelationType_LABELED_BY, aSequence)); } vcl::Window* pMemberOf = pWindow->GetAccessibleRelationMemberOf(); if (pMemberOf && pMemberOf != pWindow) @@ -6317,7 +6317,7 @@ a11yrelationset SalInstanceDrawingArea::get_accessible_relation_set() pMemberOf->GetAccessible() }; pRelationSetHelper->AddRelation(css::accessibility::AccessibleRelation( - css::accessibility::AccessibleRelationType::MEMBER_OF, aSequence)); + css::accessibility::AccessibleRelationType_MEMBER_OF, aSequence)); } } return pRelationSetHelper; diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx index a16d1afe0559..4cff5dd6c176 100644 --- a/vcl/unx/gtk3/a11y/atkwrapper.cxx +++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx @@ -61,45 +61,45 @@ using namespace ::com::sun::star; static GObjectClass *parent_class = nullptr; -static AtkRelationType mapRelationType( sal_Int16 nRelation ) +static AtkRelationType mapRelationType(accessibility::AccessibleRelationType eRelation) { AtkRelationType type = ATK_RELATION_NULL; - switch( nRelation ) + switch (eRelation) { - case accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM: + case accessibility::AccessibleRelationType_CONTENT_FLOWS_FROM: type = ATK_RELATION_FLOWS_FROM; break; - case accessibility::AccessibleRelationType::CONTENT_FLOWS_TO: + case accessibility::AccessibleRelationType_CONTENT_FLOWS_TO: type = ATK_RELATION_FLOWS_TO; break; - case accessibility::AccessibleRelationType::CONTROLLED_BY: + case accessibility::AccessibleRelationType_CONTROLLED_BY: type = ATK_RELATION_CONTROLLED_BY; break; - case accessibility::AccessibleRelationType::CONTROLLER_FOR: + case accessibility::AccessibleRelationType_CONTROLLER_FOR: type = ATK_RELATION_CONTROLLER_FOR; break; - case accessibility::AccessibleRelationType::LABEL_FOR: + case accessibility::AccessibleRelationType_LABEL_FOR: type = ATK_RELATION_LABEL_FOR; break; - case accessibility::AccessibleRelationType::LABELED_BY: + case accessibility::AccessibleRelationType_LABELED_BY: type = ATK_RELATION_LABELLED_BY; break; - case accessibility::AccessibleRelationType::MEMBER_OF: + case accessibility::AccessibleRelationType_MEMBER_OF: type = ATK_RELATION_MEMBER_OF; break; - case accessibility::AccessibleRelationType::SUB_WINDOW_OF: + case accessibility::AccessibleRelationType_SUB_WINDOW_OF: type = ATK_RELATION_SUBWINDOW_OF; break; - case accessibility::AccessibleRelationType::NODE_CHILD_OF: + case accessibility::AccessibleRelationType_NODE_CHILD_OF: type = ATK_RELATION_NODE_CHILD_OF; break; diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx index 1f864eaed960..dff2f3b49d2f 100644 --- a/vcl/unx/gtk4/a11y.cxx +++ b/vcl/unx/gtk4/a11y.cxx @@ -410,25 +410,25 @@ static void applyRelations(LoAccessible* pLoAccessible, css::accessibility::AccessibleRelation aRelation = xRelationSet->getRelation(i); switch (aRelation.RelationType) { - case css::accessibility::AccessibleRelationType::CONTENT_FLOWS_TO: + case css::accessibility::AccessibleRelationType_CONTENT_FLOWS_TO: eGtkRelation = GTK_ACCESSIBLE_RELATION_FLOW_TO; break; - case css::accessibility::AccessibleRelationType::CONTROLLER_FOR: + case css::accessibility::AccessibleRelationType_CONTROLLER_FOR: eGtkRelation = GTK_ACCESSIBLE_RELATION_CONTROLS; break; - case css::accessibility::AccessibleRelationType::DESCRIBED_BY: + case css::accessibility::AccessibleRelationType_DESCRIBED_BY: eGtkRelation = GTK_ACCESSIBLE_RELATION_DESCRIBED_BY; break; - case css::accessibility::AccessibleRelationType::LABELED_BY: + case css::accessibility::AccessibleRelationType_LABELED_BY: eGtkRelation = GTK_ACCESSIBLE_RELATION_LABELLED_BY; break; - case css::accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM: - case css::accessibility::AccessibleRelationType::CONTROLLED_BY: - case css::accessibility::AccessibleRelationType::INVALID: - case css::accessibility::AccessibleRelationType::LABEL_FOR: - case css::accessibility::AccessibleRelationType::MEMBER_OF: - case css::accessibility::AccessibleRelationType::NODE_CHILD_OF: - case css::accessibility::AccessibleRelationType::SUB_WINDOW_OF: + case css::accessibility::AccessibleRelationType_CONTENT_FLOWS_FROM: + case css::accessibility::AccessibleRelationType_CONTROLLED_BY: + case css::accessibility::AccessibleRelationType_INVALID: + case css::accessibility::AccessibleRelationType_LABEL_FOR: + case css::accessibility::AccessibleRelationType_MEMBER_OF: + case css::accessibility::AccessibleRelationType_NODE_CHILD_OF: + case css::accessibility::AccessibleRelationType_SUB_WINDOW_OF: // GTK has no equivalent for these continue; default: diff --git a/winaccessibility/source/UAccCOM/AccRelation.cxx b/winaccessibility/source/UAccCOM/AccRelation.cxx index 20bfa20ffa97..649ea8a21b33 100644 --- a/winaccessibility/source/UAccCOM/AccRelation.cxx +++ b/winaccessibility/source/UAccCOM/AccRelation.cxx @@ -192,31 +192,31 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::put_XSubInterface(hyper pXSubInt return S_OK; } -const wchar_t* CAccRelation::mapToIA2RelationType(sal_Int16 nUnoRelationType) +const wchar_t* CAccRelation::mapToIA2RelationType(AccessibleRelationType eUnoRelationType) { - switch (nUnoRelationType) + switch (eUnoRelationType) { - case AccessibleRelationType::CONTENT_FLOWS_FROM: + case AccessibleRelationType_CONTENT_FLOWS_FROM: return IA2_RELATION_FLOWS_FROM; - case AccessibleRelationType::CONTENT_FLOWS_TO: + case AccessibleRelationType_CONTENT_FLOWS_TO: return IA2_RELATION_FLOWS_TO; - case AccessibleRelationType::CONTROLLED_BY: + case AccessibleRelationType_CONTROLLED_BY: return IA2_RELATION_CONTROLLED_BY; - case AccessibleRelationType::CONTROLLER_FOR: + case AccessibleRelationType_CONTROLLER_FOR: return IA2_RELATION_CONTROLLER_FOR; - case AccessibleRelationType::LABEL_FOR: + case AccessibleRelationType_LABEL_FOR: return IA2_RELATION_LABEL_FOR; - case AccessibleRelationType::LABELED_BY: + case AccessibleRelationType_LABELED_BY: return IA2_RELATION_LABELED_BY; - case AccessibleRelationType::MEMBER_OF: + case AccessibleRelationType_MEMBER_OF: return IA2_RELATION_MEMBER_OF; - case AccessibleRelationType::SUB_WINDOW_OF: + case AccessibleRelationType_SUB_WINDOW_OF: return IA2_RELATION_SUBWINDOW_OF; - case AccessibleRelationType::NODE_CHILD_OF: + case AccessibleRelationType_NODE_CHILD_OF: return IA2_RELATION_NODE_CHILD_OF; - case AccessibleRelationType::DESCRIBED_BY: + case AccessibleRelationType_DESCRIBED_BY: return IA2_RELATION_DESCRIBED_BY; - case AccessibleRelationType::INVALID: + case AccessibleRelationType_INVALID: return L"INVALID"; default: assert(false && "unhandled AccessibleRelationType"); @@ -224,31 +224,31 @@ const wchar_t* CAccRelation::mapToIA2RelationType(sal_Int16 nUnoRelationType) } } -sal_Int16 CAccRelation::mapToUnoRelationType(const BSTR aIA2RelationType) +AccessibleRelationType CAccRelation::mapToUnoRelationType(const BSTR aIA2RelationType) { if (wcscmp(aIA2RelationType, IA2_RELATION_FLOWS_FROM) == 0) - return AccessibleRelationType::CONTENT_FLOWS_FROM; + return AccessibleRelationType_CONTENT_FLOWS_FROM; if (wcscmp(aIA2RelationType, IA2_RELATION_FLOWS_TO) == 0) - return AccessibleRelationType::CONTENT_FLOWS_TO; + return AccessibleRelationType_CONTENT_FLOWS_TO; if (wcscmp(aIA2RelationType, IA2_RELATION_CONTROLLED_BY) == 0) - return AccessibleRelationType::CONTROLLED_BY; + return AccessibleRelationType_CONTROLLED_BY; if (wcscmp(aIA2RelationType, IA2_RELATION_CONTROLLER_FOR) == 0) - return AccessibleRelationType::CONTROLLER_FOR; + return AccessibleRelationType_CONTROLLER_FOR; if (wcscmp(aIA2RelationType, IA2_RELATION_LABEL_FOR) == 0) - return AccessibleRelationType::LABEL_FOR; + return AccessibleRelationType_LABEL_FOR; if (wcscmp(aIA2RelationType, IA2_RELATION_LABELED_BY) == 0) - return AccessibleRelationType::LABELED_BY; + return AccessibleRelationType_LABELED_BY; if (wcscmp(aIA2RelationType, IA2_RELATION_MEMBER_OF) == 0) - return AccessibleRelationType::MEMBER_OF; + return AccessibleRelationType_MEMBER_OF; if (wcscmp(aIA2RelationType, IA2_RELATION_SUBWINDOW_OF) == 0) - return AccessibleRelationType::SUB_WINDOW_OF; + return AccessibleRelationType_SUB_WINDOW_OF; if (wcscmp(aIA2RelationType, IA2_RELATION_NODE_CHILD_OF) == 0) - return AccessibleRelationType::NODE_CHILD_OF; + return AccessibleRelationType_NODE_CHILD_OF; if (wcscmp(aIA2RelationType, IA2_RELATION_DESCRIBED_BY) == 0) - return AccessibleRelationType::DESCRIBED_BY; + return AccessibleRelationType_DESCRIBED_BY; // not all IAccessible2 relation types have a UNO equivalent - return AccessibleRelationType::INVALID; + return AccessibleRelationType_INVALID; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/UAccCOM/AccRelation.h b/winaccessibility/source/UAccCOM/AccRelation.h index de709a9a434f..e28325bcb33a 100644 --- a/winaccessibility/source/UAccCOM/AccRelation.h +++ b/winaccessibility/source/UAccCOM/AccRelation.h @@ -22,9 +22,12 @@ #include "Resource.h" // main symbols #include +#include #include #include "UNOXWrapper.h" +using css::accessibility::AccessibleRelationType; + /** * CAccRelation implements IAccessibleRelation interface. */ @@ -74,8 +77,8 @@ public: // Override of IUNOXWrapper. STDMETHOD(put_XSubInterface)(hyper pXSubInterface) override; - static const wchar_t* mapToIA2RelationType(sal_Int16 nUnoRelationType); - static sal_Int16 mapToUnoRelationType(const BSTR aIA2RelationType); + static const wchar_t* mapToIA2RelationType(AccessibleRelationType eUnoRelationType); + static AccessibleRelationType mapToUnoRelationType(const BSTR aIA2RelationType); private: css::accessibility::AccessibleRelation relation; diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index 814f13c1ea7d..fb13e7e6878a 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -713,7 +713,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT AccessibleRelation accRelation; for(int i=0; igetRelation(i).RelationType == AccessibleRelationType::LABELED_BY) + if (pRrelationSet->getRelation(i).RelationType == AccessibleRelationType_LABELED_BY) { accRelation = pRrelationSet->getRelation(i); paccRelation = &accRelation; @@ -736,7 +736,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT paccRelation = nullptr; for(int j=0; jgetRelation(j).RelationType == AccessibleRelationType::LABEL_FOR) + if (pRrelationSet->getRelation(j).RelationType == AccessibleRelationType_LABEL_FOR) { accRelation = pRrelationSet->getRelation(j); paccRelation = &accRelation; @@ -1765,7 +1765,7 @@ static XAccessible* getTheParentOfMember(XAccessible* pXAcc) for(sal_Int32 i=0 ; igetRelation(i); - if (accRelation.RelationType == AccessibleRelationType::MEMBER_OF) + if (accRelation.RelationType == AccessibleRelationType_MEMBER_OF) { Sequence> xTargets = accRelation.TargetSet; return xTargets[0].get(); @@ -1834,7 +1834,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_groupPosition(long __RPC_FAR for(int i=0 ; igetRelation(i); - if (accRelation.RelationType == AccessibleRelationType::MEMBER_OF) + if (accRelation.RelationType == AccessibleRelationType_MEMBER_OF) { Sequence> xTargets = accRelation.TargetSet; @@ -2727,12 +2727,12 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_relationTargetsOfType(BSTR t if (!xRelationSet.is()) return S_FALSE; - const sal_Int16 nUnoRelationType = CAccRelation::mapToUnoRelationType(type); - if (nUnoRelationType == AccessibleRelationType::INVALID) + const AccessibleRelationType eUnoRelationType = CAccRelation::mapToUnoRelationType(type); + if (eUnoRelationType == AccessibleRelationType_INVALID) return S_FALSE; - AccessibleRelation aRelation = xRelationSet->getRelationByType(nUnoRelationType); - if (aRelation.RelationType != nUnoRelationType || !aRelation.TargetSet.hasElements()) + AccessibleRelation aRelation = xRelationSet->getRelationByType(eUnoRelationType); + if (aRelation.RelationType != eUnoRelationType || !aRelation.TargetSet.hasElements()) return S_FALSE; const sal_Int32 nRetCount