diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-06-09 14:32:53 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-07-15 23:44:08 +0200 |
commit | 0e3826d08d7a7d54dd532319fb584008eb0e24c8 (patch) | |
tree | b24ee7faea7ab5ca895742ea21b98910f2ab41ba /sd | |
parent | 388f2fa9fcabe1b2adaff282fa9509216f3af6de (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)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Conflicts:
chart2/source/model/main/ChartModel_Persistence.cxx
sc/source/ui/drawfunc/fuins2.cxx
sw/source/uibase/table/tablemgr.cxx
Change-Id: Id29659c3885ec1e06bed26d2c851123fb63072cc
(cherry picked from commit 1eccdc5c39587d4019cb4c88f8483b1fe14d5dda)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/func/fuinsert.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index 886be3490eab..1606c33757a2 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -25,6 +25,7 @@ #include <toolkit/helper/vclunohelper.hxx> #include <svx/svxdlg.hxx> #include <com/sun/star/embed/NoVisualAreaSizeException.hpp> +#include <com/sun/star/embed/XComponentSupplier.hpp> #include <com/sun/star/embed/Aspects.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> @@ -274,6 +275,15 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) GetEmbeddedObjectContainer().CreateEmbeddedObject( aName.GetByteSequence(), aObjName ); if ( xObj.is() ) { + uno::Reference<embed::XComponentSupplier> xCompSupp(xObj, uno::UNO_QUERY); + if (xCompSupp.is()) + { + // Create default chart type. + uno::Reference<chart2::XChartDocument> xChartDoc(xCompSupp->getComponent(), uno::UNO_QUERY); + if (xChartDoc.is()) + xChartDoc->createDefaultChart(); + } + sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT; MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ); |