diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2020-10-16 13:41:28 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-10-19 14:19:34 +0200 |
commit | f1d798151048dde3f48b124ef406416668d1e9c5 (patch) | |
tree | 033f84ba3868dc727be5261ced54b0bb581bc95a /xmloff | |
parent | 73b115b1a399f57efd727eb71d7ef9e4a27afbc9 (diff) |
tdf#137585 Chart ODF: fix export of DataLabelPlacement::CUSTOM
Saving .ods, the DataLabelPlacement::CUSTOM converted to
the default "avoid-overlap" instead of the requested "outside".
Follow-up of commit 20da1a5dd37c7edac620566c992d5a53b23a5f12
(tdf#134978 Chart OOXML Import: fix pie chart label custom position)
Change-Id: Ib15c7f24e0a650c84e6afce08b84e7eece8dafea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104430
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 07a1019ccc71..723c07fe15c4 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -63,6 +63,7 @@ #include <com/sun/star/chart/ChartLegendExpansion.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/chart/ChartAxisAssign.hpp> +#include <com/sun/star/chart/DataLabelPlacement.hpp> #include <com/sun/star/chart/TimeIncrement.hpp> #include <com/sun/star/chart/TimeInterval.hpp> #include <com/sun/star/chart/TimeUnit.hpp> @@ -3407,6 +3408,17 @@ void SchXMLExportHelper_Impl::exportDataPoints( mxExpPropMapper); } + if (nCurrentODFVersion & SvtSaveOptions::ODFSVER_EXTENDED) + { + sal_Int32 nPlacement = 0; + xPropSet->getPropertyValue("LabelPlacement") >>= nPlacement; + if (nPlacement == chart::DataLabelPlacement::CUSTOM) + { + xPropSet->setPropertyValue("LabelPlacement", + uno::Any(chart::DataLabelPlacement::OUTSIDE)); + } + } + aPropertyStates = mxExpPropMapper->Filter(xPropSet); if (!aPropertyStates.empty() || !aDataLabelPropertyStates.empty()) { |