summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-15 14:13:02 +0100
committerAndras Timar <andras.timar@collabora.com>2018-11-13 21:06:27 +0100
commitfcea07243eb4c2aea3db928bce69c53ce19b3f65 (patch)
tree4207e22d8d12c57a74a870fd1d2f1ab518c9d18b
parentf712c91f34534462feba5a4a9217122ce332a671 (diff)
outer loop unrelated to inner loop
since original checkin of... commit 9cddf9da7fb256418e1bc3b4719abb55e3b0604c 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/59112 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit eadf6f4551416430b58efc42a5756556df0a237d) (cherry picked from commit 74de907344923a9f9575927fca8d43260f86f4c9) (cherry picked from commit c7b0292184c0942ca00633b88e76367092f3ea91) (cherry picked from commit d20db10442dcc6c0c93d11219c1e60ba6d91245f)
-rw-r--r--sw/source/core/unocore/unochart.cxx47
1 files changed, 17 insertions, 30 deletions
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 8ae7d5bc8652..a8f8898507e3 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -119,43 +119,30 @@ void SwChartLockController_Helper::LockUnlockAllCharts( bool bLock )
if (!pDoc)
return;
- const SwFrameFormats& rTableFormats = *pDoc->GetTableFrameFormats();
- for( size_t n = 0; n < rTableFormats.size(); ++n )
+ uno::Reference< frame::XModel > xRes;
+ SwOLENode *pONd;
+ SwStartNode *pStNd;
+ SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
+ while( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) )
{
- SwTable* pTmpTable;
- const SwTableNode* pTableNd;
- const SwFrameFormat* pFormat = rTableFormats[ n ];
-
- if( nullptr != ( pTmpTable = SwTable::FindTable( pFormat ) ) &&
- nullptr != ( pTableNd = pTmpTable->GetTableNode() ) &&
- pTableNd->GetNodes().IsDocNodes() )
+ ++aIdx;
+ if (nullptr != ( pONd = aIdx.GetNode().GetOLENode() ) &&
+ !pONd->GetChartTableName().isEmpty() /* is chart object? */)
{
- uno::Reference< frame::XModel > xRes;
- SwOLENode *pONd;
- SwStartNode *pStNd;
- SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
- while( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) )
+ uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef();
+ if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
{
- ++aIdx;
- if (nullptr != ( pONd = aIdx.GetNode().GetOLENode() ) &&
- !pONd->GetChartTableName().isEmpty() /* is chart object? */)
+ xRes.set( xIP->getComponent(), uno::UNO_QUERY );
+ if (xRes.is())
{
- uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef();
- if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
- {
- 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 );
}
bIsLocked = bLock;