13#include <oox/token/namespaces.hxx>
14#include <oox/token/tokens.hxx>
25 maURI =
"{05C60535-1F16-4fd2-B633-F4F36F0B64E0}";
30 auto& rDocument =
GetDoc();
32 auto* pSparklineList = rDocument.GetSparklineList(
GetCurrScTab());
36 auto const& rSparklineGroups = pSparklineList->getSparklineGroups();
39 rWorksheet->startElement(XML_ext,
FSNS(XML_xmlns, XML_x14),
42 rWorksheet->startElementNS(XML_x14, XML_sparklineGroups,
FSNS(XML_xmlns, XML_xm),
45 for (
auto const& pSparklineGroup : rSparklineGroups)
47 auto const& rSparklineVector = pSparklineList->getSparklinesFor(pSparklineGroup);
51 rWorksheet->endElementNS(XML_x14, XML_sparklineGroups);
52 rWorksheet->endElement(XML_ext);
60 pAttrList->add(XML_lineWeight, OString::number(rAttributes.
getLineWeight()));
71 pAttrList->add(XML_dateAxis,
"1");
76 pAttrList->add(XML_displayEmptyCellsAs,
"gap");
78 pAttrList->add(XML_displayEmptyCellsAs,
"span");
82 pAttrList->add(XML_markers,
"1");
84 pAttrList->add(XML_high,
"1");
85 if (rAttributes.
isLow())
86 pAttrList->add(XML_low,
"1");
88 pAttrList->add(XML_first,
"1");
90 pAttrList->add(XML_last,
"1");
92 pAttrList->add(XML_negative,
"1");
94 pAttrList->add(XML_displayXAxis,
"1");
96 pAttrList->add(XML_displayHidden,
"1");
101 pAttrList->add(XML_minAxisType,
"group");
103 pAttrList->add(XML_minAxisType,
"custom");
109 pAttrList->add(XML_maxAxisType,
"group");
111 pAttrList->add(XML_maxAxisType,
"custom");
115 pAttrList->add(XML_rightToLeft,
"1");
118 pAttrList->add(XML_manualMax, OString::number(*rAttributes.
getManualMax()));
121 pAttrList->add(XML_manualMin, OString::number(*rAttributes.
getManualMin()));
129 rWorksheet->singleElementNS(XML_x14, XML_colorSeries, XML_rgb,
134 rWorksheet->singleElementNS(XML_x14, XML_colorNegative, XML_rgb,
140 rWorksheet->singleElementNS(XML_x14, XML_colorAxis, XML_rgb,
146 rWorksheet->singleElementNS(XML_x14, XML_colorMarkers, XML_rgb,
152 rWorksheet->singleElementNS(XML_x14, XML_colorFirst, XML_rgb,
158 rWorksheet->singleElementNS(XML_x14, XML_colorLast, XML_rgb,
164 rWorksheet->singleElementNS(XML_x14, XML_colorHigh, XML_rgb,
170 rWorksheet->singleElementNS(XML_x14, XML_colorLow, XML_rgb,
176 std::vector<std::shared_ptr<sc::Sparkline>>
const& rSparklines)
185 pAttrList->addNS(XML_xr2, XML_uid, sUID);
190 rWorksheet->startElementNS(XML_x14, XML_sparklineGroup, pAttrList);
196 rWorksheet->startElementNS(XML_x14, XML_sparklines);
197 for (
auto const& rSparkline : rSparklines)
199 rWorksheet->startElementNS(XML_x14, XML_sparkline);
202 rWorksheet->startElementNS(XML_xm, XML_f);
204 OUString sRangeFormula;
206 rSparkline->getInputRange().Format(sRangeFormula, eFlags,
GetDoc(),
209 rWorksheet->writeEscaped(sRangeFormula);
210 rWorksheet->endElementNS(XML_xm, XML_f);
214 rWorksheet->startElementNS(XML_xm, XML_sqref);
220 rWorksheet->writeEscaped(sLocation);
221 rWorksheet->endElementNS(XML_xm, XML_sqref);
224 rWorksheet->endElementNS(XML_x14, XML_sparkline);
226 rWorksheet->endElementNS(XML_x14, XML_sparklines);
227 rWorksheet->endElementNS(XML_x14, XML_sparklineGroup);
233 auto& rDocument =
GetDoc();
234 auto* pSparklineList = rDocument.GetSparklineList(
GetCurrScTab());
235 if (pSparklineList && !pSparklineList->getSparklineGroups().empty())
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
Base class for ext entries.
Access to global data from other classes.
const XclExpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
sax_fastparser::FSHelperPtr & GetCurrentStream()
SCTAB GetCurrScTab() const
Returns the current Calc sheet index.
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
static OString ToOString(const Color &rColor)
OUString getNamespaceURL(sal_Int32 nNSID) const
static rtl::Reference< FastAttributeList > createAttrList()
Common properties for a group of sparklines.
DisplayEmptyCellsAs getDisplayEmptyCellsAs() const
std::optional< double > getManualMax() const
bool shouldDisplayXAxis() const
bool shouldDisplayHidden() const
Color getColorHigh() const
SparklineType getType() const
Color getColorAxis() const
Color getColorNegative() const
bool isRightToLeft() const
Color getColorMarkers() const
AxisType getMaxAxisType() const
Color getColorFirst() const
AxisType getMinAxisType() const
std::optional< double > getManualMin() const
Color getColorLast() const
double getLineWeight() const
Line weight or width in points.
Color getColorSeries() const
Color getColorLow() const
Common properties for a group of sparklines.
SparklineAttributes & getAttributes()
SparklineBuffer(const XclExpRoot &rRoot, const XclExtLstRef &xExtLst)
Export for sparkline type of <ext> element - top sparkline element.
static void addSparklineGroupAttributes(rtl::Reference< sax_fastparser::FastAttributeList > &pAttrList, sc::SparklineAttributes &rSparklineAttributes)
static void addSparklineGroupColors(XclExpXmlStream &rStream, sc::SparklineAttributes &rSparklineAttributes)
void addSparklineGroup(XclExpXmlStream &rStream, sc::SparklineGroup &rSparklineGroup, std::vector< std::shared_ptr< sc::Sparkline > > const &rSparklines)
void SaveXml(XclExpXmlStream &rStream) override
SparklineExt(const XclExpRoot &rRoot)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
std::shared_ptr< FastSerializerHelper > FSHelperPtr