22#include <com/sun/star/chart2/XChartDocument.hpp>
23#include <com/sun/star/chart2/data/XDataReceiver.hpp>
24#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
29#include <osl/diagnose.h>
31using ::oox::drawingml::chart::DataSequenceModel;
32using ::com::sun::star::uno::Any;
41using ::oox::core::XmlFilterBase;
49 OSL_ENSURE( !rRow.empty(),
"ChartConverter::lclGenerateApiArray - missing matrix values" );
51 for (
auto aBeg = rRow.begin() + nStart, aIt = aBeg, aEnd = aBeg +
nCount; aIt != aEnd; ++aIt)
59 else if( *aIt >>= aString )
62 aBuffer.append(
"\"" + aString.replaceAll(
u"\"",
u"\"\"") +
"\"" );
68 return aBuffer.makeStringAndClear();
81 const Reference< XShapes >& rxExternalPage,
const awt::Point& rChartPos,
const awt::Size& rChartSize )
83 OSL_ENSURE( rxChartDoc.is(),
"ChartConverter::convertFromModel - missing chart document" );
88 if (xNumberFormatsSupplier.is())
89 xDataReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
91 ConverterRoot aConvBase( rFilter, *
this, rChartModel, rxChartDoc, rChartSize );
101 if( !rxChartDoc->hasInternalDataProvider() )
102 rxChartDoc->createInternalDataProvider(
false );
111 const OUString& rRole,
const OUString& rRoleQualifier )
114 if( rxDataProvider.is() )
117 if( !rDataSeq.
maData.empty() || (rRole ==
"values-y" && rDataSeq.
mnPointCount > 0) )
try
122 for (
auto const& elem : rDataSeq.
maData)
123 aRow.at(elem.first) = elem.second;
129 if (!aRangeRep.isEmpty())
132 xDataSeq = rxDataProvider->createDataSequenceByValueArray(rRole, aRangeRep, rRoleQualifier);
140 OSL_FAIL(
"ChartConverter::createDataSequence - cannot create data sequence" );
const css::uno::Reference< css::frame::XModel > & getModel() const
Returns the document model (always existing).
virtual ~ChartConverter()
void convertFromModel(::oox::core::XmlFilterBase &rFilter, ChartSpaceModel &rChartModel, const css::uno::Reference< css::chart2::XChartDocument > &rxChartDoc, const css::uno::Reference< css::drawing::XShapes > &rxExternalPage, const css::awt::Point &rChartPos, const css::awt::Size &rChartSize)
Converts the passed OOXML chart model to the passed chart2 document.
virtual void createDataProvider(const css::uno::Reference< css::chart2::XChartDocument > &rxChartDoc)
Creates an internal data provider.
virtual css::uno::Reference< css::chart2::data::XDataSequence > createDataSequence(const css::uno::Reference< css::chart2::data::XDataProvider > &rxDataProvider, const DataSequenceModel &rDataSeq, const OUString &rRole, const OUString &aRoleQualifier)
Creates a data sequence from a formula.
void convertFromModel(const css::uno::Reference< css::drawing::XShapes > &rxExternalPage, const css::awt::Point &rChartPos)
Converts the contained OOXML chart model to a chart2 document.
const sal_Unicode API_TOKEN_ARRAY_OPEN
const sal_Unicode API_TOKEN_ARRAY_CLOSE
const sal_Unicode API_TOKEN_ARRAY_COLSEP
static OUString lclGenerateApiArray(const std::vector< Any > &rRow, sal_Int32 nStart, sal_Int32 nCount)
sal_Int32 mnPointCount
Number format for double values.
sal_Int32 mnLevelCount
Number of points in this series source.
std::unique_ptr< char[]> aBuffer