diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-07-30 10:55:16 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-07-30 10:55:16 +0000 |
commit | dfab6e703d4d70a33a6d3f2d05d0481423f63e44 (patch) | |
tree | aacc1993377187ddfe50c1d5df9191b008a9f83a | |
parent | aa453b713a09c8a1d570ec5669360e49f71935c2 (diff) |
INTEGRATION: CWS chart22 (1.18.40); FILE MERGED
2008/07/30 10:18:26 iha 1.18.40.3: RESYNC: (1.20-1.21); FILE MERGED
2008/04/17 11:30:49 iha 1.18.40.2: RESYNC: (1.18-1.20); FILE MERGED
2008/02/21 16:58:13 iha 1.18.40.1: #i65549# Plotting of missing values
-rw-r--r-- | chart2/source/model/template/ChartTypeTemplate.cxx | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index af9acab1c..ca7f99da3 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ChartTypeTemplate.cxx,v $ - * $Revision: 1.21 $ + * $Revision: 1.22 $ * * This file is part of OpenOffice.org. * @@ -145,6 +145,21 @@ void lcl_resetLabelPlacementIfDefault( const Reference< beans::XPropertySet >& x } } +void lcl_ensureCorrectMissingValueTreatment( const Reference< chart2::XDiagram >& xDiagram, const Reference< XChartType >& xChartType ) +{ + Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY ); + if( xDiaProp.is() ) + { + uno::Sequence < sal_Int32 > aAvailableMissingValueTreatment( + ::chart::ChartTypeHelper::getSupportedMissingValueTreatments( xChartType ) ); + + if( aAvailableMissingValueTreatment.getLength() ) + xDiaProp->setPropertyValue( C2U( "MissingValueTreatment" ), uno::makeAny( aAvailableMissingValueTreatment[0] ) ); + else + xDiaProp->setPropertyValue( C2U( "MissingValueTreatment" ), uno::Any() ); + } +} + } // anonymous namespace namespace chart @@ -467,7 +482,7 @@ void SAL_CALL ChartTypeTemplate::applyStyle( if( xSeriesProp->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= aAttributedDataPointIndexList ) for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;) lcl_ensureCorrectLabelPlacement( xSeries->getDataPointByIndex(aAttributedDataPointIndexList[nN]), aAvailablePlacements ); - } + } } catch( const uno::Exception & ex ) { @@ -476,6 +491,23 @@ void SAL_CALL ChartTypeTemplate::applyStyle( } } +void SAL_CALL ChartTypeTemplate::applyStyles( const Reference< chart2::XDiagram >& xDiagram ) + throw (uno::RuntimeException) +{ + // apply chart-type specific styles, like "symbols on" for example + Sequence< Sequence< Reference< XDataSeries > > > aNewSeriesSeq( + DiagramHelper::getDataSeriesGroups( xDiagram )); + for( sal_Int32 i=0; i<aNewSeriesSeq.getLength(); ++i ) + { + const sal_Int32 nNumSeries = aNewSeriesSeq[i].getLength(); + for( sal_Int32 j=0; j<nNumSeries; ++j ) + applyStyle( aNewSeriesSeq[i][j], i, j, nNumSeries ); + } + + //ensure valid empty cell handling (for first chart type...) + lcl_ensureCorrectMissingValueTreatment( xDiagram, getChartTypeForIndex( 0 ) ); +} + void SAL_CALL ChartTypeTemplate::resetStyles( const Reference< chart2::XDiagram >& xDiagram ) throw (uno::RuntimeException) { @@ -826,16 +858,7 @@ void ChartTypeTemplate::FillDiagram( // chart types createChartTypes( aSeriesSeq, aCoordinateSystems, aOldChartTypesSeq ); - - // apply chart-type specific styles, like "symbols on" - Sequence< Sequence< Reference< XDataSeries > > > aNewSeriesSeq( - DiagramHelper::getDataSeriesGroups( xDiagram )); - for( sal_Int32 i=0; i<aNewSeriesSeq.getLength(); ++i ) - { - const sal_Int32 nNumSeries = aNewSeriesSeq[i].getLength(); - for( sal_Int32 j=0; j<nNumSeries; ++j ) - applyStyle( aNewSeriesSeq[i][j], i, j, nNumSeries ); - } + applyStyles( xDiagram ); } catch( const uno::Exception & ex ) { |