[Libreoffice-commits] core.git: sw/source

Michael Stahl mstahl at redhat.com
Mon Apr 7 01:40:17 PDT 2014


 sw/source/core/ole/ndole.cxx |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 206848294f686a0ccf4c741d7e92a2314a88ea48
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Apr 7 10:21:05 2014 +0200

    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)
    
    Change-Id: I3c64444b6cf4d4f791cafc77ec1f9b2b0150ad1b

diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 789929a..8208613 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -328,7 +328,6 @@ 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
@@ -336,7 +335,8 @@ bool SwOLENode::SavePersistentData()
               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.
+              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:
@@ -344,18 +344,18 @@ bool SwOLENode::SavePersistentData()
               only remove the object from the object container, without removing it's
               storage and graphic stream. The chart already removed from formatter.
             */
-            bool bChartWithInternalProvider = false;
+            bool bKeepObjectToTempStorage = true;
             uno::Reference < embed::XEmbeddedObject > xIP = GetOLEObj().GetOleRef();
-            if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
+            if (IsChart() && !sChartTblName.isEmpty()
+                && svt::EmbeddedObjectRef::TryRunningState(xIP))
             {
                 uno::Reference< chart2::XChartDocument > xChart( xIP->getComponent(), UNO_QUERY );
-                if ( xChart.is() && xChart->hasInternalDataProvider() )
-                    bChartWithInternalProvider = true;
+                if (xChart.is() && !xChart->hasInternalDataProvider())
+                {
+                    bKeepObjectToTempStorage = false;
+                }
             }
 
-            const bool bKeepObjectToTempStorage = !IsChart() ||
-                                                  sChartTblName.isEmpty() ||
-                                                  bChartWithInternalProvider;
             pCnt->RemoveEmbeddedObject( aOLEObj.aName, false, bKeepObjectToTempStorage );
             // modify end
 


More information about the Libreoffice-commits mailing list