sw/source/core/access/accpara.cxx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
New commits: commit 9d27287b7c39580729c07aa370ae2ab7eee68a5a Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu May 1 14:54:21 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu May 1 23:09:58 2025 +0200 sw a11y: Flatten SwAccessibleParagraph::getAccessibleRelationSet Return early for null `pTextFrame`. Change-Id: Ieb2ab4d52ff0b7d9686bd3881d44931d3780d401 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184865 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index b5d1d7a0be0b..d3de1b308f7f 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -665,23 +665,23 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleParagraph::getAccess rtl::Reference<utl::AccessibleRelationSetHelper> pHelper = new utl::AccessibleRelationSetHelper(); const SwTextFrame* pTextFrame = GetTextFrame(); - if ( pTextFrame ) + if (!pTextFrame) + return pHelper; + + const SwContentFrame* pPrevContentFrame( pTextFrame->FindPrevCnt() ); + if ( pPrevContentFrame ) { - const SwContentFrame* pPrevContentFrame( pTextFrame->FindPrevCnt() ); - if ( pPrevContentFrame ) - { - uno::Sequence<uno::Reference<XAccessible>> aSequence { GetMap()->GetContext(pPrevContentFrame) }; - AccessibleRelation aAccRel(AccessibleRelationType_CONTENT_FLOWS_FROM, aSequence); - pHelper->AddRelation( aAccRel ); - } + uno::Sequence<uno::Reference<XAccessible>> aSequence { GetMap()->GetContext(pPrevContentFrame) }; + AccessibleRelation aAccRel(AccessibleRelationType_CONTENT_FLOWS_FROM, aSequence); + pHelper->AddRelation( aAccRel ); + } - const SwContentFrame* pNextContentFrame( pTextFrame->FindNextCnt( true ) ); - if ( pNextContentFrame ) - { - uno::Sequence<uno::Reference<XAccessible>> aSequence { GetMap()->GetContext(pNextContentFrame) }; - AccessibleRelation aAccRel(AccessibleRelationType_CONTENT_FLOWS_TO, aSequence); - pHelper->AddRelation( aAccRel ); - } + const SwContentFrame* pNextContentFrame( pTextFrame->FindNextCnt( true ) ); + if ( pNextContentFrame ) + { + uno::Sequence<uno::Reference<XAccessible>> aSequence { GetMap()->GetContext(pNextContentFrame) }; + AccessibleRelation aAccRel(AccessibleRelationType_CONTENT_FLOWS_TO, aSequence); + pHelper->AddRelation( aAccRel ); } return pHelper;