oox/source/export/chartexport.cxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
New commits: commit 134fdada09d328473683f46af2695b616d14f827 Author: Gülşah Köse <[email protected]> AuthorDate: Mon Jan 21 17:31:36 2019 +0300 Commit: Andras Timar <[email protected]> CommitDate: Mon Sep 16 21:22:08 2019 +0200 tdf#122031 Change element order for OOXML compatibility. Change-Id: I8cca2db6157996dd25afa4c95e769725188fdfb9 Signed-off-by: Gülşah Köse <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/66686 Reviewed-by: Markus Mohrhard <[email protected]> Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/78992 Reviewed-by: Andras Timar <[email protected]> Tested-by: Andras Timar <[email protected]> diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 5a1c4589f0b9..123f29776fc9 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -3243,6 +3243,7 @@ void ChartExport::exportDataLabels( continue; pFS->startElement(FSNS(XML_c, XML_dLbl), FSEND); + pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, I32S(nIdx), FSEND); if (GetProperty(xLabelPropSet, "NumberFormat") || GetProperty(xLabelPropSet, "PercentageNumberFormat")) { @@ -3257,7 +3258,6 @@ void ChartExport::exportDataLabels( } // Individual label property that overwrites the baseline. - pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, I32S(nIdx), FSEND); exportTextProps( xPropSet ); writeLabelProperties(pFS, this, xLabelPropSet, aParam); pFS->endElement(FSNS(XML_c, XML_dLbl)); commit e5c10223db1e6f1b29aa2615400e9215e3d5fd03 Author: Gülşah Köse <[email protected]> AuthorDate: Thu Jan 17 09:57:41 2019 +0300 Commit: Andras Timar <[email protected]> CommitDate: Mon Sep 16 21:21:53 2019 +0200 tdf#122031 Export number format of chart label to OOXML The patch fixes missing numFmt. numFmt element has been added as child under the dLbl element. Change-Id: Ic81ac58c2ea087cd7599351034eb4298ee613843 Signed-off-by: Gülşah Köse <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/66493 Reviewed-by: Andras Timar <[email protected]> Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/78991 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index cf6dcab3139c..5a1c4589f0b9 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -3166,7 +3166,7 @@ void ChartExport::exportDataLabels( if (GetProperty(xPropSet, "LinkNumberFormatToSource")) mAny >>= bLinkedNumFmt; - if (GetProperty(xPropSet, "NumberFormat")) + if (GetProperty(xPropSet, "NumberFormat") || GetProperty(xPropSet, "PercentageNumberFormat")) { sal_Int32 nKey = 0; mAny >>= nKey; @@ -3232,15 +3232,31 @@ void ChartExport::exportDataLabels( const sal_Int32* p = aAttrLabelIndices.getConstArray(); const sal_Int32* pEnd = p + aAttrLabelIndices.getLength(); + + for (; p != pEnd; ++p) { sal_Int32 nIdx = *p; uno::Reference<beans::XPropertySet> xLabelPropSet = xSeries->getDataPointByIndex(nIdx); + if (!xLabelPropSet.is()) continue; - // Individual label property that overwrites the baseline. pFS->startElement(FSNS(XML_c, XML_dLbl), FSEND); + + if (GetProperty(xLabelPropSet, "NumberFormat") || GetProperty(xLabelPropSet, "PercentageNumberFormat")) + { + 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); + } + + // Individual label property that overwrites the baseline. pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, I32S(nIdx), FSEND); exportTextProps( xPropSet ); writeLabelProperties(pFS, this, xLabelPropSet, aParam); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
