diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-04-07 10:21:05 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-04-08 14:47:19 +0200 |
commit | 2cd7c4f2c16be7b230e8e5919b46a5d911b050b9 (patch) | |
tree | c62393d6903a74c6ce69961fcedcbb61a1923e65 | |
parent | f8218676b976f4648028fbce504a0d48b58af31a (diff) |
fdo#76298: sw: do not start up every OLE object on deletion
First check if it's actually a Chart embedded object; starting up
external processes on Windows for arbitrary OLEs is likely expensive.
(regression from 1ba29be90f7141077f2d079d40dffc2efd4f1a2c)
(cherry picked from commit 206848294f686a0ccf4c741d7e92a2314a88ea48)
Conflicts:
sw/source/core/ole/ndole.cxx
Conflicts:
sw/source/core/ole/ndole.cxx
Change-Id: I3c64444b6cf4d4f791cafc77ec1f9b2b0150ad1b
Reviewed-on: https://gerrit.libreoffice.org/8882
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/core/ole/ndole.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index 1f74ff5aed50..3e21ec05c7b4 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -340,27 +340,28 @@ sal_Bool SwOLENode::SavePersistentData() if ( xChild.is() ) xChild->setParent( 0 ); - // pCnt->RemoveEmbeddedObject( aOLEObj.aName, sal_False ); /* #i119941: When cut or move the chart, SwUndoFlyBase::DelFly will call SaveSection to store the comtent to strorage. In this step, chart filter functions will be called. And chart filter will call chart core functions to create the chart again. Then chart core function will call the class ExplicitCategoryProvider to create data source. - In this step, when SW data source provider create the data source, it will create a new SwFlyFrm. + In this step, when SW + source provider create the data source, an UnoActionRemoveContext + will mess with the layout and create a new SwFlyFrm. But later in SwUndoFlyBase::DelFly, it will clear anchor related attributes of SwFlyFrm. Then finally null pointer occur. Resolution: In pCnt->RemoveEmbeddedObject in SaveSection process of table chart, only remove the object from the object container, without removing it's storage and graphic stream. The chart already removed from formatter.> */ - sal_Bool bChartWithInternalProvider = sal_False; sal_Bool bKeepObjectToTempStorage = sal_True; uno::Reference < embed::XEmbeddedObject > xIP = GetOLEObj().GetOleRef(); - if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) ) + if (IsChart() && sChartTblName.Len() + && svt::EmbeddedObjectRef::TryRunningState(xIP)) { uno::Reference< chart2::XChartDocument > xChart( xIP->getComponent(), UNO_QUERY ); - if ( xChart.is() && xChart->hasInternalDataProvider() ) - bChartWithInternalProvider = sal_True; + if (xChart.is() && !xChart->hasInternalDataProvider()) + { + bKeepObjectToTempStorage = sal_False; + } } - if ( IsChart() && sChartTblName.Len() && !bChartWithInternalProvider ) - bKeepObjectToTempStorage = sal_False; pCnt->RemoveEmbeddedObject( aOLEObj.aName, sal_False, bKeepObjectToTempStorage ); // modify end |