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/fwi/uielement/constitemcontainer.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/fwi/uielement/constitemcontainer.cxx')
-rw-r--r-- | framework/source/fwi/uielement/constitemcontainer.cxx | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx index bb901da9226b..d0a621babcd5 100644 --- a/framework/source/fwi/uielement/constitemcontainer.cxx +++ b/framework/source/fwi/uielement/constitemcontainer.cxx @@ -63,51 +63,51 @@ ConstItemContainer::ConstItemContainer( const Reference< XIndexAccess >& rSource { } - if ( rSourceContainer.is() ) + if ( !rSourceContainer.is() ) + return; + + try { - try + sal_Int32 nCount = rSourceContainer->getCount(); + m_aItemVector.reserve(nCount); + if ( bFastCopy ) { - sal_Int32 nCount = rSourceContainer->getCount(); - m_aItemVector.reserve(nCount); - if ( bFastCopy ) + for ( sal_Int32 i = 0; i < nCount; i++ ) { - for ( sal_Int32 i = 0; i < nCount; i++ ) - { - Sequence< PropertyValue > aPropSeq; - if ( rSourceContainer->getByIndex( i ) >>= aPropSeq ) - m_aItemVector.push_back( aPropSeq ); - } + Sequence< PropertyValue > aPropSeq; + if ( rSourceContainer->getByIndex( i ) >>= aPropSeq ) + m_aItemVector.push_back( aPropSeq ); } - else + } + else + { + for ( sal_Int32 i = 0; i < nCount; i++ ) { - for ( sal_Int32 i = 0; i < nCount; i++ ) + Sequence< PropertyValue > aPropSeq; + if ( rSourceContainer->getByIndex( i ) >>= aPropSeq ) { - Sequence< PropertyValue > aPropSeq; - if ( rSourceContainer->getByIndex( i ) >>= aPropSeq ) + sal_Int32 nContainerIndex = -1; + Reference< XIndexAccess > xIndexAccess; + for ( sal_Int32 j = 0; j < aPropSeq.getLength(); j++ ) { - sal_Int32 nContainerIndex = -1; - Reference< XIndexAccess > xIndexAccess; - for ( sal_Int32 j = 0; j < aPropSeq.getLength(); j++ ) + if ( aPropSeq[j].Name == "ItemDescriptorContainer" ) { - if ( aPropSeq[j].Name == "ItemDescriptorContainer" ) - { - aPropSeq[j].Value >>= xIndexAccess; - nContainerIndex = j; - break; - } + aPropSeq[j].Value >>= xIndexAccess; + nContainerIndex = j; + break; } + } - if ( xIndexAccess.is() && nContainerIndex >= 0 ) - aPropSeq[nContainerIndex].Value <<= deepCopyContainer( xIndexAccess ); + if ( xIndexAccess.is() && nContainerIndex >= 0 ) + aPropSeq[nContainerIndex].Value <<= deepCopyContainer( xIndexAccess ); - m_aItemVector.push_back( aPropSeq ); - } + m_aItemVector.push_back( aPropSeq ); } } } - catch ( const IndexOutOfBoundsException& ) - { - } + } + catch ( const IndexOutOfBoundsException& ) + { } } |