summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-09 14:32:53 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-06-10 10:02:25 -0400
commitc5539bb585370f095cb6c09e38a7dd005d237295 (patch)
tree6900b98a72398334c04eddc40856799748f429fa /sc/source/ui
parent178550923533b7c015e29d957a2fc3857ba73eb3 (diff)
fdo#79676: Initialize with a default chart only from the UI.
When creating an embedded chart object during import, we don't want to create a default chart which would only mess up the chart data. With this change, ChartModel::initNew() is a no-op. Change-Id: Id29659c3885ec1e06bed26d2c851123fb63072cc
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 09a866a3ca43..52af12f3ad89 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -55,6 +55,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/X3DChartWindowProvider.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
@@ -504,6 +505,10 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
if( xCompSupp.is())
xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY );
+ uno::Reference<chart2::XChartDocument> xChartDoc(xReceiver, uno::UNO_QUERY);
+ if (xChartDoc.is())
+ xChartDoc->createDefaultChart();
+
// lock the model to suppress any internal updates
uno::Reference< frame::XModel > xChartModel( xReceiver, uno::UNO_QUERY );
if( xChartModel.is() )