diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-06-09 14:32:53 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-06-10 10:51:05 -0400 |
commit | 1eccdc5c39587d4019cb4c88f8483b1fe14d5dda (patch) | |
tree | b6fc52ab5538107c06deed1aafdd5f0bc341f0a0 /sw | |
parent | aa23371ba3d257fb590aae9e0ebee35d7da80c97 (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.
(cherry picked from commit c5539bb585370f095cb6c09e38a7dd005d237295)
Conflicts:
chart2/source/model/main/ChartModel_Persistence.cxx
sc/source/ui/drawfunc/fuins2.cxx
sw/source/uibase/table/tablemgr.cxx
Change-Id: Id29659c3885ec1e06bed26d2c851123fb63072cc
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/table/tablemgr.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/ui/table/tablemgr.cxx b/sw/source/ui/table/tablemgr.cxx index 947e3ddaa61e..26871ee7f7f6 100644 --- a/sw/source/ui/table/tablemgr.cxx +++ b/sw/source/ui/table/tablemgr.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/chart/ChartDataRowSource.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/beans/PropertyState.hpp> #include <sot/storage.hxx> @@ -243,7 +244,14 @@ uno::Reference< frame::XModel > SwTableFUNC::InsertChart( { xChartModel.set( xCompSupp->getComponent(), uno::UNO_QUERY ); if( xChartModel.is() ) + { + // Create a default chart type. + uno::Reference<chart2::XChartDocument> xChartDoc(xChartModel, uno::UNO_QUERY); + if (xChartDoc.is()) + xChartDoc->createDefaultChart(); + xChartModel->lockControllers(); //#i79578# don't request a new replacement image for charts to often - block change notifications + } } // set the table name at the OLE-node |