summaryrefslogtreecommitdiff
path: root/sd/source/ui/func/fuinsert.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/func/fuinsert.cxx')
-rw-r--r--sd/source/ui/func/fuinsert.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 88eb7af439e2..c16e6fc0e62b 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>
@@ -289,6 +290,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 ) );