diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2019-08-28 11:27:52 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-08-30 15:23:39 +0200 |
commit | 2bd8e41a0fc10974f81695c1b2e32dc07c569d97 (patch) | |
tree | 74e6d7ae89a0753706c746525c4268f8a645fd5f /oox | |
parent | 99dd418c94e2b85fca1a13a0c15aa117582da574 (diff) |
tdf#114657 OOXML chart export: fix broken chart with NaN X value
Export c:pt elements only for numbers instead of replace the correct
X values with the sequence 1, 2, 3..., when the X values contain a NaN
value.
This reverts commit a211c754003f98bc8f7761224a0b265bd224f61f
"fdo77216-Charts-Scattered chart: Chart gets distorted on RT"
Change-Id: I6d0bec870b5317575d93eff407b3ec2ada56431e
Reviewed-on: https://gerrit.libreoffice.org/78221
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/chartexport.cxx | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index b7fdec22de69..bbf647926b33 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2376,28 +2376,16 @@ void ChartExport::exportSeriesValues( const Reference< chart2::data::XDataSequen pFS->endElement( FSNS( XML_c, XML_formatCode ) ); pFS->singleElement(FSNS(XML_c, XML_ptCount), XML_val, OString::number(ptCount)); - bool bIsNumberValue = true; - bool bXSeriesValue = false; - double Value = 1.0; - - if(nValueType == XML_xVal) - bXSeriesValue = true; - for( sal_Int32 i = 0; i < ptCount; i++ ) { - pFS->startElement(FSNS(XML_c, XML_pt), XML_idx, OString::number(i)); - pFS->startElement(FSNS(XML_c, XML_v)); - if (bIsNumberValue && !rtl::math::isNan(aValues[i])) - pFS->write( aValues[i] ); - else if(bXSeriesValue) + if (!rtl::math::isNan(aValues[i])) { - //In Case aValues is not a number for X Values...We write X values as 1,2,3....MS Word does the same thing. - pFS->write( Value ); - Value = Value + 1; - bIsNumberValue = false; + pFS->startElement(FSNS(XML_c, XML_pt), XML_idx, OString::number(i)); + pFS->startElement(FSNS(XML_c, XML_v)); + pFS->write(aValues[i]); + pFS->endElement(FSNS(XML_c, XML_v)); + pFS->endElement(FSNS(XML_c, XML_pt)); } - pFS->endElement( FSNS( XML_c, XML_v ) ); - pFS->endElement( FSNS( XML_c, XML_pt ) ); } pFS->endElement( FSNS( XML_c, XML_numCache ) ); |