diff options
27 files changed, 64 insertions, 72 deletions
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx index 6c8fa6fc26dc..a843b938b9a3 100644 --- a/accessibility/source/extended/accessiblelistboxentry.cxx +++ b/accessibility/source/extended/accessiblelistboxentry.cxx @@ -463,7 +463,7 @@ namespace accessibility if ( xParent.is() ) { rtl::Reference<utl::AccessibleRelationSetHelper> pRelationSetHelper = new utl::AccessibleRelationSetHelper; - Sequence< Reference< XInterface > > aSequence { xParent }; + Sequence<Reference<XAccessible>> aSequence { xParent }; pRelationSetHelper->AddRelation( AccessibleRelation( AccessibleRelationType::NODE_CHILD_OF, aSequence ) ); xRelSet = pRelationSetHelper; diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index f1ccc69c413d..5cef04128d82 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -1293,14 +1293,14 @@ Document::retrieveParagraphRelationSet( Paragraph const * pParagraph ) if ( aPara > m_aVisibleBegin && aPara < m_aVisibleEnd ) { - css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > aSequence { getAccessibleChild( aPara - 1 ) }; + css::uno::Sequence<css::uno::Reference<css::accessibility::XAccessible>> aSequence { getAccessibleChild(aPara - 1) }; css::accessibility::AccessibleRelation aRelation( css::accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM, aSequence ); pRelationSetHelper->AddRelation( aRelation ); } if ( aPara >= m_aVisibleBegin && aPara < m_aVisibleEnd -1 ) { - css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > aSequence { getAccessibleChild( aPara + 1 ) }; + css::uno::Sequence<css::uno::Reference<css::accessibility::XAccessible>> aSequence { getAccessibleChild(aPara + 1) }; css::accessibility::AccessibleRelation aRelation( css::accessibility::AccessibleRelationType::CONTENT_FLOWS_TO, aSequence ); pRelationSetHelper->AddRelation( aRelation ); } @@ -1370,7 +1370,7 @@ void Document::FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& r { if( getAccessibleParent()->getAccessibleContext()->getAccessibleRole() == css::accessibility::AccessibleRole::SCROLL_PANE ) { - css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > aSequence { getAccessibleParent() }; + css::uno::Sequence<css::uno::Reference<css::accessibility::XAccessible>> aSequence { getAccessibleParent() }; 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 aa5ef41f6c79..ebfd0c506905 100644 --- a/accessibility/source/standard/floatingwindowaccessible.cxx +++ b/accessibility/source/standard/floatingwindowaccessible.cxx @@ -36,7 +36,7 @@ void FloatingWindowAccessible::FillAccessibleRelationSet(utl::AccessibleRelation vcl::Window* pParentWindow = pWindow->GetParent(); if( pParentWindow ) { - uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pParentWindow->GetAccessible() }; + uno::Sequence<uno::Reference<css::accessibility::XAccessible>> aSequence { pParentWindow->GetAccessible() }; rRelationSet.AddRelation( AccessibleRelation( AccessibleRelationType::SUB_WINDOW_OF, aSequence ) ); } } diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index 79aa8a0f7ea5..c001b59c42fc 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -439,7 +439,7 @@ void VCLXAccessibleList::ProcessWindowEvent (const VclWindowEvent& rVclWindowEve { if (m_pListBoxHelper && (m_pListBoxHelper->GetStyle() & WB_DROPDOWN ) != WB_DROPDOWN) { - uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pBox->GetAccessible() }; + uno::Sequence<uno::Reference<css::accessibility::XAccessible>> aSequence { pBox->GetAccessible() }; rRelationSet.AddRelation( com::sun::star::accessibility::AccessibleRelation( com::sun::star::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) ); } } diff --git a/accessibility/source/standard/vclxaccessibleradiobutton.cxx b/accessibility/source/standard/vclxaccessibleradiobutton.cxx index 1d9704c00e83..3d66b799db0d 100644 --- a/accessibility/source/standard/vclxaccessibleradiobutton.cxx +++ b/accessibility/source/standard/vclxaccessibleradiobutton.cxx @@ -81,7 +81,7 @@ void VCLXAccessibleRadioButton::FillAccessibleRelationSet( utl::AccessibleRelati std::vector< VclPtr<RadioButton> > aGroup(pRadioButton->GetRadioButtonGroup()); if (!aGroup.empty()) { - std::vector< Reference< XInterface > > aVec; + std::vector<Reference<css::accessibility::XAccessible>> aVec; aVec.reserve(aGroup.size()); std::transform(aGroup.begin(), aGroup.end(), std::back_inserter(aVec), [](const VclPtr<RadioButton>& rxItem) { return rxItem->GetAccessible(); }); diff --git a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx index 56842bccf03d..1fa17c06207c 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx @@ -133,7 +133,7 @@ namespace dbaui if( nIndex < 0 || nIndex >= getRelationCount() ) throw IndexOutOfBoundsException(); - Sequence< Reference<XInterface> > aSeq; + Sequence<Reference<XAccessible>> aSeq; if( m_pLine ) { aSeq = { m_pLine->GetSourceWin()->GetAccessible(), diff --git a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx index bb6131840d80..138850267c47 100644 --- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx @@ -201,19 +201,19 @@ namespace dbaui auto aIter = pView->getTableConnections(m_pTable); auto aEnd = rConnectionList.end(); - std::vector< Reference<XInterface> > aRelations; + std::vector< Reference<css::accessibility::XAccessible> > aRelations; aRelations.reserve(5); // just guessing // TODO JNA aIter comes from pView->getTableConnections(m_pTable) // and aEnd comes from pView->getTableConnections().end() for (; aIter != aEnd ; ++aIter ) { - uno::Reference<uno::XInterface> xInterface( + uno::Reference<css::accessibility::XAccessible> xAccessible( getParentChild(aIter - rConnectionList.begin())); - aRelations.push_back(xInterface); + aRelations.push_back(xAccessible); } - Sequence< Reference<XInterface> > aSeq(aRelations.data(), aRelations.size()); - return AccessibleRelation(AccessibleRelationType::CONTROLLER_FOR,aSeq); + Sequence<Reference<css::accessibility::XAccessible>> aSeq(aRelations.data(), aRelations.size()); + return AccessibleRelation(AccessibleRelationType::CONTROLLER_FOR, aSeq); } return AccessibleRelation(); } diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index e504d0fa29a7..2f727cb7669d 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -736,8 +736,8 @@ namespace accessibility if ( nMyParaIndex > 0 && mpParaManager->IsReferencable( nMyParaIndex - 1 ) ) { - uno::Sequence<uno::Reference<XInterface> > aSequence - { cppu::getXWeak(mpParaManager->GetChild( nMyParaIndex - 1 ).first.get().get()) }; + uno::Sequence<uno::Reference<XAccessible>> aSequence + { mpParaManager->GetChild( nMyParaIndex - 1 ).first.get() }; AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_FROM, aSequence ); pAccRelSetHelper->AddRelation( aAccRel ); @@ -747,8 +747,8 @@ namespace accessibility if ( (nMyParaIndex + 1) < mpParaManager->GetNum() && mpParaManager->IsReferencable( nMyParaIndex + 1 ) ) { - uno::Sequence<uno::Reference<XInterface> > aSequence - { cppu::getXWeak(mpParaManager->GetChild( nMyParaIndex + 1 ).first.get().get()) }; + uno::Sequence<uno::Reference<XAccessible>> aSequence + { mpParaManager->GetChild( nMyParaIndex + 1 ).first.get() }; AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_TO, aSequence ); pAccRelSetHelper->AddRelation( aAccRel ); diff --git a/offapi/com/sun/star/accessibility/AccessibleRelation.idl b/offapi/com/sun/star/accessibility/AccessibleRelation.idl index b00ae6952941..e2228dcea0cf 100644 --- a/offapi/com/sun/star/accessibility/AccessibleRelation.idl +++ b/offapi/com/sun/star/accessibility/AccessibleRelation.idl @@ -46,7 +46,7 @@ struct AccessibleRelation INVALID. The set must not contain references to one object more than once.</p> */ - sequence< ::com::sun::star::uno::XInterface> TargetSet; + sequence<::com::sun::star::accessibility::XAccessible> TargetSet; }; }; }; }; }; diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index 3ac2fdba307f..b27fbb90671a 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -464,8 +464,8 @@ void ScAccessibleCell::AddRelation(const ScRange& rRange, return; } - uno::Sequence < uno::Reference < uno::XInterface > > aTargetSet( nCount ); - uno::Reference < uno::XInterface >* pTargetSet = aTargetSet.getArray(); + uno::Sequence<uno::Reference<css::accessibility::XAccessible>> aTargetSet(nCount); + uno::Reference <css::accessibility::XAccessible>* pTargetSet = aTargetSet.getArray(); sal_uInt32 nPos(0); for (sal_uInt32 nRow = rRange.aStart.Row(); nRow <= sal::static_int_cast<sal_uInt32>(rRange.aEnd.Row()); ++nRow) { diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index c7050d777704..c6dc50dc011a 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -300,7 +300,7 @@ Reference< XAccessibleRelationSet > SAL_CALL ScAccessibleCsvRuler::getAccessible css::uno::Reference<css::accessibility::XAccessible> xAccObj(static_cast<ScAccessibleCsvGrid*>(rGrid.GetAccessible())); if( xAccObj.is() ) { - Sequence< Reference< XInterface > > aSeq{ xAccObj }; + Sequence<Reference<css::accessibility::XAccessible>> aSeq{ xAccObj }; pRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType::CONTROLLER_FOR, aSeq ) ); } @@ -839,7 +839,7 @@ Reference< XAccessibleRelationSet > SAL_CALL ScAccessibleCsvGrid::getAccessibleR css::uno::Reference<css::accessibility::XAccessible> xAccObj(static_cast<ScAccessibleCsvGrid*>(rRuler.GetAccessible())); if( xAccObj.is() ) { - Sequence< Reference< XInterface > > aSeq{ xAccObj }; + Sequence<Reference<css::accessibility::XAccessible>> aSeq{ xAccObj }; pRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType::CONTROLLED_BY, aSeq ) ); } } diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx index 3b1eaf532d7a..ceb07cb662aa 100644 --- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx +++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx @@ -517,13 +517,13 @@ uno::Reference< XAccessibleRelationSet > ScAccessibleEditObject::getAccessibleRe vcl::Window *pLabeledBy = pWindow->GetAccessibleRelationLabeledBy(); if ( pLabeledBy && pLabeledBy != pWindow ) { - uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pLabeledBy->GetAccessible() }; + uno::Sequence<uno::Reference<css::accessibility::XAccessible>> aSequence { pLabeledBy->GetAccessible() }; rRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType::LABELED_BY, aSequence ) ); } vcl::Window* pMemberOf = pWindow->GetAccessibleRelationMemberOf(); if ( pMemberOf && pMemberOf != pWindow ) { - uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pMemberOf->GetAccessible() }; + uno::Sequence< uno::Reference<css::accessibility::XAccessible> > aSequence { pMemberOf->GetAccessible() }; rRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType::MEMBER_OF, aSequence ) ); } return rRelationSet; diff --git a/sd/source/console/PresenterAccessibility.cxx b/sd/source/console/PresenterAccessibility.cxx index e7ac0b95d52b..08576be6940d 100644 --- a/sd/source/console/PresenterAccessibility.cxx +++ b/sd/source/console/PresenterAccessibility.cxx @@ -211,7 +211,7 @@ public: void AddRelation ( const sal_Int16 nRelationType, - const Reference<XInterface>& rxObject); + const Reference<XAccessible>& rxObject); //----- XAccessibleRelationSet -------------------------------------------- @@ -1194,7 +1194,7 @@ AccessibleRelationSet::AccessibleRelationSet() void AccessibleRelationSet::AddRelation ( const sal_Int16 nRelationType, - const Reference<XInterface>& rxObject) + const Reference<XAccessible>& rxObject) { maRelations.emplace_back(); maRelations.back().RelationType = nRelationType; diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index 3a6605fda632..2f59e302bb73 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++ b/svx/source/accessibility/AccessibleControlShape.cxx @@ -551,7 +551,7 @@ Reference< XAccessibleRelationSet > SAL_CALL AccessibleControlShape::getAccessib { Reference < XAccessible > xAcc (pCtlAccShape->getAccessibleContext(), UNO_QUERY); - css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > aSequence { xAcc }; + css::uno::Sequence<css::uno::Reference<XAccessible>> aSequence { xAcc }; if( getAccessibleRole() == AccessibleRole::RADIO_BUTTON ) { pRelationSetHelper->AddRelation( AccessibleRelation( AccessibleRelationType::MEMBER_OF, aSequence ) ); diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 7a1770b8fd42..1504c6869e75 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -360,7 +360,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL rtl::Reference<::utl::AccessibleRelationSetHelper> pRelationSet = new utl::AccessibleRelationSetHelper; //this mxshape is the captioned shape - uno::Sequence< uno::Reference< uno::XInterface > > aSequence { mpParent->GetAccessibleCaption(mxShape) }; + uno::Sequence<uno::Reference<css::accessibility::XAccessible>> aSequence { mpParent->GetAccessibleCaption(mxShape) }; if(aSequence[0]) { pRelationSet->AddRelation( diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index 45360e6c862f..2ce9f857325a 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -480,7 +480,7 @@ Reference<XAccessibleRelationSet> SAL_CALL SvxRectCtlChildAccessibleContext::get rtl::Reference<utl::AccessibleRelationSetHelper> pRelationSetHelper = new utl::AccessibleRelationSetHelper; if( mxParent.is() ) { - uno::Sequence< uno::Reference< uno::XInterface > > aSequence { mxParent }; + uno::Sequence<uno::Reference<css::accessibility::XAccessible>> aSequence { mxParent }; pRelationSetHelper->AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) ); } diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index b128b475809d..c6565a522671 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -750,7 +750,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleParagraph::getAccess const SwContentFrame* pPrevContentFrame( pTextFrame->FindPrevCnt() ); if ( pPrevContentFrame ) { - uno::Sequence< uno::Reference<XInterface> > aSequence { GetMap()->GetContext( pPrevContentFrame ) }; + uno::Sequence<uno::Reference<XAccessible>> aSequence { GetMap()->GetContext(pPrevContentFrame) }; AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_FROM, aSequence ); pHelper->AddRelation( aAccRel ); @@ -759,7 +759,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleParagraph::getAccess const SwContentFrame* pNextContentFrame( pTextFrame->FindNextCnt( true ) ); if ( pNextContentFrame ) { - uno::Sequence< uno::Reference<XInterface> > aSequence { GetMap()->GetContext( pNextContentFrame ) }; + uno::Sequence<uno::Reference<XAccessible>> aSequence { GetMap()->GetContext(pNextContentFrame) }; 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 e1b5cd029ceb..e6f11873de3b 100644 --- a/sw/source/core/access/acctextframe.cxx +++ b/sw/source/core/access/acctextframe.cxx @@ -271,7 +271,7 @@ SwFlyFrame* SwAccessibleTextFrame::getFlyFrame() const AccessibleRelation SwAccessibleTextFrame::makeRelation( sal_Int16 nType, const SwFlyFrame* pFrame ) { - uno::Sequence<uno::Reference<XInterface> > aSequence { GetMap()->GetContext( pFrame ) }; + uno::Sequence<uno::Reference<XAccessible>> aSequence { GetMap()->GetContext(pFrame) }; return AccessibleRelation( nType, aSequence ); } diff --git a/test/source/a11y/accessibletestbase.cxx b/test/source/a11y/accessibletestbase.cxx index 773259941f42..00aac5ea9900 100644 --- a/test/source/a11y/accessibletestbase.cxx +++ b/test/source/a11y/accessibletestbase.cxx @@ -121,10 +121,9 @@ test::AccessibleTestBase::getFirstRelationTargetOfType( const auto& rel = relset->getRelation(i); if (rel.RelationType == relationType) { - for (auto& target : rel.TargetSet) + for (const uno::Reference<accessibility::XAccessible>& targetAccessible : + rel.TargetSet) { - uno::Reference<accessibility::XAccessible> targetAccessible(target, - uno::UNO_QUERY); if (targetAccessible.is()) return targetAccessible->getAccessibleContext(); } @@ -177,12 +176,11 @@ void test::AccessibleTestBase::dumpA11YTree( << " (" << rel.RelationType << ")"; std::cout << " targets=["; int j = 0; - for (auto& target : rel.TargetSet) + for (const uno::Reference<accessibility::XAccessible>& xTarget : rel.TargetSet) { if (j++ > 0) std::cout << ", "; - uno::Reference<accessibility::XAccessible> ta(target, uno::UNO_QUERY_THROW); - std::cout << AccessibilityTools::debugString(ta); + std::cout << AccessibilityTools::debugString(xTarget); } std::cout << "])"; } diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index 9c2321ede37a..a1a31902c0a9 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -393,21 +393,21 @@ void VCLXAccessibleComponent::FillAccessibleRelationSet( utl::AccessibleRelation vcl::Window *pLabeledBy = pWindow->GetAccessibleRelationLabeledBy(); if ( pLabeledBy && pLabeledBy != pWindow ) { - uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pLabeledBy->GetAccessible() }; + uno::Sequence<uno::Reference<css::accessibility::XAccessible>> aSequence { pLabeledBy->GetAccessible() }; rRelationSet.AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::LABELED_BY, aSequence ) ); } vcl::Window* pLabelFor = pWindow->GetAccessibleRelationLabelFor(); if ( pLabelFor && pLabelFor != pWindow ) { - uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pLabelFor->GetAccessible() }; + uno::Sequence<uno::Reference<css::accessibility::XAccessible>> aSequence { pLabelFor->GetAccessible() }; rRelationSet.AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::LABEL_FOR, aSequence ) ); } vcl::Window* pMemberOf = pWindow->GetAccessibleRelationMemberOf(); if ( pMemberOf && pMemberOf != pWindow ) { - uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pMemberOf->GetAccessible() }; + uno::Sequence<uno::Reference<css::accessibility::XAccessible>> aSequence { pMemberOf->GetAccessible() }; rRelationSet.AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) ); } } diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm index df1d3690df6d..96808412e154 100644 --- a/vcl/osx/a11ywrapper.mm +++ b/vcl/osx/a11ywrapper.mm @@ -188,7 +188,7 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { { AccessibleRelation relationMemberOf = rxAccessibleRelationSet -> getRelationByType ( AccessibleRelationType::MEMBER_OF ); if ( relationMemberOf.RelationType == AccessibleRelationType::MEMBER_OF && relationMemberOf.TargetSet.hasElements() ) - return Reference < XAccessible > ( relationMemberOf.TargetSet[0], UNO_QUERY ); + return relationMemberOf.TargetSet[0]; } return Reference < XAccessible > (); } @@ -318,8 +318,7 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { Reference < XAccessibleRelationSet > rxAccessibleRelationSet = [ self accessibleContext ] -> getAccessibleRelationSet(); AccessibleRelation const relationMemberOf = rxAccessibleRelationSet -> getRelationByType ( AccessibleRelationType::MEMBER_OF ); if ( relationMemberOf.RelationType == AccessibleRelationType::MEMBER_OF && relationMemberOf.TargetSet.hasElements() ) { - for ( const auto& i : relationMemberOf.TargetSet ) { - Reference < XAccessible > rMateAccessible( i, UNO_QUERY ); + for (Reference <XAccessible> rMateAccessible : relationMemberOf.TargetSet ) { if ( rMateAccessible.is() ) { Reference< XAccessibleContext > rMateAccessibleContext( rMateAccessible -> getAccessibleContext() ); if ( rMateAccessibleContext.is() ) { @@ -639,7 +638,7 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { if ( [ title length ] == 0 ) { AccessibleRelation relationLabeledBy = [ self accessibleContext ] -> getAccessibleRelationSet() -> getRelationByType ( AccessibleRelationType::LABELED_BY ); if ( relationLabeledBy.RelationType == AccessibleRelationType::LABELED_BY && relationLabeledBy.TargetSet.hasElements() ) { - Reference < XAccessible > rxAccessible ( relationLabeledBy.TargetSet[0], UNO_QUERY ); + Reference <XAccessible> rxAccessible = relationLabeledBy.TargetSet[0]; titleElement = [ AquaA11yFactory wrapperForAccessibleContext: rxAccessible -> getAccessibleContext() ]; } } @@ -657,7 +656,7 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { id titleForElement = nil; AccessibleRelation relationLabelFor = [ self accessibleContext ] -> getAccessibleRelationSet() -> getRelationByType ( AccessibleRelationType::LABEL_FOR ); if ( relationLabelFor.RelationType == AccessibleRelationType::LABEL_FOR && relationLabelFor.TargetSet.hasElements() ) { - Reference < XAccessible > rxAccessible ( relationLabelFor.TargetSet[0], UNO_QUERY ); + Reference <XAccessible> rxAccessible = relationLabelFor.TargetSet[0]; titleForElement = [ AquaA11yFactory wrapperForAccessibleContext: rxAccessible -> getAccessibleContext() ]; } return titleForElement; @@ -1120,8 +1119,7 @@ static Reference < XAccessibleContext > hitTestRunner ( css::awt::Point point, 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 ); - for ( const auto & i : relation.TargetSet ) { - Reference < XAccessible > rxAccessible ( i, UNO_QUERY ); + for (Reference<XAccessible> rxAccessible : relation.TargetSet) { if ( rxAccessible.is() && rxAccessible -> getAccessibleContext().is() ) { // hit test for children of parent hitChild = hitTestRunner ( hitPoint, rxAccessible -> getAccessibleContext() ); diff --git a/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx b/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx index 04d885d623c3..7c6feb7755f1 100644 --- a/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx +++ b/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx @@ -369,8 +369,7 @@ void Atspi2TestTree::compareObjects(const uno::Reference<accessibility::XAccessi { for (auto j = decltype(nLOTargetsCount){ 0 }; j < nLOTargetsCount; j++) { - uno::Reference<accessibility::XAccessible> xLOTarget(xLORelation.TargetSet[j], - uno::UNO_QUERY_THROW); + uno::Reference<accessibility::XAccessible> xLOTarget = xLORelation.TargetSet[j]; compareObjects(xLOTarget, pAtspiRelation.getTarget(j), RecurseFlags::NONE); } } diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx index 4065e6ca2307..2a9236e6339f 100644 --- a/vcl/qt5/QtAccessibleWidget.cxx +++ b/vcl/qt5/QtAccessibleWidget.cxx @@ -261,7 +261,7 @@ void lcl_appendRelation(QVector<QPair<QAccessibleInterface*, QAccessible::Relati for (sal_uInt32 i = 0; i < nTargetCount; i++) { - Reference<XAccessible> xAccessible(aRelation.TargetSet[i], uno::UNO_QUERY); + Reference<XAccessible> xAccessible = aRelation.TargetSet[i]; relations->append( { QAccessible::queryAccessibleInterface(QtAccessibleRegistry::getQObject(xAccessible)), aQRelation }); diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 12f4537f4df0..36312092e419 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -6281,7 +6281,7 @@ a11yrelationset SalInstanceDrawingArea::get_accessible_relation_set() vcl::Window* pLabeledBy = pWindow->GetAccessibleRelationLabeledBy(); if (pLabeledBy && pLabeledBy != pWindow) { - css::uno::Sequence<css::uno::Reference<css::uno::XInterface>> aSequence{ + css::uno::Sequence<css::uno::Reference<css::accessibility::XAccessible>> aSequence{ pLabeledBy->GetAccessible() }; pRelationSetHelper->AddRelation(css::accessibility::AccessibleRelation( @@ -6290,7 +6290,7 @@ a11yrelationset SalInstanceDrawingArea::get_accessible_relation_set() vcl::Window* pMemberOf = pWindow->GetAccessibleRelationMemberOf(); if (pMemberOf && pMemberOf != pWindow) { - css::uno::Sequence<css::uno::Reference<css::uno::XInterface>> aSequence{ + css::uno::Sequence<css::uno::Reference<css::accessibility::XAccessible>> aSequence{ pMemberOf->GetAccessible() }; pRelationSetHelper->AddRelation(css::accessibility::AccessibleRelation( diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx index 757e56cdc434..db0aa1dbc907 100644 --- a/vcl/unx/gtk3/a11y/atkwrapper.cxx +++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx @@ -571,10 +571,9 @@ atk_object_wrapper_relation_new(const accessibility::AccessibleRelation& rRelati std::vector<AtkObject*> aTargets; - for (const auto& rTarget : rRelation.TargetSet) + for (const uno::Reference<accessibility::XAccessible>& xTarget : rRelation.TargetSet) { - uno::Reference< accessibility::XAccessible > xAccessible( rTarget, uno::UNO_QUERY ); - aTargets.push_back(atk_object_wrapper_ref(xAccessible)); + aTargets.push_back(atk_object_wrapper_ref(xTarget)); } AtkRelation *pRel = diff --git a/winaccessibility/source/UAccCOM/AccRelation.cxx b/winaccessibility/source/UAccCOM/AccRelation.cxx index b866d3f0ba36..4312491595bd 100644 --- a/winaccessibility/source/UAccCOM/AccRelation.cxx +++ b/winaccessibility/source/UAccCOM/AccRelation.cxx @@ -80,7 +80,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_nTargets(long * nTargets) if (nTargets == nullptr) return E_INVALIDARG; - Sequence< Reference< XInterface > > xTargets = relation.TargetSet; + Sequence<Reference<XAccessible>> xTargets = relation.TargetSet; *nTargets = xTargets.getLength(); return S_OK; @@ -102,12 +102,12 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_target(long targetIndex, IUn if (target == nullptr) return E_FAIL; - Sequence< Reference< XInterface > > xTargets = relation.TargetSet; + Sequence<Reference<XAccessible>> xTargets = relation.TargetSet; int nCount = xTargets.getLength(); if( targetIndex >= nCount ) return E_FAIL; - Reference<XAccessible> xRAcc(xTargets[targetIndex], UNO_QUERY); + Reference<XAccessible> xRAcc = xTargets[targetIndex]; IAccessible* pRet = CMAccessible::get_IAccessibleFromXAccessible(xRAcc.get()); if (pRet) { @@ -139,7 +139,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_targets(long, IUnknown * * t if (nTargets == nullptr) return E_INVALIDARG; - Sequence< Reference< XInterface > > xTargets = relation.TargetSet; + Sequence<Reference<XAccessible>> xTargets = relation.TargetSet; int nCount = xTargets.getLength(); *target = static_cast<IUnknown*>(::CoTaskMemAlloc(nCount*sizeof(IUnknown))); diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index 8694ef418bbc..908c0b5ca527 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -717,12 +717,10 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT if(paccRelation == nullptr) return S_FALSE; - Sequence< Reference< XInterface > > xTargets = paccRelation->TargetSet; - Reference<XInterface> pRAcc = xTargets[0]; + Sequence<Reference<XAccessible>> xTargets = paccRelation->TargetSet; + Reference<XAccessible> xAcc = xTargets[0]; - XAccessible* pXAcc = static_cast<XAccessible*>(pRAcc.get()); - - Reference<XAccessibleContext> xLabelContext = pXAcc->getAccessibleContext(); + Reference<XAccessibleContext> xLabelContext = xAcc->getAccessibleContext(); if (!xLabelContext.is()) return S_FALSE; @@ -742,8 +740,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT if(paccRelation) { xTargets = paccRelation->TargetSet; - pRAcc = xTargets[0]; - if (m_xAccessible.get() != static_cast<XAccessible*>(pRAcc.get())) + xAcc = xTargets[0]; + if (m_xAccessible.get() != xAcc.get()) return S_FALSE; } @@ -1794,8 +1792,8 @@ static XAccessible* getTheParentOfMember(XAccessible* pXAcc) AccessibleRelation accRelation = pRrelationSet->getRelation(i); if (accRelation.RelationType == AccessibleRelationType::MEMBER_OF) { - Sequence< Reference< XInterface > > xTargets = accRelation.TargetSet; - return static_cast<XAccessible*>(xTargets[0].get()); + Sequence<Reference<XAccessible>> xTargets = accRelation.TargetSet; + return xTargets[0].get(); } } return nullptr; @@ -1863,15 +1861,15 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_groupPosition(long __RPC_FAR AccessibleRelation accRelation = pRrelationSet->getRelation(i); if (accRelation.RelationType == AccessibleRelationType::MEMBER_OF) { - Sequence< Reference< XInterface > > xTargets = accRelation.TargetSet; + Sequence<Reference<XAccessible>> xTargets = accRelation.TargetSet; - Reference<XInterface> pRAcc = xTargets[0]; + Reference<XAccessible> xTarget = xTargets[0]; sal_Int64 nChildCount = pRParentContext->getAccessibleChildCount(); assert(nChildCount < std::numeric_limits<long>::max()); for (sal_Int64 j = 0; j< nChildCount; j++) { if( getTheParentOfMember(pRParentContext->getAccessibleChild(j).get()) - == static_cast<XAccessible*>(pRAcc.get()) && + == xTarget.get() && pRParentContext->getAccessibleChild(j)->getAccessibleContext()->getAccessibleRole() == AccessibleRole::RADIO_BUTTON) number++; if (pRParentContext->getAccessibleChild(j).get() == m_xAccessible.get()) |