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

outer loop unrelated to inner loop

since original checkin of...

commit 9cddf9da
Date:   Tue May 22 15:33:44 2007 +0000

    INTEGRATION: CWS chart2mst3 (1.1.2); FILE ADDED
...
    2006/12/13 12:31:03 tl 1.1.2.38: #i71244# update charts in writer

where I think this LockUnlockAllCharts chart2 loop was modelled on
the previous chart[1] styles loop of e.g. DoUpdateAllCharts which
loop over tables.

chart2 objects are unrelated to these tables, so remove the outer
loop, which then means the ofz#9689 ofz#9856 ofz9874 crashes that
made me look at it will get fixed

Change-Id: I7d7ba0a2aa257b5aa399f20d902f01306fbaecff
Reviewed-on: https://gerrit.libreoffice.org/59110
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 2f058c33
...@@ -117,44 +117,30 @@ void SwChartLockController_Helper::LockUnlockAllCharts( bool bLock ) ...@@ -117,44 +117,30 @@ void SwChartLockController_Helper::LockUnlockAllCharts( bool bLock )
if (!pDoc) if (!pDoc)
return; return;
const SwFrameFormats& rTableFormats = *pDoc->GetTableFrameFormats(); uno::Reference< frame::XModel > xRes;
for( size_t n = 0; n < rTableFormats.size(); ++n ) SwOLENode *pONd;
SwStartNode *pStNd;
SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
while( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) )
{ {
const SwFrameFormat* pFormat = rTableFormats[ n ]; ++aIdx;
SwTable* pTmpTable = SwTable::FindTable(pFormat); if (nullptr != ( pONd = aIdx.GetNode().GetOLENode() ) &&
if (!pTmpTable) !pONd->GetChartTableName().isEmpty() /* is chart object? */)
continue;
const SwTableNode* pTableNd = pTmpTable->GetTableNode();
if (!pTableNd)
continue;
if (!pTableNd->GetNodes().IsDocNodes())
continue;
uno::Reference< frame::XModel > xRes;
SwOLENode *pONd;
SwStartNode *pStNd;
SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
while( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) )
{ {
++aIdx; uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef();
if (nullptr != ( pONd = aIdx.GetNode().GetOLENode() ) && if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
!pONd->GetChartTableName().isEmpty() /* is chart object? */)
{ {
uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef(); xRes.set( xIP->getComponent(), uno::UNO_QUERY );
if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) ) if (xRes.is())
{ {
xRes.set( xIP->getComponent(), uno::UNO_QUERY ); if (bLock)
if (xRes.is()) xRes->lockControllers();
{ else
if (bLock) xRes->unlockControllers();
xRes->lockControllers();
else
xRes->unlockControllers();
}
} }
} }
aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
} }
aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
} }
bIsLocked = bLock; bIsLocked = bLock;
......
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