diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx index 7d1edcdb96bc..ecabba2bcb4d 100644 --- a/chart2/inc/ChartModel.hxx +++ b/chart2/inc/ChartModel.hxx @@ -223,6 +223,8 @@ private: void impl_adjustAdditionalShapesPositionAndSize( const ::com::sun::star::awt::Size& aVisualAreaSize ); + void insertDefaultChart(); + public: //no default constructor ChartModel(::com::sun::star::uno::Reference< @@ -434,6 +436,8 @@ public: getPageBackground() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; + virtual void SAL_CALL createDefaultChart() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; + // ____ XDataReceiver (public API) ____ virtual void SAL_CALL attachDataProvider( const ::com::sun::star::uno::Reference< diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index 8da9ed76c9df..833ea95df316 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -958,6 +958,12 @@ uno::Reference< beans::XPropertySet > SAL_CALL ChartModel::getPageBackground() return m_xPageBackground; } +void SAL_CALL ChartModel::createDefaultChart() + throw (css::uno::RuntimeException, std::exception) +{ + insertDefaultChart(); +} + // ____ XTitled ____ uno::Reference< chart2::XTitle > SAL_CALL ChartModel::getTitleObject() throw (uno::RuntimeException, std::exception) diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx index ca3a2df1e2aa..87f74d7d4a54 100644 --- a/chart2/source/model/main/ChartModel_Persistence.cxx +++ b/chart2/source/model/main/ChartModel_Persistence.cxx @@ -385,12 +385,7 @@ void ChartModel::impl_store( } } -// frame::XLoadable -void SAL_CALL ChartModel::initNew() - throw (frame::DoubleInitializationException, - io::IOException, - uno::Exception, - uno::RuntimeException, std::exception) +void ChartModel::insertDefaultChart() { lockControllers(); createInternalDataProvider( sal_False ); @@ -486,6 +481,15 @@ void SAL_CALL ChartModel::initNew() unlockControllers(); } +// frame::XLoadable +void SAL_CALL ChartModel::initNew() + throw (frame::DoubleInitializationException, + io::IOException, + uno::Exception, + uno::RuntimeException, std::exception) +{ +} + void SAL_CALL ChartModel::load( const Sequence< beans::PropertyValue >& rMediaDescriptor ) throw (frame::DoubleInitializationException, diff --git a/offapi/com/sun/star/chart2/XChartDocument.idl b/offapi/com/sun/star/chart2/XChartDocument.idl index 217d7fa38109..0055cbb83fd2 100644 --- a/offapi/com/sun/star/chart2/XChartDocument.idl +++ b/offapi/com/sun/star/chart2/XChartDocument.idl @@ -123,6 +123,10 @@ interface XChartDocument : ::com::sun::star::frame::XModel XDiagram::getWall().
*/ com::sun::star::beans::XPropertySet getPageBackground(); + + /** Creates a default chart type for a brand-new chart object. + */ + void createDefaultChart(); }; } ; // chart2 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