Kaydet (Commit) c2db702c authored tarafından Caolán McNamara's avatar Caolán McNamara

unroll complex if statement assigns

Change-Id: I462095f6b912bc3442c232f003278efc3f5c347e
Reviewed-on: https://gerrit.libreoffice.org/59107
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 9d31badc
......@@ -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 );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment