diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-07 20:32:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-08 11:01:31 +0200 |
commit | ff25a4a6f4b9763b09abbbd6a711fa4d18f40ade (patch) | |
tree | ded29238e8fb782c20b429f6d5df6c40a3bb2604 /framework/source/helper/ocomponentaccess.cxx | |
parent | 32343bcbb786168df62f85a57e30c620c3d3bdb4 (diff) |
loplugin:flatten in framework
Change-Id: I2a74a7543b5edd853396efa31a3e2568e6607778
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91848
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/helper/ocomponentaccess.cxx')
-rw-r--r-- | framework/source/helper/ocomponentaccess.cxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/framework/source/helper/ocomponentaccess.cxx b/framework/source/helper/ocomponentaccess.cxx index b170ae5258a0..b814fc49b83a 100644 --- a/framework/source/helper/ocomponentaccess.cxx +++ b/framework/source/helper/ocomponentaccess.cxx @@ -109,24 +109,24 @@ void OComponentAccess::impl_collectAllChildComponents( const css::uno::Referenc std::vector< css::uno::Reference< XComponent > >& seqComponents ) { // If valid node was given ... - if( xNode.is() ) - { - // ... continue collection at these. + if( !xNode.is() ) + return; + + // ... continue collection at these. - // Get the container of current node, collect the components of existing child frames - // and go down to next level in tree (recursive!). + // Get the container of current node, collect the components of existing child frames + // and go down to next level in tree (recursive!). - const css::uno::Reference< XFrames > xContainer = xNode->getFrames(); - const Sequence< css::uno::Reference< XFrame > > seqFrames = xContainer->queryFrames( FrameSearchFlag::CHILDREN ); + const css::uno::Reference< XFrames > xContainer = xNode->getFrames(); + const Sequence< css::uno::Reference< XFrame > > seqFrames = xContainer->queryFrames( FrameSearchFlag::CHILDREN ); - const sal_Int32 nFrameCount = seqFrames.getLength(); - for( sal_Int32 nFrame=0; nFrame<nFrameCount; ++nFrame ) + const sal_Int32 nFrameCount = seqFrames.getLength(); + for( sal_Int32 nFrame=0; nFrame<nFrameCount; ++nFrame ) + { + css::uno::Reference< XComponent > xComponent = impl_getFrameComponent( seqFrames[nFrame] ); + if( xComponent.is() ) { - css::uno::Reference< XComponent > xComponent = impl_getFrameComponent( seqFrames[nFrame] ); - if( xComponent.is() ) - { - seqComponents.push_back( xComponent ); - } + seqComponents.push_back( xComponent ); } } // ... otherwise break a recursive path and go back at current stack! |