diff options
author | Muthu Subramanian <sumuthu@suse.com> | 2013-07-09 13:31:16 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@suse.com> | 2013-07-09 13:43:15 +0530 |
commit | 7da06efd74be6500895bab6e5e8ed485914ff45e (patch) | |
tree | fbce788eca9357990907977fdcf4a134b030bbaf /oox | |
parent | 00d8a4071628a88465f13d2e860ccd87c3a85b9e (diff) |
n#819822: XLSX Chart import with internal data table.
When the import with xlsx ranges fail - try with
internal data table.
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 0d3a2868dd3e..96a67d6547fa 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -52,6 +52,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <com/sun/star/document/XActionLockable.hpp> +#include <com/sun/star/chart2/data/XDataReceiver.hpp> using namespace ::oox::core; using namespace ::com::sun::star; @@ -711,7 +712,21 @@ void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >& if( !mxChartShapeInfo->mbEmbedShapes ) xExternalPage = rxShapes; if( rFilter.getChartConverter() ) + { rFilter.getChartConverter()->convertFromModel( rFilter, aModel, xChartDoc, xExternalPage, mxShape->getPosition(), mxShape->getSize() ); + if( !xChartDoc->hasInternalDataProvider() ) + { + Reference< chart2::data::XDataReceiver > xDataRec( xChartDoc, UNO_QUERY ); + Reference< chart2::data::XDataSource > xData( xDataRec->getUsedData(), UNO_QUERY ); + if( xData->getDataSequences()[0]->getValues()->getData().getLength() <= 0 ) + { + rFilter.useInternalChartDataTable( true ); + rFilter.getChartConverter()->convertFromModel( rFilter, aModel, xChartDoc, xExternalPage, mxShape->getPosition(), mxShape->getSize() ); + rFilter.useInternalChartDataTable( false ); + } + } + + } } catch( Exception& ) { |