summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2020-02-10 14:22:11 +0100
committerLászló Németh <nemeth@numbertext.org>2020-02-17 17:58:40 +0100
commit5339d0800ccdcd325294e61f8ae9e67648beb035 (patch)
treed61a9f4c877acde76f727e17a3b23ce565618bc3 /oox
parent2658b0e5ffdff795d910f373feb5c55ad01b7d09 (diff)
tdf#130590 Chart OOXML export: fix custom label position
in case of all chart types except pie chart. Follow-up of commit 4223ff2be69f03e571464b0b09ad0d278918631b (tdf#48436 Chart: add CustomLabelPosition UNO API property) Change-Id: I3ff1ca13928315f27988ae27c462a2f05354bc49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88371 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 8debc8d047c3..ae33fdcdd222 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3416,6 +3416,25 @@ void ChartExport::exportDataLabels(
pFS->startElement(FSNS(XML_c, XML_dLbl));
pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, OString::number(nIdx));
+ // export custom position of data label
+ if( eChartType != chart::TYPEID_PIE )
+ {
+ chart2::RelativePosition aCustomLabelPosition;
+ if( xLabelPropSet->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition )
+ {
+ pFS->startElement(FSNS(XML_c, XML_layout));
+ pFS->startElement(FSNS(XML_c, XML_manualLayout));
+
+ pFS->singleElement(FSNS(XML_c, XML_x), XML_val, OString::number(aCustomLabelPosition.Primary));
+ pFS->singleElement(FSNS(XML_c, XML_y), XML_val, OString::number(aCustomLabelPosition.Secondary));
+
+ SAL_WARN_IF(aCustomLabelPosition.Anchor != css::drawing::Alignment_TOP_LEFT, "oox", "unsupported anchor position");
+
+ pFS->endElement(FSNS(XML_c, XML_manualLayout));
+ pFS->endElement(FSNS(XML_c, XML_layout));
+ }
+ }
+
if( xLabelPropSet->getPropertyValue("Label") >>= aLabel )
bLabelIsNumberFormat = aLabel.ShowNumber;
else