summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2018-02-19 18:18:20 +0100
committerAndras Timar <andras.timar@collabora.com>2018-02-28 09:08:02 +0100
commita7699baf74cbc97e4ee609fd1862e4e8fff2ed5d (patch)
treea83a93ed9e361d611a668e077af405ab17542a18 /oox
parent1b1f416244ace9ab3eb532cc4ab242486cd1930d (diff)
tdf#115859 Export number format for chart series
Change-Id: I65d30c6b92a530eadbd6fabe87fa8bd3416fee20 Reviewed-on: https://gerrit.libreoffice.org/50392 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 2592c74fd2e6..b9a703cafd4b 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3079,6 +3079,24 @@ void ChartExport::exportDataLabels(
FSHelperPtr pFS = GetFS();
pFS->startElement(FSNS(XML_c, XML_dLbls), FSEND);
+ bool bLinkedNumFmt = true;
+ if (GetProperty(xPropSet, "LinkNumberFormatToSource"))
+ mAny >>= bLinkedNumFmt;
+
+ if (GetProperty(xPropSet, "NumberFormat"))
+ {
+ sal_Int32 nKey = 0;
+ mAny >>= nKey;
+
+ OUString aNumberFormatString = getNumberFormatCode(nKey);
+ OString sNumberFormatString = OUStringToOString(aNumberFormatString, RTL_TEXTENCODING_UTF8);
+
+ pFS->singleElement(FSNS(XML_c, XML_numFmt),
+ XML_formatCode, sNumberFormatString.getStr(),
+ XML_sourceLinked, bLinkedNumFmt ? "1" : "0",
+ FSEND);
+ }
+
uno::Sequence<sal_Int32> aAttrLabelIndices;
xPropSet->getPropertyValue("AttributedDataPoints") >>= aAttrLabelIndices;