[ooo-build-commit] .: patches/dev300
Pei Feng Lin
pflin at kemper.freedesktop.org
Thu Feb 4 01:19:51 PST 2010
patches/dev300/oox-chart-export-part1.diff | 1111 +++++++++++++++++------------
1 file changed, 674 insertions(+), 437 deletions(-)
New commits:
commit 777cd49f0cf0ab9cd263d0c0b6dde63fe0565155
Author: Fong Lin <pflin at novell.com>
Date: Thu Feb 4 17:20:08 2010 +0800
more properties support for 2d chart
* patches/dev300/oox-chart-export-part1.diff:
diff --git a/patches/dev300/oox-chart-export-part1.diff b/patches/dev300/oox-chart-export-part1.diff
index 945c5a3..c449517 100644
--- a/patches/dev300/oox-chart-export-part1.diff
+++ b/patches/dev300/oox-chart-export-part1.diff
@@ -1,9 +1,9 @@
diff --git oox/inc/oox/export/chartexport.hxx oox/inc/oox/export/chartexport.hxx
new file mode 100644
-index 0000000..1a5710e
+index 0000000..5e2c6e7
--- /dev/null
+++ oox/inc/oox/export/chartexport.hxx
-@@ -0,0 +1,233 @@
+@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,6 +56,7 @@ index 0000000..1a5710e
+ class XDiagram;
+ class XChartDocument;
+ class XDataSeries;
++ class XChartType;
+ namespace data
+ {
+ class XDataProvider;
@@ -76,19 +77,32 @@ index 0000000..1a5710e
+
+namespace oox { namespace drawingml {
+
++const sal_Int32 AXIS_PRIMARY_X = 1;
++const sal_Int32 AXIS_PRIMARY_Y = 2;
++const sal_Int32 AXIS_PRIMARY_Z = 3;
++const sal_Int32 AXIS_SECONDARY_X = 4;
++const sal_Int32 AXIS_SECONDARY_Y = 5;
++
++struct AxisIdPair{
++ sal_Int32 nAxisType;
++ sal_Int32 nAxisId;
++ sal_Int32 nCrossAx;
++
++ AxisIdPair( sal_Int32 nType, sal_Int32 nId, sal_Int32 nAx ): nAxisType( nType ),nAxisId( nId ),nCrossAx( nAx ) {}
++};
++
+class OOX_DLLPUBLIC ChartExport : public DrawingML {
+
+public:
+ // first: data sequence for label, second: data sequence for values.
-+ typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >,
-+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > > tLabelValuesDataPair;
-+ typedef ::std::vector< tLabelValuesDataPair > tDataSequenceCont;
-+ typedef ::std::map< ::rtl::OUString, sal_Int32 > AxisIdMap;
++ typedef ::std::vector< AxisIdPair > AxisVector;
+
+private:
+ sal_Int32 mnXmlNamespace;
+ Fraction maFraction;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxChartModel;
++ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > mxDiagram;
++ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > mxNewDiagram;
+
+ rtl::OUString msTableName;
+ rtl::OUStringBuffer msStringBuffer;
@@ -102,11 +116,10 @@ index 0000000..1a5710e
+ rtl::OUString msTableNumberList;
+ ::com::sun::star::uno::Sequence< sal_Int32 > maSequenceMapping;
+
-+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxAdditionalShapes;
++ //::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxAdditionalShapes;
++ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > mxCategoriesValues;
+
-+ tDataSequenceCont m_aDataSequencesToExport;
-+
-+ AxisIdMap maAxisIdMap;
++ AxisVector maAxes;
+ sal_Bool mbHasXAxis;
+ sal_Bool mbHasYAxis;
+ sal_Bool mbHasZAxis;
@@ -117,11 +130,10 @@ index 0000000..1a5710e
+
+private:
+ sal_Int32 getChartType(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram );
++ );
+
+ rtl::OUString parseFormula( const rtl::OUString& rRange );
-+ void InitAxes(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram );
++ void InitPlotArea();
+
+ void _ExportContent();
+ void exportChartSpace( com::sun::star::uno::Reference<
@@ -133,54 +145,26 @@ index 0000000..1a5710e
+ com::sun::star::chart::XChartDocument > rChartDoc );
+ void exportTitle( com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape > xShape );
-+ void exportPlotArea(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+
-+ void exportAreaChart(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+ void exportBarChart(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+ void exportBubbleChart(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+ void exportDoughnutChart(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+ void exportLineChart(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+ void exportOfPieChart(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+ void exportPieChart(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+ void exportRadarChart(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+ void exportScatterChart(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+ void exportStockChart(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+ void exportSuffaceChart(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+
-+ void exportSeries(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
++ void exportPlotArea( );
++
++ void exportAreaChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
++ void exportBarChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
++ void exportBubbleChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
++ void exportDoughnutChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
++ void exportLineChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
++ void exportOfPieChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
++ void exportPieChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
++ void exportRadarChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
++ void exportScatterChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
++ void exportStockChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
++ void exportSuffaceChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
++
++ void exportSeries( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType, sal_Int32& nAttachedAxis );
+ void exportCandleStickSeries(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries > > & aSeriesSeq,
-+ const ::com::sun::star::uno::Reference<
-+ ::com::sun::star::chart2::XDiagram > & xDiagram,
-+ sal_Bool bJapaneseCandleSticks );
++ sal_Bool bJapaneseCandleSticks, sal_Int32& nAttachedAxis );
+ void exportDataSeq(
+ const com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xValueSeq,
+ sal_Int32 elementTokenId );
@@ -193,18 +177,16 @@ index 0000000..1a5710e
+ void exportShapeProps( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropSet );
+ void exportDataPoints(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSeriesProperties,
-+ sal_Int32 nSeriesLength,
-+ const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram >& xNewDiagram );
-+
-+ void exportAxes(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+ void exportXAxis(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
-+ void exportYAxis(
-+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
-+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram );
++ sal_Int32 nSeriesLength );
++ void exportGrouping();
++ void exportMarker();
++ void exportSmooth();
++ void exportFirstSliceAng();
++
++ void exportAxes( );
++ void exportXAxis( AxisIdPair aAxisIdPair );
++ void exportYAxis( AxisIdPair aAxisIdPair );
++ void exportAxis( AxisIdPair aAxisIdPair );
+ void _exportAxis(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xAxisProp,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xAxisTitle,
@@ -212,9 +194,8 @@ index 0000000..1a5710e
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xMinorGrid,
+ sal_Int32 nAxisType,
+ const char* sAxisPos,
-+ sal_Int32 nAxisId,
-+ sal_Int32 nCrossAx );
-+ void exportAxesId( );
++ AxisIdPair aAxisIdPair );
++ void exportAxesId( sal_Int32 nAttachedAxis );
+
+public:
+
@@ -1067,10 +1048,10 @@ index 0000000..6c8a458
+#endif
diff --git oox/source/export/chartexport.cxx oox/source/export/chartexport.cxx
new file mode 100644
-index 0000000..65a69e6
+index 0000000..1123958
--- /dev/null
+++ oox/source/export/chartexport.cxx
-@@ -0,0 +1,2397 @@
+@@ -0,0 +1,2653 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1164,6 +1145,7 @@ index 0000000..65a69e6
+#include "oox/xls/workbookhelper.hxx"
+#include "oox/xls/addressconverter.hxx"
+#include <set>
++#include <time.h>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
@@ -1616,6 +1598,50 @@ index 0000000..65a69e6
+}
+
+
++sal_Int32 lcl_getChartType( const OUString& sChartType )
++{
++ chart::TypeId eChartTypeId = chart::TYPEID_UNKNOWN;
++ if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.BarDiagram" )))
++ || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.ColumnChartType") ) ) )
++ eChartTypeId = chart::TYPEID_BAR;
++ else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.AreaDiagram" )))
++ || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.AreaChartType") ) ) )
++ eChartTypeId = chart::TYPEID_AREA;
++ else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.LineDiagram" )))
++ || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.LineChartType") ) ) )
++ eChartTypeId = chart::TYPEID_LINE;
++ else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.PieDiagram" )))
++ || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.PieChartType") ) ) )
++ eChartTypeId = chart::TYPEID_PIE;
++ else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.DonutDiagram" )))
++ || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.DonutChartType") ) ) )
++ eChartTypeId = chart::TYPEID_DOUGHNUT;
++ else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.XYDiagram" )))
++ || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.ScatterChartType") ) ) )
++ eChartTypeId = chart::TYPEID_SCATTER;
++ else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.NetDiagram" )))
++ || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.NetChartType") ) ) )
++ eChartTypeId = chart::TYPEID_RADARLINE;
++ else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.FilledNetDiagram" )))
++ || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.FilledNetChartType") ) ) )
++ eChartTypeId = chart::TYPEID_RADARAREA;
++ else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.StockDiagram" )))
++ || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.CandleStickChartType") ) ) )
++ eChartTypeId = chart::TYPEID_STOCK;
++ else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.BubbleDiagram" )))
++ || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.BubbleChartType") ) ) )
++ eChartTypeId = chart::TYPEID_BUBBLE;
++
++ return eChartTypeId;
++}
++
++sal_Int32 lcl_generateRandomValue()
++{
++ static sal_Int32 MAX_NUMBER = 100000000;
++ //srand( unsigned( time( NULL ) ));
++ return sal_Int32( rand() % MAX_NUMBER );
++}
++
+ChartExport::ChartExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, Reference< frame::XModel >& xModel, XmlFilterBase* pFB, DocumentType eDocumentType )
+ : DrawingML( pFS, pFB, eDocumentType )
+ , mnXmlNamespace( nXmlNamespace )
@@ -1650,57 +1676,15 @@ index 0000000..65a69e6
+ return nID;
+}
+
-+sal_Int32 ChartExport::getChartType( Reference< ::com::sun::star::chart::XDiagram > xDiagram )
++sal_Int32 ChartExport::getChartType( )
+{
-+ OUString sChartType = xDiagram->getDiagramType();
-+ chart::TypeId eChartTypeId = chart::TYPEID_UNKNOWN;
-+ if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.BarDiagram" )))
-+ eChartTypeId = chart::TYPEID_BAR;
-+ else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.AreaDiagram" )))
-+ eChartTypeId = chart::TYPEID_AREA;
-+ else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.LineDiagram" )))
-+ eChartTypeId = chart::TYPEID_LINE;
-+ else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.PieDiagram" )))
-+ eChartTypeId = chart::TYPEID_PIE;
-+ else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.DonutDiagram" )))
-+ eChartTypeId = chart::TYPEID_DOUGHNUT;
-+ else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.XYDiagram" )))
-+ eChartTypeId = chart::TYPEID_SCATTER;
-+ else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.NetDiagram" )))
-+ eChartTypeId = chart::TYPEID_RADARLINE;
-+ else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.FilledNetDiagram" )))
-+ eChartTypeId = chart::TYPEID_RADARAREA;
-+ else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.StockDiagram" )))
-+ eChartTypeId = chart::TYPEID_STOCK;
-+ else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.BubbleDiagram" )))
-+ eChartTypeId = chart::TYPEID_BUBBLE;
-+
-+ return eChartTypeId;
++ OUString sChartType = mxDiagram->getDiagramType();
++ return lcl_getChartType( sChartType );
+}
+
+OUString ChartExport::parseFormula( const OUString& rRange )
+{
+ OUString aResult;
-+ /*
-+ oox::xls::WorkbookHelperRoot aHelper( *GetFB() );
-+ if( aHelper.isValid() )
-+ {
-+ OSL_TRACE("ChartExport::parseFormula, is valid");
-+ oox::xls::FormulaParser rParser( aHelper );
-+ oox::xls::TokensFormulaContext aContext( true, true );
-+ aContext.setBaseAddress( CellAddress( 0, 0, 0 ) );
-+ rParser.importFormula( aContext, rRange );
-+ oox::xls::ApiCellRangeList aRanges;
-+ rParser.extractCellRangeList( aRanges, aContext.getTokens(), false );
-+ OUString aRangeRep = rParser.generateApiRangeListString( aRanges );
-+ OSL_TRACE("ChartExport::parseFormula, the originla formula is %s, the new formula is %s ", OUStringToOString( rRange, RTL_TEXTENCODING_UTF8 ).getStr(), OUStringToOString( aRangeRep, RTL_TEXTENCODING_UTF8 ).getStr());
-+ }
-+ else
-+ {
-+ OSL_TRACE("ChartExport::parseFormula, is invalid");
-+ }
-+ */
-+
+ Reference< XFormulaParser > xParser;
+ uno::Reference< lang::XMultiServiceFactory > xSF( GetFB()->getModelFactory(), uno::UNO_QUERY );
+ if( xSF.is() )
@@ -1976,10 +1960,9 @@ index 0000000..65a69e6
+void ChartExport::exportChart( Reference< ::com::sun::star::chart::XChartDocument > rChartDoc )
+{
+ Reference< chart2::XChartDocument > xNewDoc( rChartDoc, uno::UNO_QUERY );
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram = rChartDoc->getDiagram();
-+ Reference< chart2::XDiagram > xNewDiagram;
++ mxDiagram.set( rChartDoc->getDiagram() );
+ if( xNewDoc.is())
-+ xNewDiagram.set( xNewDoc->getFirstDiagram());
++ mxNewDiagram.set( xNewDoc->getFirstDiagram());
+
+ // get Properties of ChartDocument
+ sal_Bool bHasMainTitle = sal_False;
@@ -2020,7 +2003,7 @@ index 0000000..65a69e6
+ exportTitle( xShape );
+ }
+ // plot area
-+ exportPlotArea( xDiagram, xNewDiagram );
++ exportPlotArea( );
+ // legend
+ if( bHasLegend )
+ exportLegend( rChartDoc );
@@ -2157,11 +2140,13 @@ index 0000000..65a69e6
+ pFS->endElement( FSNS( XML_c, XML_title ) );
+}
+
-+void ChartExport::exportPlotArea(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportPlotArea( )
+{
-+ InitAxes( xDiagram );
++ Reference< chart2::XCoordinateSystemContainer > xBCooSysCnt( mxNewDiagram, uno::UNO_QUERY );
++ if( ! xBCooSysCnt.is())
++ return;
++
++ InitPlotArea( );
+ // plot-area element
+ // -----------------
+ FSHelperPtr pFS = GetFS();
@@ -2172,63 +2157,81 @@ index 0000000..65a69e6
+ FSEND );
+
+ // chart type
-+ sal_Int32 eChartType = getChartType( xDiagram );
++ Sequence< Reference< chart2::XCoordinateSystem > >
++ aCooSysSeq( xBCooSysCnt->getCoordinateSystems());
++ for( sal_Int32 nCSIdx=0; nCSIdx<aCooSysSeq.getLength(); ++nCSIdx )
++ {
++ Reference< chart2::XChartTypeContainer > xCTCnt( aCooSysSeq[nCSIdx], uno::UNO_QUERY );
++ if( ! xCTCnt.is())
++ continue;
++ Sequence< Reference< chart2::XChartType > > aCTSeq( xCTCnt->getChartTypes());
++ for( sal_Int32 nCTIdx=0; nCTIdx<aCTSeq.getLength(); ++nCTIdx )
++ {
++ Reference< chart2::XDataSeriesContainer > xDSCnt( aCTSeq[nCTIdx], uno::UNO_QUERY );
++ if( ! xDSCnt.is())
++ return;
++ Reference< chart2::XChartType > xChartType( aCTSeq[nCTIdx], uno::UNO_QUERY );
++ if( ! xChartType.is())
++ continue;
++ // note: if xDSCnt.is() then also aCTSeq[nCTIdx]
++ OUString aChartType( xChartType->getChartType());
++ sal_Int32 eChartType = lcl_getChartType( aChartType );
+ switch( eChartType )
+ {
+ case chart::TYPEID_BAR:
+ {
-+ exportBarChart( xDiagram, xNewDiagram );
++ exportBarChart( xChartType );
+ break;
+ }
+ case chart::TYPEID_AREA:
+ {
-+ exportAreaChart( xDiagram, xNewDiagram );
++ exportAreaChart( xChartType );
+ break;
+ }
+ case chart::TYPEID_LINE:
+ {
-+ exportLineChart( xDiagram, xNewDiagram );
++ exportLineChart( xChartType );
+ break;
+ }
+ case chart::TYPEID_BUBBLE:
+ {
-+ exportBubbleChart( xDiagram, xNewDiagram );
++ exportBubbleChart( xChartType );
+ break;
+ }
+ case chart::TYPEID_DOUGHNUT:
+ {
-+ exportDoughnutChart( xDiagram, xNewDiagram );
++ exportDoughnutChart( xChartType );
+ break;
+ }
+ case chart::TYPEID_OFPIE:
+ {
-+ exportOfPieChart( xDiagram, xNewDiagram );
++ exportOfPieChart( xChartType );
+ break;
+ }
+ case chart::TYPEID_PIE:
+ {
-+ exportPieChart( xDiagram, xNewDiagram );
++ exportPieChart( xChartType );
+ break;
+ }
+ case chart::TYPEID_RADARLINE:
+ case chart::TYPEID_RADARAREA:
+ {
-+ exportRadarChart( xDiagram, xNewDiagram );
++ exportRadarChart( xChartType );
+ break;
+ }
+ case chart::TYPEID_SCATTER:
+ {
-+ exportScatterChart( xDiagram, xNewDiagram );
++ exportScatterChart( xChartType );
+ break;
+ }
+ case chart::TYPEID_STOCK:
+ {
-+ exportStockChart( xDiagram, xNewDiagram );
++ exportStockChart( xChartType );
+ break;
+ }
+ case chart::TYPEID_SURFACE:
+ {
-+ exportSuffaceChart( xDiagram, xNewDiagram );
++ exportSuffaceChart( xChartType );
+ break;
+ }
+ default:
@@ -2238,12 +2241,13 @@ index 0000000..65a69e6
+ }
+ }
+
++ }
++ }
+ //Axis Data
-+ if( eChartType != chart::TYPEID_PIE )
-+ exportAxes( xDiagram, xNewDiagram );
++ exportAxes( );
+
+ // shape properties
-+ Reference< ::com::sun::star::chart::X3DDisplay > xWallFloorSupplier( xDiagram, uno::UNO_QUERY );
++ Reference< ::com::sun::star::chart::X3DDisplay > xWallFloorSupplier( mxDiagram, uno::UNO_QUERY );
+ if( xWallFloorSupplier.is() )
+ {
+ Reference< beans::XPropertySet > xWallPropSet( xWallFloorSupplier->getWall(), uno::UNO_QUERY );
@@ -2257,194 +2261,210 @@ index 0000000..65a69e6
+
+}
+
-+void ChartExport::exportAreaChart(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportAreaChart( Reference< chart2::XChartType > xChartType )
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, XML_areaChart ),
+ FSEND );
-+ // TODO: grouping, set default value
-+ const char* grouping = "standard";
-+ pFS->singleElement( FSNS( XML_c, XML_grouping ),
-+ XML_val, grouping,
-+ FSEND );
+
-+ exportSeries( xDiagram, xNewDiagram );
-+ exportAxesId();
++ exportGrouping( );
++ sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
++ exportSeries( xChartType, nAttachedAxis );
++ exportAxesId( nAttachedAxis );
+
+ pFS->endElement( FSNS( XML_c, XML_areaChart ) );
+}
+
-+void ChartExport::exportBarChart(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportBarChart( Reference< chart2::XChartType > xChartType )
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, XML_barChart ),
+ FSEND );
-+ // TODO:barDir, set default value
++ // bar direction
+ sal_Bool bVertical = sal_False;
-+ Reference< XPropertySet > xPropSet( xDiagram , uno::UNO_QUERY);
-+ if( xPropSet.is() )
-+ {
-+ xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Vertical") ) ) >>= bVertical;
-+ }
++ Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY);
++ if( GetProperty( xPropSet, S( "Vertical" ) ) )
++ mAny >>= bVertical;
+
+ const char* bardir = bVertical? "bar":"col";
+ pFS->singleElement( FSNS( XML_c, XML_barDir ),
+ XML_val, bardir,
+ FSEND );
-+ // TODO: grouping, set default value
-+ const char* grouping = "standard";
-+ pFS->singleElement( FSNS( XML_c, XML_grouping ),
-+ XML_val, grouping,
-+ FSEND );
+
-+ exportSeries( xDiagram, xNewDiagram );
-+ exportAxesId();
++ exportGrouping( );
++ sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
++ exportSeries( xChartType, nAttachedAxis );
++
++ //overlap
++ Reference< XPropertySet > xTypeProp( xChartType, uno::UNO_QUERY );
++ if( xTypeProp.is() && GetProperty( xTypeProp, S("OverlapSequence") ) )
++ {
++ uno::Sequence< sal_Int32 > aBarPositionSequence;
++ mAny >>= aBarPositionSequence;
++ if( aBarPositionSequence.getLength() )
++ {
++ sal_Int32 nOverlap = aBarPositionSequence[0];
++ pFS->singleElement( FSNS( XML_c, XML_overlap ),
++ XML_val, I32S( nOverlap ),
++ FSEND );
++ }
++ }
++ if( xTypeProp.is() && GetProperty( xTypeProp, S("GapwidthSequence") ) )
++ {
++ uno::Sequence< sal_Int32 > aBarPositionSequence;
++ mAny >>= aBarPositionSequence;
++ if( aBarPositionSequence.getLength() )
++ {
++ sal_Int32 nGapWidth = aBarPositionSequence[0];
++ pFS->singleElement( FSNS( XML_c, XML_gapWidth ),
++ XML_val, I32S( nGapWidth ),
++ FSEND );
++ }
++ }
++
++ exportAxesId( nAttachedAxis );
+
+ pFS->endElement( FSNS( XML_c, XML_barChart ) );
+}
+
-+void ChartExport::exportBubbleChart(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportBubbleChart( Reference< chart2::XChartType > xChartType )
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, XML_bubbleChart ),
+ FSEND );
+
-+ exportSeries( xDiagram, xNewDiagram );
-+ exportAxesId();
++ sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
++ exportSeries( xChartType, nAttachedAxis );
++ exportAxesId( nAttachedAxis );
+
+ pFS->endElement( FSNS( XML_c, XML_bubbleChart ) );
+}
+
-+void ChartExport::exportDoughnutChart(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportDoughnutChart( Reference< chart2::XChartType > xChartType )
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, XML_doughnutChart ),
+ FSEND );
+
-+ exportSeries( xDiagram, xNewDiagram );
-+ exportAxesId();
++ sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
++ exportSeries( xChartType, nAttachedAxis );
++ // firstSliceAng
++ exportFirstSliceAng( );
++ //FIXME: holeSize
++ sal_Int32 nHoleSize = 50;
++ pFS->singleElement( FSNS( XML_c, XML_holeSize ),
++ XML_val, I32S( nHoleSize ),
++ FSEND );
++
++ exportAxesId( nAttachedAxis );
+
+ pFS->endElement( FSNS( XML_c, XML_doughnutChart ) );
+}
+
-+void ChartExport::exportLineChart(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportLineChart( Reference< chart2::XChartType > xChartType )
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, XML_lineChart ),
+ FSEND );
-+ // TODO: grouping, set default value
-+ const char* grouping = "standard";
-+ pFS->singleElement( FSNS( XML_c, XML_grouping ),
-+ XML_val, grouping,
-+ FSEND );
+
++ exportGrouping( );
+ // TODO: show marker symbol in series?
-+ exportSeries( xDiagram, xNewDiagram );
++ sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
++ exportSeries( xChartType, nAttachedAxis );
+
+ // show marker?
+ sal_Int32 nSymbolType = ::com::sun::star::chart::ChartSymbolType::NONE;
-+ Reference< XPropertySet > xPropSet( xDiagram , uno::UNO_QUERY);
-+ if( xPropSet.is() )
-+ {
-+ xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("SymbolType") ) ) >>= nSymbolType;
-+ }
++ Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY);
++ if( GetProperty( xPropSet, S( "SymbolType" ) ) )
++ mAny >>= nSymbolType;
+
+ const char* marker = nSymbolType == ::com::sun::star::chart::ChartSymbolType::NONE? "0":"1";
+ pFS->singleElement( FSNS( XML_c, XML_marker ),
+ XML_val, marker,
+ FSEND );
+
-+ exportAxesId();
++ exportAxesId( nAttachedAxis );
+
+ pFS->endElement( FSNS( XML_c, XML_lineChart ) );
+}
+
-+void ChartExport::exportOfPieChart(
-+ Reference< ::com::sun::star::chart::XDiagram > /*xDiagram*/,
-+ Reference< chart2::XDiagram > /*xNewDiagram*/ )
++void ChartExport::exportOfPieChart( Reference< chart2::XChartType > xChartType )
+{
+ // TODO:
+}
+
-+void ChartExport::exportPieChart(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportPieChart( Reference< chart2::XChartType > xChartType )
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, XML_pieChart ),
+ FSEND );
-+ // TODO: firstSliceAng
++ // TODO: varyColors
+ const char* varyColors = "1";
+ pFS->singleElement( FSNS( XML_c, XML_varyColors ),
+ XML_val, varyColors,
+ FSEND );
+
-+ exportSeries( xDiagram, xNewDiagram );
++ sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
++ exportSeries( xChartType, nAttachedAxis );
+
-+ // TODO: firstSliceAng
-+ const char* firstSliceAng = "0";
-+ pFS->singleElement( FSNS( XML_c, XML_firstSliceAng ),
-+ XML_val, firstSliceAng,
-+ FSEND );
++ // firstSliceAng
++ exportFirstSliceAng( );
+
+ pFS->endElement( FSNS( XML_c, XML_pieChart ) );
+}
+
-+void ChartExport::exportRadarChart(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportRadarChart( Reference< chart2::XChartType > xChartType)
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, XML_radarChart ),
+ FSEND );
+
-+ exportSeries( xDiagram, xNewDiagram );
-+ exportAxesId();
++ // radarStyle
++ sal_Int32 eChartType = getChartType( );
++ const char* radarStyle = NULL;
++ if( eChartType == chart::TYPEID_RADARAREA )
++ radarStyle = "filled";
++ else
++ radarStyle = "marker";
++ pFS->singleElement( FSNS( XML_c, XML_radarStyle ),
++ XML_val, radarStyle,
++ FSEND );
++ sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
++ exportSeries( xChartType, nAttachedAxis );
++ exportAxesId( nAttachedAxis );
+
+ pFS->endElement( FSNS( XML_c, XML_radarChart ) );
+}
+
-+void ChartExport::exportScatterChart(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportScatterChart( Reference< chart2::XChartType > xChartType )
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, XML_scatterChart ),
+ FSEND );
+ // TODO:scatterStyle
-+ const char* scatterStyle = "smoothMarker";
++ const char* scatterStyle = "lineMarker";
+ pFS->singleElement( FSNS( XML_c, XML_scatterStyle ),
+ XML_val, scatterStyle,
+ FSEND );
+
+ // FIXME: should export xVal and yVal
-+ exportSeries( xDiagram, xNewDiagram );
-+ exportAxesId();
++ sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
++ exportSeries( xChartType, nAttachedAxis );
++ exportAxesId( nAttachedAxis );
+
+ pFS->endElement( FSNS( XML_c, XML_scatterChart ) );
+}
+
-+void ChartExport::exportStockChart(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportStockChart( Reference< chart2::XChartType > xChartType )
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, XML_stockChart ),
+ FSEND );
+
-+ exportSeries( xDiagram, xNewDiagram );
++ sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
++ exportSeries( xChartType, nAttachedAxis );
+ // export stock properties
-+ Reference< ::com::sun::star::chart::XStatisticDisplay > xStockPropProvider( xDiagram, uno::UNO_QUERY );
++ Reference< ::com::sun::star::chart::XStatisticDisplay > xStockPropProvider( mxDiagram, uno::UNO_QUERY );
+ if( xStockPropProvider.is())
+ {
+ // stock-range-line
@@ -2485,215 +2505,216 @@ index 0000000..65a69e6
+ pFS->endElement( FSNS( XML_c, XML_upDownBars ) );
+ }
+
-+ exportAxesId();
++ exportAxesId( nAttachedAxis );
+
+ pFS->endElement( FSNS( XML_c, XML_stockChart ) );
+}
+
-+void ChartExport::exportSuffaceChart(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportSuffaceChart( Reference< chart2::XChartType > xChartType )
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, XML_surfaceChart ),
+ FSEND );
-+ exportSeries( xDiagram, xNewDiagram );
-+ exportAxesId();
++ sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
++ exportSeries( xChartType, nAttachedAxis );
++ exportAxesId( nAttachedAxis );
+
+ pFS->endElement( FSNS( XML_c, XML_surfaceChart ) );
+}
+
-+void ChartExport::exportSeries(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportSeries( Reference< chart2::XChartType > xChartType, sal_Int32& nAttachedAxis )
+{
-+ // get categories range
-+ Reference< chart2::data::XDataSequence > xCatSeq;
-+ Reference< chart2::XChartDocument > xNewDoc( getModel(), uno::UNO_QUERY );
-+ if( mbHasCategoryLabels && xNewDiagram.is())
-+ {
-+ Reference< chart2::data::XLabeledDataSequence > xCategories( lcl_getCategories( xNewDiagram ) );
-+ if( xCategories.is() )
-+ {
-+ xCatSeq.set( xCategories->getValues() );
-+ }
-+ }
+
-+ Reference< chart2::XCoordinateSystemContainer > xBCooSysCnt( xNewDiagram, uno::UNO_QUERY );
-+ if( ! xBCooSysCnt.is())
++ OUString aLabelRole = xChartType->getRoleOfSequenceForSeriesLabel();
++ Reference< chart2::XDataSeriesContainer > xDSCnt( xChartType, uno::UNO_QUERY );
++ if( ! xDSCnt.is())
+ return;
+
-+ Sequence< Reference< chart2::XCoordinateSystem > >
-+ aCooSysSeq( xBCooSysCnt->getCoordinateSystems());
-+ for( sal_Int32 nCSIdx=0; nCSIdx<aCooSysSeq.getLength(); ++nCSIdx )
++ OUString aChartType( xChartType->getChartType());
++ sal_Int32 eChartType = lcl_getChartType( aChartType );
++
++ // special export for stock charts
++ if( eChartType == chart::TYPEID_STOCK )
+ {
-+ Reference< chart2::XChartTypeContainer > xCTCnt( aCooSysSeq[nCSIdx], uno::UNO_QUERY );
-+ if( ! xCTCnt.is())
-+ continue;
-+ Sequence< Reference< chart2::XChartType > > aCTSeq( xCTCnt->getChartTypes());
-+ for( sal_Int32 nCTIdx=0; nCTIdx<aCTSeq.getLength(); ++nCTIdx )
-+ {
-+ Reference< chart2::XDataSeriesContainer > xDSCnt( aCTSeq[nCTIdx], uno::UNO_QUERY );
-+ if( ! xDSCnt.is())
-+ continue;
-+ // note: if xDSCnt.is() then also aCTSeq[nCTIdx]
-+ OUString aChartType( aCTSeq[nCTIdx]->getChartType());
-+ OUString aLabelRole = aCTSeq[nCTIdx]->getRoleOfSequenceForSeriesLabel();
++ sal_Bool bJapaneseCandleSticks = sal_False;
++ Reference< beans::XPropertySet > xCTProp( xChartType, uno::UNO_QUERY );
++ if( xCTProp.is())
++ xCTProp->getPropertyValue( OUString::createFromAscii("Japanese")) >>= bJapaneseCandleSticks;
++ exportCandleStickSeries(
++ xDSCnt->getDataSeries(), bJapaneseCandleSticks, nAttachedAxis );
++ return;
++ }
+
-+ // special export for stock charts
-+ if( aChartType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.CandleStickChartType")))
-+ {
-+ sal_Bool bJapaneseCandleSticks = sal_False;
-+ Reference< beans::XPropertySet > xCTProp( aCTSeq[nCTIdx], uno::UNO_QUERY );
-+ if( xCTProp.is())
-+ xCTProp->getPropertyValue( OUString::createFromAscii("Japanese")) >>= bJapaneseCandleSticks;
-+ exportCandleStickSeries(
-+ xDSCnt->getDataSeries(), xNewDiagram, bJapaneseCandleSticks );
-+ continue;
-+ }
+
-+ // export dataseries for current chart-type
-+ Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries());
-+ for( sal_Int32 nSeriesIdx=0; nSeriesIdx<aSeriesSeq.getLength(); ++nSeriesIdx )
++ // export dataseries for current chart-type
++ Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries());
++ for( sal_Int32 nSeriesIdx=0; nSeriesIdx<aSeriesSeq.getLength(); ++nSeriesIdx )
++ {
++ // export series
++ Reference< chart2::data::XDataSource > xSource( aSeriesSeq[nSeriesIdx], uno::UNO_QUERY );
++ if( xSource.is())
++ {
++ Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeqCnt(
++ xSource->getDataSequences());
++ sal_Int32 nMainSequenceIndex = -1;
++ sal_Int32 nSeriesLength = 0;
++ // search for main sequence and create a series element
+ {
-+ // export series
-+ Reference< chart2::data::XDataSource > xSource( aSeriesSeq[nSeriesIdx], uno::UNO_QUERY );
-+ if( xSource.is())
++ Reference< chart2::data::XDataSequence > xValuesSeq;
++ Reference< chart2::data::XDataSequence > xLabelSeq;
++ sal_Int32 nSeqIdx=0;
++ for( ; nSeqIdx<aSeqCnt.getLength(); ++nSeqIdx )
+ {
-+ Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeqCnt(
-+ xSource->getDataSequences());
-+ sal_Int32 nMainSequenceIndex = -1;
-+ sal_Int32 nSeriesLength = 0;
-+ // search for main sequence and create a series element
++ OUString aRole;
++ Reference< chart2::data::XDataSequence > xTempValueSeq( aSeqCnt[nSeqIdx]->getValues() );
++ if( nMainSequenceIndex==-1 )
+ {
-+ Reference< chart2::data::XDataSequence > xValuesSeq;
-+ Reference< chart2::data::XDataSequence > xLabelSeq;
-+ sal_Int32 nSeqIdx=0;
-+ for( ; nSeqIdx<aSeqCnt.getLength(); ++nSeqIdx )
++ Reference< beans::XPropertySet > xSeqProp( xTempValueSeq, uno::UNO_QUERY );
++ if( xSeqProp.is())
++ xSeqProp->getPropertyValue(OUString::createFromAscii("Role")) >>= aRole;
++ // "main" sequence
++ if( aRole.equals( aLabelRole ))
+ {
-+ OUString aRole;
-+ Reference< chart2::data::XDataSequence > xTempValueSeq( aSeqCnt[nSeqIdx]->getValues() );
-+ if( nMainSequenceIndex==-1 )
-+ {
-+ Reference< beans::XPropertySet > xSeqProp( xTempValueSeq, uno::UNO_QUERY );
-+ if( xSeqProp.is())
-+ xSeqProp->getPropertyValue(OUString::createFromAscii("Role")) >>= aRole;
-+ // "main" sequence
-+ if( aRole.equals( aLabelRole ))
-+ {
-+ xValuesSeq.set( xTempValueSeq );
-+ xLabelSeq.set( aSeqCnt[nSeqIdx]->getLabel());
-+ nMainSequenceIndex = nSeqIdx;
-+ }
-+ }
-+ sal_Int32 nSequenceLength = (xTempValueSeq.is()? xTempValueSeq->getData().getLength() : sal_Int32(0));
-+ if( nSeriesLength < nSequenceLength )
-+ nSeriesLength = nSequenceLength;
++ xValuesSeq.set( xTempValueSeq );
++ xLabelSeq.set( aSeqCnt[nSeqIdx]->getLabel());
++ nMainSequenceIndex = nSeqIdx;
+ }
++ }
++ sal_Int32 nSequenceLength = (xTempValueSeq.is()? xTempValueSeq->getData().getLength() : sal_Int32(0));
++ if( nSeriesLength < nSequenceLength )
++ nSeriesLength = nSequenceLength;
++ }
+
-+ // have found the main sequence, then xValuesSeq and
-+ // xLabelSeq contain those. Otherwise both are empty
++ // have found the main sequence, then xValuesSeq and
++ // xLabelSeq contain those. Otherwise both are empty
++ {
++ FSHelperPtr pFS = GetFS();
++ pFS->startElement( FSNS( XML_c, XML_ser ),
++ FSEND );
++
++ // TODO: idx and order
++ pFS->singleElement( FSNS( XML_c, XML_idx ),
++ XML_val, I32S(nSeriesIdx),
++ FSEND );
++ pFS->singleElement( FSNS( XML_c, XML_order ),
++ XML_val, I32S(nSeriesIdx),
++ FSEND );
++
++ // export label
++ if( xLabelSeq.is() )
++ exportSeriesText( xLabelSeq );
++
++ // export shape properties
++ Reference< XPropertySet > xPropSet = SchXMLSeriesHelper::createOldAPISeriesPropertySet(
++ aSeriesSeq[nSeriesIdx], getModel() );
++ if( xPropSet.is() )
++ {
++ if( GetProperty( xPropSet, S("Axis") ) )
+ {
-+ FSHelperPtr pFS = GetFS();
-+ pFS->startElement( FSNS( XML_c, XML_ser ),
-+ FSEND );
-+
-+ // TODO: idx and order
-+ pFS->singleElement( FSNS( XML_c, XML_idx ),
-+ XML_val, I32S(nSeriesIdx),
-+ FSEND );
-+ pFS->singleElement( FSNS( XML_c, XML_order ),
-+ XML_val, I32S(nSeriesIdx),
-+ FSEND );
-+
-+ // export label
-+ if( xLabelSeq.is() )
-+ exportSeriesText( xLabelSeq );
-+
-+ // export shape properties
-+ Reference< XPropertySet > xPropSet = SchXMLSeriesHelper::createOldAPISeriesPropertySet(
-+ aSeriesSeq[nSeriesIdx], getModel() );
-+ if( xPropSet.is() )
-+ {
-+ exportShapeProps( xPropSet );
-+ }
-+
-+ // export data points
-+ exportDataPoints( uno::Reference< beans::XPropertySet >( aSeriesSeq[nSeriesIdx], uno::UNO_QUERY ), nSeriesLength, xNewDiagram );
++ mAny >>= nAttachedAxis;
++ if( nAttachedAxis == ::com::sun::star::chart::ChartAxisAssign::SECONDARY_Y )
++ nAttachedAxis = AXIS_SECONDARY_Y;
++ else
++ nAttachedAxis = AXIS_PRIMARY_Y;
++ }
++ exportShapeProps( xPropSet );
++ }
+
-+ // export categories
-+ if( xCatSeq.is() )
-+ exportSeriesCategory( xCatSeq );
-+
-+ sal_Int32 eChartType = getChartType( xDiagram );
-+ if( (eChartType == chart::TYPEID_SCATTER)
-+ || (eChartType == chart::TYPEID_BUBBLE) )
++ switch( eChartType )
++ {
++ case chart::TYPEID_LINE:
++ {
++ exportMarker( );
++ break;
++ }
++ case chart::TYPEID_PIE:
++ case chart::TYPEID_DOUGHNUT:
++ {
++ if( xPropSet.is() && GetProperty( xPropSet, S("SegmentOffset") ) )
+ {
-+ // export xVal
-+ Reference< chart2::data::XLabeledDataSequence > xSequence( lcl_getDataSequenceByRole( aSeqCnt, OUString::createFromAscii("values-x" ) ) );
-+ if( xSequence.is() )
-+ {
-+ Reference< chart2::data::XDataSequence > xValues( xSequence->getValues() );
-+ if( xValues.is() )
-+ exportSeriesValues( xValues, XML_xVal );
-+ }
++ sal_Int32 nOffset = 0;
++ mAny >>= nOffset;
++ pFS->singleElement( FSNS( XML_c, XML_explosion ),
++ XML_val, I32S( nOffset ),
++ FSEND );
+ }
++ break;
++ }
++ case chart::TYPEID_SCATTER:
++ {
++ exportMarker( );
++ exportSmooth( );
++ break;
++ }
++ case chart::TYPEID_RADARLINE:
++ {
++ exportMarker( );
++ break;
++ }
++ }
+
++ // TODO: Data Labels: show data lables
++
++ // export data points
++ exportDataPoints( uno::Reference< beans::XPropertySet >( aSeriesSeq[nSeriesIdx], uno::UNO_QUERY ), nSeriesLength );
++
++ // export categories
++ if( mxCategoriesValues.is() )
++ exportSeriesCategory( mxCategoriesValues );
++
++ if( (eChartType == chart::TYPEID_SCATTER)
++ || (eChartType == chart::TYPEID_BUBBLE) )
++ {
++ // export xVal
++ Reference< chart2::data::XLabeledDataSequence > xSequence( lcl_getDataSequenceByRole( aSeqCnt, OUString::createFromAscii("values-x" ) ) );
++ if( xSequence.is() )
++ {
++ Reference< chart2::data::XDataSequence > xValues( xSequence->getValues() );
++ if( xValues.is() )
++ exportSeriesValues( xValues, XML_xVal );
++ }
++ }
+
-+ if( eChartType == chart::TYPEID_BUBBLE )
-+ {
-+ // export yVal
-+ Reference< chart2::data::XLabeledDataSequence > xSequence( lcl_getDataSequenceByRole( aSeqCnt, OUString::createFromAscii("values-y" ) ) );
-+ if( xSequence.is() )
-+ {
-+ Reference< chart2::data::XDataSequence > xValues( xSequence->getValues() );
-+ if( xValues.is() )
-+ exportSeriesValues( xValues, XML_yVal );
-+ }
-+ }
-+
-+ // export values
-+ if( xValuesSeq.is() )
-+ {
-+ sal_Int32 nYValueType = XML_val;
-+ if( eChartType == chart::TYPEID_SCATTER )
-+ nYValueType = XML_yVal;
-+ else if( eChartType == chart::TYPEID_BUBBLE )
-+ nYValueType = XML_bubbleSize;
-+ exportSeriesValues( xValuesSeq, nYValueType );
-+ }
+
-+ pFS->endElement( FSNS( XML_c, XML_ser ) );
-+ }
++ if( eChartType == chart::TYPEID_BUBBLE )
++ {
++ // export yVal
++ Reference< chart2::data::XLabeledDataSequence > xSequence( lcl_getDataSequenceByRole( aSeqCnt, OUString::createFromAscii("values-y" ) ) );
++ if( xSequence.is() )
++ {
++ Reference< chart2::data::XDataSequence > xValues( xSequence->getValues() );
++ if( xValues.is() )
++ exportSeriesValues( xValues, XML_yVal );
++ }
+ }
++
++ // export values
++ if( xValuesSeq.is() )
++ {
++ sal_Int32 nYValueType = XML_val;
++ if( eChartType == chart::TYPEID_SCATTER )
++ nYValueType = XML_yVal;
++ else if( eChartType == chart::TYPEID_BUBBLE )
++ nYValueType = XML_bubbleSize;
++ exportSeriesValues( xValuesSeq, nYValueType );
++ }
++
++ pFS->endElement( FSNS( XML_c, XML_ser ) );
+ }
-+ }
++ }
+ }
+ }
+}
+
+void ChartExport::exportCandleStickSeries(
+ const Sequence< Reference< chart2::XDataSeries > > & aSeriesSeq,
-+ const Reference< chart2::XDiagram > & xNewDiagram,
-+ sal_Bool bJapaneseCandleSticks )
++ sal_Bool bJapaneseCandleSticks,
++ sal_Int32& nAttachedAxis )
+{
-+ // get categories range
-+ Reference< chart2::data::XDataSequence > xCatSeq;
-+ if( mbHasCategoryLabels && xNewDiagram.is())
-+ {
-+ Reference< chart2::data::XLabeledDataSequence > xCategories( lcl_getCategories( xNewDiagram ) );
-+ if( xCategories.is() )
-+ {
-+ xCatSeq.set( xCategories->getValues() );
-+ }
-+ }
-+
+ for( sal_Int32 nSeriesIdx=0; nSeriesIdx<aSeriesSeq.getLength(); ++nSeriesIdx )
+ {
+ Reference< chart2::XDataSeries > xSeries( aSeriesSeq[nSeriesIdx] );
-+ //sal_Int32 nAttachedAxis = lcl_isSeriesAttachedToFirstAxis( xSeries )
-+ // ? ::com::sun::star::chart::ChartAxisAssign::PRIMARY_Y
-+ // : ::com::sun::star::chart::ChartAxisAssign::SECONDARY_Y;
++ nAttachedAxis = lcl_isSeriesAttachedToFirstAxis( xSeries ) ? AXIS_PRIMARY_Y : AXIS_SECONDARY_Y;
+
+ Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY );
+ if( xSource.is())
@@ -2736,8 +2757,8 @@ index 0000000..65a69e6
+ // TODO:export shape properties
+
+ // export categories
-+ if( xCatSeq.is() )
-+ exportSeriesCategory( xCatSeq );
++ if( mxCategoriesValues.is() )
++ exportSeriesCategory( mxCategoriesValues );
+
+ // export values
+ if( xValueSeq.is() )
@@ -2913,19 +2934,12 @@ index 0000000..65a69e6
+ pFS->endElement( FSNS( XML_c, XML_spPr ) );
+}
+
-+void ChartExport::InitAxes(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram )
++void ChartExport::InitPlotArea( )
+{
-+ sal_Int32 nValue = 1;
-+ maAxisIdMap[ OUString(RTL_CONSTASCII_USTRINGPARAM("xAxis")) ] = nValue++;
-+ maAxisIdMap[ OUString(RTL_CONSTASCII_USTRINGPARAM("yAxis")) ] = nValue++;
-+ maAxisIdMap[ OUString(RTL_CONSTASCII_USTRINGPARAM("zAxis")) ] = nValue++;
-+ //maAxisIdMap[ OUString(RTL_CONSTASCII_USTRINGPARAM("serAx")) ] = nValue++;
-+
-+ Reference< XPropertySet > xDiagramProperties (xDiagram, uno::UNO_QUERY);
++ Reference< XPropertySet > xDiagramProperties (mxDiagram, uno::UNO_QUERY);
+
+ // Check for supported services and then the properties provided by this service.
-+ Reference<lang::XServiceInfo> xServiceInfo (xDiagram, uno::UNO_QUERY);
++ Reference<lang::XServiceInfo> xServiceInfo (mxDiagram, uno::UNO_QUERY);
+ if (xServiceInfo.is())
+ {
+ if (xServiceInfo->supportsService(
@@ -2962,19 +2976,174 @@ index 0000000..65a69e6
+
+ xDiagramProperties->getPropertyValue(
+ OUString (RTL_CONSTASCII_USTRINGPARAM ("Dim3D"))) >>= mbIs3DChart;
++
++ Reference< chart2::XChartDocument > xNewDoc( getModel(), uno::UNO_QUERY );
++ if( mbHasCategoryLabels && mxNewDiagram.is())
++ {
++ Reference< chart2::data::XLabeledDataSequence > xCategories( lcl_getCategories( mxNewDiagram ) );
++ if( xCategories.is() )
++ {
++ mxCategoriesValues.set( xCategories->getValues() );
++ }
++ }
+}
+
-+void ChartExport::exportAxes(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > xNewDiagram )
++void ChartExport::exportAxes( )
+{
-+ exportXAxis( xDiagram, xNewDiagram );
-+ exportYAxis( xDiagram, xNewDiagram );
++ sal_Int32 nSize = maAxes.size();
++ for( sal_Int32 nIdx = 0; nIdx < nSize; nIdx++ )
++ {
++ exportAxis( maAxes[nIdx] );
++ /*
++ sal_Int32 nAxisId = maAxes[nIdx].nAxisId;
++ switch( nAxisId )
++ {
++ case AXIS_PRIMARY_X:
++ exportXAxis( maAxes[nIdx] );
++ break;
++ case AXIS_PRIMARY_Y:
++ exportYAxis( maAxes[nIdx] );
++ break;
++ }
++ */
++ }
+}
+
-+void ChartExport::exportXAxis(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram > /*xNewDiagram*/ )
++void ChartExport::exportAxis( AxisIdPair aAxisIdPair )
++{
++ // get some properties from document first
++ sal_Bool bHasXAxisTitle = sal_False,
++ bHasYAxisTitle = sal_False,
++ bHasZAxisTitle = sal_False,
++ bHasSecondaryXAxisTitle = sal_False,
++ bHasSecondaryYAxisTitle = sal_False;
++ sal_Bool bHasXAxisMajorGrid = sal_False,
++ bHasXAxisMinorGrid = sal_False,
++ bHasYAxisMajorGrid = sal_False,
++ bHasYAxisMinorGrid = sal_False,
++ bHasZAxisMajorGrid = sal_False,
++ bHasZAxisMinorGrid = sal_False;
++
++ Reference< XPropertySet > xDiagramProperties (mxDiagram, uno::UNO_QUERY);
++
++ xDiagramProperties->getPropertyValue(
++ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasXAxisTitle"))) >>= bHasXAxisTitle;
++ xDiagramProperties->getPropertyValue(
++ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasYAxisTitle"))) >>= bHasYAxisTitle;
++ xDiagramProperties->getPropertyValue(
++ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasZAxisTitle"))) >>= bHasZAxisTitle;
++ xDiagramProperties->getPropertyValue(
++ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasSecondaryXAxisTitle"))) >>= bHasSecondaryXAxisTitle;
++ xDiagramProperties->getPropertyValue(
++ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasSecondaryYAxisTitle"))) >>= bHasSecondaryYAxisTitle;
++
++ xDiagramProperties->getPropertyValue(
++ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasXAxisGrid"))) >>= bHasXAxisMajorGrid;
++ xDiagramProperties->getPropertyValue(
++ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasYAxisGrid"))) >>= bHasYAxisMajorGrid;
++ xDiagramProperties->getPropertyValue(
++ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasZAxisGrid"))) >>= bHasZAxisMajorGrid;
++
++ xDiagramProperties->getPropertyValue(
++ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasXAxisHelpGrid"))) >>= bHasXAxisMinorGrid;
++ xDiagramProperties->getPropertyValue(
++ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasYAxisHelpGrid"))) >>= bHasYAxisMinorGrid;
++ xDiagramProperties->getPropertyValue(
++ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasZAxisHelpGrid"))) >>= bHasZAxisMinorGrid;
++
++ Reference< XPropertySet > xAxisProp;
++ Reference< drawing::XShape > xAxisTitle;
++ Reference< beans::XPropertySet > xMajorGrid;
++ Reference< beans::XPropertySet > xMinorGrid;
++ sal_Int32 nAxisType = XML_catAx;
++ const char* sAxPos = NULL;
++
++ switch( aAxisIdPair.nAxisType )
++ {
++ case AXIS_PRIMARY_X:
++ {
++ Reference< ::com::sun::star::chart::XAxisXSupplier > xAxisXSupp( mxDiagram, uno::UNO_QUERY );
++ if( xAxisXSupp.is())
++ xAxisProp = xAxisXSupp->getXAxis();
++ if( bHasXAxisTitle )
++ xAxisTitle.set( xAxisXSupp->getXAxisTitle(), uno::UNO_QUERY );
++ if( bHasXAxisMajorGrid )
++ xMajorGrid.set( xAxisXSupp->getXMainGrid(), uno::UNO_QUERY );
++ if( bHasXAxisMinorGrid )
++ xMinorGrid.set( xAxisXSupp->getXHelpGrid(), uno::UNO_QUERY );
++
++ sal_Int32 eChartType = getChartType( );
++ if( (eChartType == chart::TYPEID_SCATTER)
++ || (eChartType == chart::TYPEID_BUBBLE) )
++ nAxisType = XML_valAx;
++ else if( eChartType == chart::TYPEID_STOCK )
++ nAxisType = XML_dateAx;
++ // FIXME: axPos, need to check axis direction
++ sAxPos = "b";
++ break;
++ }
++ case AXIS_PRIMARY_Y:
++ {
++ Reference< ::com::sun::star::chart::XAxisYSupplier > xAxisYSupp( mxDiagram, uno::UNO_QUERY );
++ if( xAxisYSupp.is())
++ xAxisProp = xAxisYSupp->getYAxis();
++ if( bHasYAxisTitle )
++ xAxisTitle.set( xAxisYSupp->getYAxisTitle(), uno::UNO_QUERY );
++ if( bHasYAxisMajorGrid )
++ xMajorGrid.set( xAxisYSupp->getYMainGrid(), uno::UNO_QUERY );
++ if( bHasYAxisMinorGrid )
++ xMinorGrid.set( xAxisYSupp->getYHelpGrid(), uno::UNO_QUERY );
++
++ nAxisType = XML_valAx;
++ // FIXME: axPos, need to check axis direction
++ sAxPos = "l";
++ break;
++ }
++ case AXIS_PRIMARY_Z:
++ {
++ Reference< ::com::sun::star::chart::XAxisZSupplier > xAxisZSupp( mxDiagram, uno::UNO_QUERY );
++ if( xAxisZSupp.is())
++ xAxisProp = xAxisZSupp->getZAxis();
++ if( bHasZAxisTitle )
++ xAxisTitle.set( xAxisZSupp->getZAxisTitle(), uno::UNO_QUERY );
++ if( bHasZAxisMajorGrid )
++ xMajorGrid.set( xAxisZSupp->getZMainGrid(), uno::UNO_QUERY );
++ if( bHasZAxisMinorGrid )
++ xMinorGrid.set( xAxisZSupp->getZHelpGrid(), uno::UNO_QUERY );
++
++ sal_Int32 eChartType = getChartType( );
++ if( (eChartType == chart::TYPEID_SCATTER)
++ || (eChartType == chart::TYPEID_BUBBLE) )
++ nAxisType = XML_valAx;
++ else if( eChartType == chart::TYPEID_STOCK )
++ nAxisType = XML_dateAx;
++ // FIXME: axPos, need to check axis direction
++ sAxPos = "b";
++ break;
++ }
++ case AXIS_SECONDARY_Y:
++ {
++ Reference< ::com::sun::star::chart::XTwoAxisYSupplier > xAxisTwoYSupp( mxDiagram, uno::UNO_QUERY );
++ if( xAxisTwoYSupp.is())
++ xAxisProp = xAxisTwoYSupp->getSecondaryYAxis();
++ if( bHasSecondaryYAxisTitle )
++ {
++ Reference< ::com::sun::star::chart::XSecondAxisTitleSupplier > xAxisSupp( mxDiagram, uno::UNO_QUERY );
++ xAxisTitle.set( xAxisSupp->getSecondYAxisTitle(), uno::UNO_QUERY );
++ }
++
++ nAxisType = XML_valAx;
++ // FIXME: axPos, need to check axis direction
++ sAxPos = "l";
++ break;
++ }
++ }
++
++
++ _exportAxis( xAxisProp, xAxisTitle, xMajorGrid, xMinorGrid, nAxisType, sAxPos, aAxisIdPair );
++}
++
++void ChartExport::exportXAxis( AxisIdPair aAxisIdPair )
+{
+ // get some properties from document first
+ sal_Bool bHasXAxisTitle = sal_False,
@@ -2982,7 +3151,7 @@ index 0000000..65a69e6
+ sal_Bool bHasXAxisMajorGrid = sal_False,
+ bHasXAxisMinorGrid = sal_False;
+
-+ Reference< XPropertySet > xDiagramProperties (xDiagram, uno::UNO_QUERY);
++ Reference< XPropertySet > xDiagramProperties (mxDiagram, uno::UNO_QUERY);
+
+ xDiagramProperties->getPropertyValue(
+ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasXAxisTitle"))) >>= bHasXAxisTitle;
@@ -2996,7 +3165,7 @@ index 0000000..65a69e6
+ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasXAxisHelpGrid"))) >>= bHasXAxisMinorGrid;
+
+ // catAx
-+ Reference< ::com::sun::star::chart::XAxisXSupplier > xAxisXSupp( xDiagram, uno::UNO_QUERY );
++ Reference< ::com::sun::star::chart::XAxisXSupplier > xAxisXSupp( mxDiagram, uno::UNO_QUERY );
+ if( !xAxisXSupp.is())
+ return;
+
@@ -3005,15 +3174,13 @@ index 0000000..65a69e6
+ return;
+
+ sal_Int32 nAxisType = XML_catAx;
-+ sal_Int32 eChartType = getChartType( xDiagram );
++ sal_Int32 eChartType = getChartType( );
+ if( (eChartType == chart::TYPEID_SCATTER)
+ || (eChartType == chart::TYPEID_BUBBLE) )
+ nAxisType = XML_valAx;
+ else if( eChartType == chart::TYPEID_STOCK )
+ nAxisType = XML_dateAx;
+
-+ sal_Int32 nAxisId = maAxisIdMap[ OUString(RTL_CONSTASCII_USTRINGPARAM("xAxis")) ];
-+
+ Reference< drawing::XShape > xAxisTitle;
+ if( bHasXAxisTitle )
+ xAxisTitle.set( xAxisXSupp->getXAxisTitle(), uno::UNO_QUERY );
@@ -3030,14 +3197,10 @@ index 0000000..65a69e6
+ if( bHasXAxisMinorGrid )
+ xMinorGrid.set( xAxisXSupp->getXHelpGrid(), uno::UNO_QUERY );
+
-+ sal_Int32 nCrossAx = maAxisIdMap[ OUString(RTL_CONSTASCII_USTRINGPARAM("yAxis")) ];
-+
-+ _exportAxis( xAxisProp, xAxisTitle, xMajorGrid, xMinorGrid, nAxisType, sAxPos, nAxisId, nCrossAx );
++ _exportAxis( xAxisProp, xAxisTitle, xMajorGrid, xMinorGrid, nAxisType, sAxPos, aAxisIdPair );
+}
+
-+void ChartExport::exportYAxis(
-+ Reference< ::com::sun::star::chart::XDiagram > xDiagram,
-+ Reference< chart2::XDiagram >/* xNewDiagram */)
++void ChartExport::exportYAxis( AxisIdPair aAxisIdPair )
+{
+ // get some properties from document first
+ sal_Bool bHasYAxisTitle = sal_False,
@@ -3045,7 +3208,7 @@ index 0000000..65a69e6
+ sal_Bool bHasYAxisMajorGrid = sal_False,
+ bHasYAxisMinorGrid = sal_False;
+
-+ Reference< XPropertySet > xDiagramProperties (xDiagram, uno::UNO_QUERY);
++ Reference< XPropertySet > xDiagramProperties (mxDiagram, uno::UNO_QUERY);
+
+ xDiagramProperties->getPropertyValue(
+ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasYAxisTitle"))) >>= bHasYAxisTitle;
@@ -3057,7 +3220,7 @@ index 0000000..65a69e6
+ xDiagramProperties->getPropertyValue(
+ OUString (RTL_CONSTASCII_USTRINGPARAM ("HasYAxisHelpGrid"))) >>= bHasYAxisMinorGrid;
+
-+ Reference< ::com::sun::star::chart::XAxisYSupplier > xAxisYSupp( xDiagram, uno::UNO_QUERY );
++ Reference< ::com::sun::star::chart::XAxisYSupplier > xAxisYSupp( mxDiagram, uno::UNO_QUERY );
+ if( !xAxisYSupp.is())
+ return;
+
@@ -3066,7 +3229,6 @@ index 0000000..65a69e6
+ return;
+
+ sal_Int32 nAxisType = XML_valAx;
-+ sal_Int32 nAxisId = maAxisIdMap[ OUString(RTL_CONSTASCII_USTRINGPARAM("yAxis")) ];
+
+ Reference< drawing::XShape > xAxisTitle;
+ if( bHasYAxisTitle )
@@ -3085,9 +3247,7 @@ index 0000000..65a69e6
+ if( bHasYAxisMinorGrid )
+ xMinorGrid.set( xAxisYSupp->getYHelpGrid(), uno::UNO_QUERY );
+
-+ sal_Int32 nCrossAx = maAxisIdMap[ OUString(RTL_CONSTASCII_USTRINGPARAM("xAxis")) ];
-+
-+ _exportAxis( xAxisProp, xAxisTitle, xMajorGrid, xMinorGrid, nAxisType, sAxPos, nAxisId, nCrossAx );
++ _exportAxis( xAxisProp, xAxisTitle, xMajorGrid, xMinorGrid, nAxisType, sAxPos, aAxisIdPair );
+}
+
+void ChartExport::_exportAxis(
@@ -3097,14 +3257,13 @@ index 0000000..65a69e6
+ const Reference< XPropertySet >& xMinorGrid,
+ sal_Int32 nAxisType,
+ const char* sAxisPos,
-+ sal_Int32 nAxisId,
-+ sal_Int32 nCrossAx )
++ AxisIdPair aAxisIdPair )
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, nAxisType ),
+ FSEND );
+ pFS->singleElement( FSNS( XML_c, XML_axId ),
-+ XML_val, I32S( nAxisId ),
++ XML_val, I32S( aAxisIdPair.nAxisId ),
+ FSEND );
+
+ pFS->startElement( FSNS( XML_c, XML_scaling ),
@@ -3147,7 +3306,7 @@ index 0000000..65a69e6
+
+ sal_Bool bAutoMin = sal_False;
+ if(GetProperty( xAxisProp, S( "AutoMin" ) ) )
-+ mAny >>= bAutoMax;
++ mAny >>= bAutoMin;
+
+ if( !bAutoMin && (GetProperty( xAxisProp, S( "Min" ) ) ))
+ {
@@ -3275,7 +3434,7 @@ index 0000000..65a69e6
+ FSEND );
+
+ pFS->singleElement( FSNS( XML_c, XML_crossAx ),
-+ XML_val, I32S( nCrossAx ),
++ XML_val, I32S( aAxisIdPair.nCrossAx ),
+ FSEND );
+
+ // crosses & crossesAt
@@ -3377,8 +3536,7 @@ index 0000000..65a69e6
+
+void ChartExport::exportDataPoints(
+ const uno::Reference< beans::XPropertySet > & xSeriesProperties,
-+ sal_Int32 nSeriesLength,
-+ const uno::Reference< chart2::XDiagram > & xNewDiagram )
++ sal_Int32 nSeriesLength )
+{
+ uno::Reference< chart2::XDataSeries > xSeries( xSeriesProperties, uno::UNO_QUERY );
+ bool bVaryColorsByPoint = false;
@@ -3399,8 +3557,8 @@ index 0000000..65a69e6
+ sal_Int32 nElement;
+ //sal_Int32 nRepeat;
+ Reference< chart2::XColorScheme > xColorScheme;
-+ if( xNewDiagram.is())
-+ xColorScheme.set( xNewDiagram->getDefaultColorScheme());
++ if( mxNewDiagram.is())
++ xColorScheme.set( mxNewDiagram->getDefaultColorScheme());
+
+ if( bVaryColorsByPoint && xColorScheme.is() )
+ {
@@ -3448,23 +3606,102 @@ index 0000000..65a69e6
+ }
+}
+
-+void ChartExport::exportAxesId()
++void ChartExport::exportAxesId( sal_Int32 nAttachedAxis )
+{
++ sal_Int32 nAxisIdx = lcl_generateRandomValue();
++ sal_Int32 nAxisIdy = lcl_generateRandomValue();
++ sal_Int32 nAxisIdz = lcl_generateRandomValue();
++ maAxes.push_back( AxisIdPair( AXIS_PRIMARY_X, nAxisIdx, nAxisIdy ) );
++ maAxes.push_back( AxisIdPair( nAttachedAxis, nAxisIdy, nAxisIdx ) );
+ FSHelperPtr pFS = GetFS();
+ pFS->singleElement( FSNS( XML_c, XML_axId ),
-+ XML_val, I32S( maAxisIdMap[ OUString(RTL_CONSTASCII_USTRINGPARAM("xAxis")) ] ),
++ XML_val, I32S( nAxisIdx ),
+ FSEND );
+ pFS->singleElement( FSNS( XML_c, XML_axId ),
-+ XML_val, I32S( maAxisIdMap[ OUString(RTL_CONSTASCII_USTRINGPARAM("yAxis")) ] ),
++ XML_val, I32S( nAxisIdy ),
+ FSEND );
+ if( mbHasZAxis )
+ {
++ maAxes.push_back( AxisIdPair( AXIS_PRIMARY_Z, nAxisIdz, nAxisIdy ) );
+ pFS->singleElement( FSNS( XML_c, XML_axId ),
-+ XML_val, I32S( maAxisIdMap[ OUString(RTL_CONSTASCII_USTRINGPARAM("zAxis")) ] ),
++ XML_val, I32S( nAxisIdz ),
+ FSEND );
+ }
+}
+
++void ChartExport::exportGrouping()
++{
++ FSHelperPtr pFS = GetFS();
++ Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY);
++ // grouping
++ sal_Bool bStacked = sal_False;
++ if( GetProperty( xPropSet, S( "Stacked" ) ) )
++ mAny >>= bStacked;
++ sal_Bool bPercentage = sal_False;
++ if( GetProperty( xPropSet, S( "Percent" ) ) )
++ mAny >>= bPercentage;
++
++ const char* grouping = NULL;
++ if( bStacked )
++ grouping = "stacked";
++ else if( bPercentage )
++ grouping = "percentStacked";
++ else
++ grouping = "standard";
++ pFS->singleElement( FSNS( XML_c, XML_grouping ),
++ XML_val, grouping,
++ FSEND );
++}
++
++void ChartExport::exportMarker()
++{
++ FSHelperPtr pFS = GetFS();
++ pFS->startElement( FSNS( XML_c, XML_marker ),
++ FSEND );
++ Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY );
++ sal_Int32 nSymbolType = ::com::sun::star::chart::ChartSymbolType::NONE;
++ if( GetProperty( xPropSet, S( "SymbolType" ) ) )
++ mAny >>= nSymbolType;
++ // TODO: more properties support for marker
++ if( nSymbolType == ::com::sun::star::chart::ChartSymbolType::NONE )
++ {
++ pFS->singleElement( FSNS( XML_c, XML_symbol ),
++ XML_val, "none",
++ FSEND );
++ }
++ pFS->endElement( FSNS( XML_c, XML_marker ) );
++}
++
++void ChartExport::exportSmooth()
++{
++ FSHelperPtr pFS = GetFS();
++ Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY );
++ sal_Int32 nSplineType = 0;
++ if( GetProperty( xPropSet, S( "SplineType" ) ) )
++ mAny >>= nSplineType;
++ if( nSplineType != 0 )
++ {
++ pFS->singleElement( FSNS( XML_c, XML_smooth ),
++ XML_val, "1",
++ FSEND );
++ }
++}
++
++void ChartExport::exportFirstSliceAng( )
++{
++ FSHelperPtr pFS = GetFS();
++ sal_Int32 nStartingAngle = 0;
++ Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY);
++ if( GetProperty( xPropSet, S( "StartingAngle" ) ) )
++ mAny >>= nStartingAngle;
++
++ // convert to ooxml angle
++ nStartingAngle = (450 - nStartingAngle ) % 360;
++ pFS->singleElement( FSNS( XML_c, XML_firstSliceAng ),
++ XML_val, I32S( nStartingAngle ),
++ FSEND );
++}
++
+}// drawingml
+}// oox
+
More information about the ooo-build-commit
mailing list