From c5539bb585370f095cb6c09e38a7dd005d237295 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 9 Jun 2014 14:32:53 -0400 Subject: 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 --- sc/source/ui/drawfunc/fuins2.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sc/source/ui') 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 #include #include +#include #include #include #include @@ -504,6 +505,10 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* if( xCompSupp.is()) xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY ); + uno::Reference 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() ) -- cgit