22#include <com/sun/star/lang/XMultiServiceFactory.hpp>
23#include <com/sun/star/chart2/XChartDocument.hpp>
24#include <com/sun/star/chart2/data/XDataProvider.hpp>
25#include <com/sun/star/chart2/data/XDataReceiver.hpp>
26#include <com/sun/star/chart2/data/XSheetDataProvider.hpp>
28#include <osl/diagnose.h>
40using ::oox::drawingml::chart::DataSequenceModel;
55 Reference< XDataReceiver > xDataRec( rxChartDoc, UNO_QUERY_THROW );
57 "com.sun.star.chart2.data.DataProvider" ), UNO_QUERY_THROW );
58 xDataRec->attachDataProvider( xDataProv );
66 const Reference< XDataProvider >& rxDataProvider,
const DataSequenceModel& rDataSeq,
67 const OUString& ,
const OUString& )
69 Reference< XDataSequence > xDataSeq;
70 if (!rxDataProvider.is())
73 Reference<XSheetDataProvider> xSheetProvider(rxDataProvider, UNO_QUERY);
74 if (!xSheetProvider.is())
77 if (!rDataSeq.maFormula.isEmpty())
87 xDataSeq = xSheetProvider->createDataSequenceByFormulaTokens(aTokens);
91 OSL_FAIL(
"ExcelChartConverter::createDataSequence - cannot create data sequence" );
94 else if (!rDataSeq.maData.empty())
100 for(
const auto& rEntry : rDataSeq.maData )
102 *aMIt = rEntry.second;
107 if (!aRangeRep.isEmpty())
112 xDataSeq = rxDataProvider->createDataSequenceByRangeRepresentation( aRangeRep );
116 OSL_FAIL(
"ExcelChartConverter::createDataSequence - cannot create data sequence" );
HRESULT createInstance(REFIID iid, Ifc **ppIfc)
container_type::iterator iterator
ExcelChartConverter(const WorkbookHelper &rHelper)
virtual css::uno::Reference< css::chart2::data::XDataSequence > createDataSequence(const css::uno::Reference< css::chart2::data::XDataProvider > &rxDataProvider, const oox::drawingml::chart::DataSequenceModel &rDataSeq, const OUString &rRole, const OUString &aRoleQualifier) override
Creates a data sequence from the passed formula.
virtual void createDataProvider(const css::uno::Reference< css::chart2::XChartDocument > &rxChartDoc) override
Creates an external data provider that is able to use spreadsheet data.
virtual ~ExcelChartConverter() override
Helper class to provide access to global workbook data.
sal_Int16 getCurrentSheetIndex() const
Returns the index of the current Calc sheet, if filter currently processes a sheet.
::oox::core::FilterBase & getBaseFilter() const
Returns the base filter object (base class of all filters).
FormulaParser & getFormulaParser() const
Returns a shared import formula parser (import filter only!).
css::uno::Sequence< ApiToken > ApiTokenSequence