From 5339d0800ccdcd325294e61f8ae9e67648beb035 Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Mon, 10 Feb 2020 14:22:11 +0100 Subject: tdf#130590 Chart OOXML export: fix custom label position MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: László Németh --- oox/source/export/chartexport.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'oox') 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 -- cgit v1.2.3