summaryrefslogtreecommitdiff
path: root/xmloff/source/chart/SchXMLTableContext.cxx
diff options
context:
space:
mode:
authorBjörn Milcke <bm@openoffice.org>2001-05-25 11:01:07 +0000
committerBjörn Milcke <bm@openoffice.org>2001-05-25 11:01:07 +0000
commit4327c20feb53d69e608e29a5f5e16606f426bf04 (patch)
tree39cb439d9f1bc8080f472a9942e6b9fb7cc18e45 /xmloff/source/chart/SchXMLTableContext.cxx
parent70b57048543aa767156b61abb3d80b05634b8900 (diff)
#86215# export table if flag of MemChart-ChartRange is set
Diffstat (limited to 'xmloff/source/chart/SchXMLTableContext.cxx')
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx28
1 files changed, 25 insertions, 3 deletions
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index d913952daa33..b69ed8e431bd 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: SchXMLTableContext.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: bm $ $Date: 2001-04-10 12:37:57 $
+ * last change: $Author: bm $ $Date: 2001-05-25 12:01:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -469,6 +469,19 @@ void SchXMLTableHelper::applyTableSimple(
uno::Reference< chart::XChartDataArray > xData( xChartDoc->getData(), uno::UNO_QUERY );
if( xData.is())
{
+ // get NaN
+ double fSolarNaN;
+ SolarMath::SetNAN( fSolarNaN, FALSE );
+ double fNaN = fSolarNaN;
+ sal_Bool bConvertNaN = sal_False;
+
+ uno::Reference< chart::XChartData > xChartData( xData, uno::UNO_QUERY );
+ if( xChartData.is())
+ {
+ fNaN = xChartData->getNotANumber();
+ bConvertNaN = ( ! SolarMath::IsNAN( fNaN ));
+ }
+
sal_Int32 nRowCount = rTable.aData.size();
sal_Int32 nColumnCount = 0;
sal_Int32 nCol = 0, nRow = 0;
@@ -489,11 +502,20 @@ void SchXMLTableHelper::applyTableSimple(
}
xData->setColumnDescriptions( aLabels );
+ double fVal;
+ const sal_Bool bConstConvertNan = bConvertNaN;
for( ++iRow, nRow = 0; iRow != rTable.aData.end(); iRow++, nRow++ )
{
aCategories[ nRow ] = (*iRow)[ 0 ].aString;
for( nCol = 1; nCol < nColumnCount; nCol++ )
- aData[ nRow ][ nCol - 1 ] = (*iRow)[ nCol ].fValue;
+ {
+ fVal = (*iRow)[ nCol ].fValue;
+ if( bConstConvertNan &&
+ SolarMath::IsNAN( fVal ))
+ aData[ nRow ][ nCol - 1 ] = fNaN;
+ else
+ aData[ nRow ][ nCol - 1 ] = fVal;
+ }
}
xData->setRowDescriptions( aCategories );
xData->setData( aData );