diff options
Diffstat (limited to 'chart2/source/model/main/Diagram.cxx')
-rwxr-xr-x | chart2/source/model/main/Diagram.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index aac706ab0c91..322e84e1bc11 100755 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -33,6 +33,7 @@ #include "Wall.hxx" #include "UserDefinedProperties.hxx" #include "ConfigColorScheme.hxx" +#include "DiagramHelper.hxx" #include "ContainerHelper.hxx" #include "ThreeDHelper.hxx" #include "CloneHelper.hxx" @@ -427,6 +428,22 @@ void SAL_CALL Diagram::setDefaultColorScheme( const Reference< chart2::XColorSch fireModifyEvent(); } +void SAL_CALL Diagram::setDiagramData( + const Reference< chart2::data::XDataSource >& xDataSource, + const Sequence< beans::PropertyValue >& aArguments ) + throw (uno::RuntimeException) +{ + uno::Reference< lang::XMultiServiceFactory > xChartTypeManager( m_xContext->getServiceManager()->createInstanceWithContext( + C2U( "com.sun.star.chart2.ChartTypeManager" ), m_xContext ), uno::UNO_QUERY ); + DiagramHelper::tTemplateWithServiceName aTemplateAndService = DiagramHelper::getTemplateForDiagram( this, xChartTypeManager ); + uno::Reference< chart2::XChartTypeTemplate > xTemplate( aTemplateAndService.first ); + if( !xTemplate.is() ) + xTemplate.set( xChartTypeManager->createInstance( C2U("com.sun.star.chart2.template.Column") ), uno::UNO_QUERY ); + if(!xTemplate.is()) + return; + xTemplate->changeDiagramData( this, xDataSource, aArguments ); +} + // ____ XTitled ____ uno::Reference< chart2::XTitle > SAL_CALL Diagram::getTitleObject() throw (uno::RuntimeException) |