diff options
author | Sourav <sourav.mahajan@synerzip.com> | 2014-04-15 16:39:52 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-04-28 09:51:00 +0000 |
commit | a211c754003f98bc8f7761224a0b265bd224f61f (patch) | |
tree | dcf0f5ab6cfebed67a46555666e92b3b46b11621 /oox | |
parent | 89e14d6c318580354081b3b3ad39188f25481ae7 (diff) |
fdo77216-Charts-Scattered chart: Chart gets distorted on RT
In case there is some text entered in place of X coordinates for scatter chart
then x coordinates should be taken as 1,2,3....
MS Word does the same thing
Change-Id: I1db0fd64c6ac0f4d5e77a9676812f5e26577ecf6
Reviewed-on: https://gerrit.libreoffice.org/9011
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/chartexport.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index f6e02dbf8818..9b12eb766336 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2008,6 +2008,14 @@ void ChartExport::exportSeriesValues( const Reference< chart2::data::XDataSequen pFS->singleElement( FSNS( XML_c, XML_ptCount ), XML_val, I32S( ptCount ), FSEND ); + + sal_Bool bIsNumberValue = sal_True; + sal_Bool bXSeriesValue = sal_False; + double Value = 1.0; + + if(nValueType == XML_xVal) + bXSeriesValue = sal_True; + for( sal_Int32 i = 0; i < ptCount; i++ ) { pFS->startElement( FSNS( XML_c, XML_pt ), @@ -2015,8 +2023,15 @@ void ChartExport::exportSeriesValues( const Reference< chart2::data::XDataSequen FSEND ); pFS->startElement( FSNS( XML_c, XML_v ), FSEND ); - if (!rtl::math::isNan(aValues[i])) + if (bIsNumberValue && !rtl::math::isNan(aValues[i])) pFS->write( aValues[i] ); + else if(bXSeriesValue) + { + //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 = sal_False; + } pFS->endElement( FSNS( XML_c, XML_v ) ); pFS->endElement( FSNS( XML_c, XML_pt ) ); } |