sw/source/core/unocore/unochart.cxx | 49 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 24 deletions(-)
New commits: commit c2db702ca3df56bd4a1c26d2171cd0ac5259b973 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Aug 15 14:13:02 2018 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Aug 15 17:17:48 2018 +0200 unroll complex if statement assigns Change-Id: I462095f6b912bc3442c232f003278efc3f5c347e Reviewed-on: https://gerrit.libreoffice.org/59107 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 6c64ef2441ae..8dcc9b13a670 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -120,39 +120,40 @@ void SwChartLockController_Helper::LockUnlockAllCharts( bool bLock ) const SwFrameFormats& rTableFormats = *pDoc->GetTableFrameFormats(); for( size_t n = 0; n < rTableFormats.size(); ++n ) { - SwTable* pTmpTable; - const SwTableNode* pTableNd; const SwFrameFormat* pFormat = rTableFormats[ n ]; + SwTable* pTmpTable = SwTable::FindTable(pFormat); + if (!pTmpTable) + continue; + const SwTableNode* pTableNd = pTmpTable->GetTableNode(); + if (!pTableNd) + continue; + if (!pTableNd->GetNodes().IsDocNodes()) + continue; - if( nullptr != ( pTmpTable = SwTable::FindTable( pFormat ) ) && - nullptr != ( pTableNd = pTmpTable->GetTableNode() ) && - pTableNd->GetNodes().IsDocNodes() ) + uno::Reference< frame::XModel > xRes; + SwOLENode *pONd; + SwStartNode *pStNd; + SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); + while( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) ) { - uno::Reference< frame::XModel > xRes; - SwOLENode *pONd; - SwStartNode *pStNd; - SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); - while( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) ) + ++aIdx; + if (nullptr != ( pONd = aIdx.GetNode().GetOLENode() ) && + !pONd->GetChartTableName().isEmpty() /* is chart object? */) { - ++aIdx; - if (nullptr != ( pONd = aIdx.GetNode().GetOLENode() ) && - !pONd->GetChartTableName().isEmpty() /* is chart object? */) + uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef(); + if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) ) { - uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef(); - if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) ) + xRes.set( xIP->getComponent(), uno::UNO_QUERY ); + if (xRes.is()) { - xRes.set( xIP->getComponent(), uno::UNO_QUERY ); - if (xRes.is()) - { - if (bLock) - xRes->lockControllers(); - else - xRes->unlockControllers(); - } + if (bLock) + xRes->lockControllers(); + else + xRes->unlockControllers(); } } - aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 ); } + aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 ); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits