Lines 31-36
Link Here
|
31 |
#include <com/sun/star/util/XCloseable.hpp> |
31 |
#include <com/sun/star/util/XCloseable.hpp> |
32 |
#include <com/sun/star/util/XModifiable.hpp> |
32 |
#include <com/sun/star/util/XModifiable.hpp> |
33 |
#include <com/sun/star/document/XEventBroadcaster.hpp> |
33 |
#include <com/sun/star/document/XEventBroadcaster.hpp> |
|
|
34 |
#include <com/sun/star/chart2/XChartDocument.hpp> // #i119941 |
34 |
#include <cppuhelper/implbase1.hxx> |
35 |
#include <cppuhelper/implbase1.hxx> |
35 |
|
36 |
|
36 |
#include <cppuhelper/implbase2.hxx> |
37 |
#include <cppuhelper/implbase2.hxx> |
Lines 355-361
Link Here
|
355 |
if ( xChild.is() ) |
356 |
if ( xChild.is() ) |
356 |
xChild->setParent( 0 ); |
357 |
xChild->setParent( 0 ); |
357 |
|
358 |
|
358 |
pCnt->RemoveEmbeddedObject( aOLEObj.aName, sal_False ); |
359 |
/* #i119941: When cut or move the chart, SwUndoFlyBase::DelFly will call SaveSection to store the comtent to strorage. |
|
|
360 |
In this step, chart filter functions will be called. And chart filter will call chart core functions to create the chart again. |
361 |
Then chart core function will call the class ExplicitCategoryProvider to create data source. |
362 |
In this step, when SW data source provider create the data source, it will create a new SwFlyFrm. |
363 |
But later in SwUndoFlyBase::DelFly, it will clear anchor related attributes of SwFlyFrm. Then finally null pointer occur. |
364 |
Resolution: |
365 |
In pCnt->RemoveEmbeddedObject in SaveSection process of table chart, only remove the object from the object container, |
366 |
without removing it's storage and graphic stream. The chart already removed from formatter.> */ |
367 |
sal_Bool bChartWithInternalProvider = sal_False; |
368 |
sal_Bool bKeepObjectToTempStorage = sal_True; |
369 |
uno::Reference < embed::XEmbeddedObject > xIP = GetOLEObj().GetOleRef(); |
370 |
if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) ) |
371 |
{ |
372 |
uno::Reference< chart2::XChartDocument > xChart( xIP->getComponent(), UNO_QUERY ); |
373 |
if ( xChart.is() && xChart->hasInternalDataProvider() ) |
374 |
bChartWithInternalProvider = sal_True; |
375 |
} |
376 |
|
377 |
if ( IsChart() && sChartTblName.Len() && !bChartWithInternalProvider ) |
378 |
bKeepObjectToTempStorage = sal_False; |
379 |
pCnt->RemoveEmbeddedObject( aOLEObj.aName, sal_False, bKeepObjectToTempStorage ); |
380 |
// modify end |
359 |
|
381 |
|
360 |
// TODO/LATER: aOLEObj.aName has no meaning here, since the undo container contains the object |
382 |
// TODO/LATER: aOLEObj.aName has no meaning here, since the undo container contains the object |
361 |
// by different name, in future it might makes sence that the name is transported here. |
383 |
// by different name, in future it might makes sence that the name is transported here. |