diff options
author | Björn Milcke <bm@openoffice.org> | 2001-05-02 10:17:50 +0000 |
---|---|---|
committer | Björn Milcke <bm@openoffice.org> | 2001-05-02 10:17:50 +0000 |
commit | 4d5ee5f642e4f26c0240c3226e415130684a8ce0 (patch) | |
tree | b27fd6b8f8ab309bfd6859ec4054beff3cd21aee /xmloff | |
parent | bd0934d275ae9c387f76c1c86d06d2d87a92b83b (diff) |
#81988# export of tables corrected: export table as in MemChart + use ChartDataRowSource
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 407b34d4bfaf..0818f6b0bec1 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: SchXMLExport.cxx,v $ * - * $Revision: 1.31 $ + * $Revision: 1.32 $ * - * last change: $Author: bm $ $Date: 2001-04-25 16:43:07 $ + * last change: $Author: bm $ $Date: 2001-05-02 11:17:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -381,12 +381,25 @@ void SchXMLExportHelper::parseDocument( uno::Reference< chart::XChartDocument >& { // determine size of data const uno::Sequence< double >* pSequence = xValues.getConstArray(); - mnSeriesCount = pSequence->getLength(); - mnSeriesLength = xValues.getLength(); + uno::Sequence< rtl::OUString > xSeriesLabels; + uno::Sequence< rtl::OUString > xCategoryLabels; + + if( mbRowSourceColumns ) + { + mnSeriesCount = pSequence->getLength(); + mnSeriesLength = xValues.getLength(); + xSeriesLabels = xData->getColumnDescriptions(); + xCategoryLabels = xData->getRowDescriptions(); + } + else + { + mnSeriesCount = xValues.getLength(); + mnSeriesLength = pSequence->getLength(); + xSeriesLabels = xData->getRowDescriptions(); + xCategoryLabels = xData->getColumnDescriptions(); + } // determine existence of headers - uno::Sequence< rtl::OUString > xSeriesLabels = xData->getColumnDescriptions(); - uno::Sequence< rtl::OUString > xCategoryLabels = xData->getRowDescriptions(); mbHasCategoryLabels = ( xCategoryLabels.getLength() > 0 ); mbHasSeriesLabels = ( xSeriesLabels.getLength() > 0 ); } @@ -708,6 +721,17 @@ void SchXMLExportHelper::exportTable( uno::Reference< chart::XChartDataArray >& // export column headers uno::Sequence< rtl::OUString > xSeriesLabels = rData->getColumnDescriptions(); uno::Sequence< rtl::OUString > xCategoryLabels = rData->getRowDescriptions(); + sal_Int32 nSeriesCount, nSeriesLength; + if( mbRowSourceColumns ) + { + nSeriesLength = mnSeriesLength; + nSeriesCount = mnSeriesCount; + } + else + { + nSeriesLength = mnSeriesCount; + nSeriesCount = mnSeriesLength; + } sal_Int32 nSeriesLablesLength = xSeriesLabels.getLength(); sal_Int32 nCategoryLabelsLength = xCategoryLabels.getLength(); @@ -747,7 +771,7 @@ void SchXMLExportHelper::exportTable( uno::Reference< chart::XChartDataArray >& // export data SvXMLElementExport aRows( mrExport, XML_NAMESPACE_TABLE, sXML_table_rows, sal_True, sal_True ); - for( nDataPoint = 0; nDataPoint < mnSeriesLength; nDataPoint++ ) + for( nDataPoint = 0; nDataPoint < nSeriesLength; nDataPoint++ ) { // <table:table-row> SvXMLElementExport aRow( mrExport, XML_NAMESPACE_TABLE, sXML_table_row, sal_True, sal_True ); @@ -763,7 +787,7 @@ void SchXMLExportHelper::exportTable( uno::Reference< chart::XChartDataArray >& mrExport.GetDocHandler()->characters( xCategoryLabels[ nDataPoint ] ); } - for( nSeries = 0; nSeries < mnSeriesCount; nSeries++ ) + for( nSeries = 0; nSeries < nSeriesCount; nSeries++ ) { // get string by value fData = pData[ nSeries ]; @@ -1090,10 +1114,7 @@ void SchXMLExportHelper::exportPlotArea( uno::Reference< chart::XDiagram > xDiag // get property states for autostyles try { - if( mbRowSourceColumns ) - xPropSet = xDiagram->getDataPointProperties( nElement, nSeries ); - else - xPropSet = xDiagram->getDataPointProperties( nSeries, nElement ); + xPropSet = xDiagram->getDataPointProperties( nElement, nSeries ); } catch( uno::Exception aEx ) { |