convert Sequence<XInterface> constructions to use initializer lists

Change-Id: I66475190cc0f18465c56b94af7bc0d5a1ca81242
This commit is contained in:
Noel Grandin 2015-10-29 13:57:50 +02:00
parent f533433201
commit addb63fa8a
15 changed files with 29 additions and 54 deletions

View File

@ -509,8 +509,7 @@ namespace accessibility
if ( xParent.is() )
{
utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper;
Sequence< Reference< XInterface > > aSequence(1);
aSequence[0] = xParent;
Sequence< Reference< XInterface > > aSequence { xParent };
pRelationSetHelper->AddRelation(
AccessibleRelation( AccessibleRelationType::NODE_CHILD_OF, aSequence ) );
xRelSet = pRelationSetHelper;

View File

@ -1442,16 +1442,14 @@ Document::retrieveParagraphRelationSet( Paragraph const * pParagraph )
if ( aPara > m_aVisibleBegin && aPara < m_aVisibleEnd )
{
css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > aSequence(1);
aSequence[0] = getAccessibleChild( aPara - 1 );
css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > 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(1);
aSequence[0] = getAccessibleChild( aPara + 1 );
css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > aSequence { getAccessibleChild( aPara + 1 ) };
css::accessibility::AccessibleRelation aRelation( css::accessibility::AccessibleRelationType::CONTENT_FLOWS_TO, aSequence );
pRelationSetHelper->AddRelation( aRelation );
}
@ -1526,8 +1524,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(1);
aSequence[0] = getAccessibleParent();
css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > aSequence { getAccessibleParent() };
rRelationSet.AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) );
}
else

View File

@ -43,8 +43,7 @@ void FloatingWindowAccessible::FillAccessibleRelationSet(utl::AccessibleRelation
vcl::Window* pParentWindow = pWindow->GetParent();
if( pParentWindow )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
aSequence[0] = pParentWindow->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pParentWindow->GetAccessible() };
rRelationSet.AddRelation( AccessibleRelation( AccessibleRelationType::SUB_WINDOW_OF, aSequence ) );
}
}

View File

@ -461,8 +461,7 @@ void VCLXAccessibleList::ProcessWindowEvent (const VclWindowEvent& rVclWindowEve
{
if (m_pListBoxHelper && (m_pListBoxHelper->GetStyle() & WB_DROPDOWN ) != WB_DROPDOWN)
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
aSequence[0] = pBox->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pBox->GetAccessible() };
rRelationSet.AddRelation( com::sun::star::accessibility::AccessibleRelation( com::sun::star::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) );
}
}

View File

@ -823,9 +823,8 @@ namespace accessibility
if ( nMyParaIndex > 0 &&
mpParaManager->IsReferencable( nMyParaIndex - 1 ) )
{
uno::Sequence<uno::Reference<XInterface> > aSequence(1);
aSequence[0] =
mpParaManager->GetChild( nMyParaIndex - 1 ).first.get().getRef();
uno::Sequence<uno::Reference<XInterface> > aSequence
{ mpParaManager->GetChild( nMyParaIndex - 1 ).first.get().getRef() };
AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_FROM,
aSequence );
pAccRelSetHelper->AddRelation( aAccRel );
@ -835,9 +834,8 @@ namespace accessibility
if ( (nMyParaIndex + 1) < (sal_Int32)mpParaManager->GetNum() &&
mpParaManager->IsReferencable( nMyParaIndex + 1 ) )
{
uno::Sequence<uno::Reference<XInterface> > aSequence(1);
aSequence[0] =
mpParaManager->GetChild( nMyParaIndex + 1 ).first.get().getRef();
uno::Sequence<uno::Reference<XInterface> > aSequence
{ mpParaManager->GetChild( nMyParaIndex + 1 ).first.get().getRef() };
AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_TO,
aSequence );
pAccRelSetHelper->AddRelation( aAccRel );

View File

@ -530,15 +530,13 @@ uno::Reference< XAccessibleRelationSet > ScAccessibleEditObject::getAccessibleRe
vcl::Window *pLabeledBy = pWindow->GetAccessibleRelationLabeledBy();
if ( pLabeledBy && pLabeledBy != pWindow )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
aSequence[0] = pLabeledBy->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > 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(1);
aSequence[0] = pMemberOf->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pMemberOf->GetAccessible() };
rRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType::MEMBER_OF, aSequence ) );
}
return rSet;

View File

@ -320,16 +320,14 @@ uno::Reference< accessibility::XAccessibleRelationSet > SAL_CALL ValueSetAcc::ge
vcl::Window *pLabeledBy = pWindow->GetAccessibleRelationLabeledBy();
if ( pLabeledBy && pLabeledBy != pWindow )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
aSequence[0] = pLabeledBy->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pLabeledBy->GetAccessible() };
pRelationSet->AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::LABELED_BY, aSequence ) );
}
vcl::Window* pMemberOf = pWindow->GetAccessibleRelationMemberOf();
if ( pMemberOf && pMemberOf != pWindow )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
aSequence[0] = pMemberOf->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pMemberOf->GetAccessible() };
pRelationSet->AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) );
}
}

View File

@ -590,8 +590,7 @@ Reference< XAccessibleRelationSet > SAL_CALL AccessibleControlShape::getAccessib
{
Reference < XAccessible > xAcc (pCtlAccShape->getAccessibleContext(), UNO_QUERY);
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > aSequence(1);
aSequence[0] = xAcc;
css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > aSequence { xAcc };
if( getAccessibleRole() == AccessibleRole::RADIO_BUTTON )
{
pRelationSetHelper->AddRelation( AccessibleRelation( AccessibleRelationType::MEMBER_OF, aSequence ) );

View File

@ -401,8 +401,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL
::utl::AccessibleRelationSetHelper* pRelationSet = new utl::AccessibleRelationSetHelper;
//this mxshape is the captioned shape
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
aSequence[0] = mpParent->GetAccessibleCaption(mxShape);
uno::Sequence< uno::Reference< uno::XInterface > > aSequence { mpParent->GetAccessibleCaption(mxShape) };
if(aSequence[0].get())
{
pRelationSet->AddRelation(

View File

@ -144,16 +144,14 @@ uno::Reference< XAccessibleRelationSet > SvxPixelCtlAccessible::getAccessibleRel
vcl::Window *pLabeledBy = mrPixelCtl.GetAccessibleRelationLabeledBy();
if ( pLabeledBy && pLabeledBy != &mrPixelCtl )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
aSequence[0] = pLabeledBy->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pLabeledBy->GetAccessible() };
rRelationSet->AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::LABELED_BY, aSequence ) );
}
vcl::Window* pMemberOf = mrPixelCtl.GetAccessibleRelationMemberOf();
if ( pMemberOf && pMemberOf != &mrPixelCtl )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
aSequence[0] = pMemberOf->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pMemberOf->GetAccessible() };
rRelationSet->AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) );
}
return rSet;

View File

@ -354,15 +354,13 @@ Reference< XAccessibleRelationSet > SAL_CALL SvxRectCtlAccessibleContext::getAcc
vcl::Window *pLabeledBy = pWindow->GetAccessibleRelationLabeledBy();
if ( pLabeledBy && pLabeledBy != pWindow )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
aSequence[0] = pLabeledBy->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pLabeledBy->GetAccessible() };
pRelationSetHelper->AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::LABELED_BY, aSequence ) );
}
vcl::Window* pMemberOf = pWindow->GetAccessibleRelationMemberOf();
if ( pMemberOf && pMemberOf != pWindow )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
aSequence[0] = pMemberOf->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pMemberOf->GetAccessible() };
pRelationSetHelper->AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) );
}
}
@ -856,8 +854,7 @@ Reference<XAccessibleRelationSet> SAL_CALL SvxRectCtlChildAccessibleContext::get
uno::Reference< css::accessibility::XAccessibleRelationSet > xSet = pRelationSetHelper;
if( mxParent.is() )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
aSequence[0] = mxParent;
uno::Sequence< uno::Reference< uno::XInterface > > aSequence { mxParent };
pRelationSetHelper->AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) );
}

View File

@ -974,8 +974,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleParagraph::getAccess
const SwContentFrm* pPrevCntFrm( pTextFrm->FindPrevCnt( true ) );
if ( pPrevCntFrm )
{
uno::Sequence< uno::Reference<XInterface> > aSequence(1);
aSequence[0] = GetMap()->GetContext( pPrevCntFrm );
uno::Sequence< uno::Reference<XInterface> > aSequence { GetMap()->GetContext( pPrevCntFrm ) };
AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_FROM,
aSequence );
pHelper->AddRelation( aAccRel );
@ -984,8 +983,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleParagraph::getAccess
const SwContentFrm* pNextCntFrm( pTextFrm->FindNextCnt( true ) );
if ( pNextCntFrm )
{
uno::Sequence< uno::Reference<XInterface> > aSequence(1);
aSequence[0] = GetMap()->GetContext( pNextCntFrm );
uno::Sequence< uno::Reference<XInterface> > aSequence { GetMap()->GetContext( pNextCntFrm ) };
AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_TO,
aSequence );
pHelper->AddRelation( aAccRel );

View File

@ -321,8 +321,7 @@ SwFlyFrm* SwAccessibleTextFrame::getFlyFrm() const
AccessibleRelation SwAccessibleTextFrame::makeRelation( sal_Int16 nType, const SwFlyFrm* pFrm )
{
uno::Sequence<uno::Reference<XInterface> > aSequence(1);
aSequence[0] = GetMap()->GetContext( pFrm );
uno::Sequence<uno::Reference<XInterface> > aSequence { GetMap()->GetContext( pFrm ) };
return AccessibleRelation( nType, aSequence );
}

View File

@ -1036,8 +1036,8 @@ void Test_Impl::testConstructorsService(
Constructors::create2(context, args);
Sequence<Type> argSeq1(1); argSeq1[0] = cppu::UnoType<sal_Int32>::get();
Sequence<Reference<XInterface> > argSeq2(1); argSeq2[0] = static_cast<XComponent*>(new Dummy());
Sequence<Reference<XComponent> > argSeq2a(1); argSeq2a[0] = static_cast<XComponent*>(new Dummy());
Sequence<Reference<XInterface> > argSeq2 { static_cast<XComponent*>(new Dummy()) };
Sequence<Reference<XComponent> > argSeq2a { static_cast<XComponent*>(new Dummy()) };
Sequence<TestPolyStruct2<sal_Unicode, Sequence<Any> > > argSeq3(1);
argSeq3[0] = TestPolyStruct2<sal_Unicode, Sequence<Any> >('X', arg27);

View File

@ -365,24 +365,21 @@ void VCLXAccessibleComponent::FillAccessibleRelationSet( utl::AccessibleRelation
vcl::Window *pLabeledBy = pWindow->GetAccessibleRelationLabeledBy();
if ( pLabeledBy && pLabeledBy != pWindow )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
aSequence[0] = pLabeledBy->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > 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(1);
aSequence[0] = pLabelFor->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > 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(1);
aSequence[0] = pMemberOf->GetAccessible();
uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pMemberOf->GetAccessible() };
rRelationSet.AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) );
}
}