summaryrefslogtreecommitdiff
path: root/chart2/source/model
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-07-30 10:55:16 +0000
committerRüdiger Timm <rt@openoffice.org>2008-07-30 10:55:16 +0000
commit8347d8363af13717f86c913490305d710a2872a2 (patch)
tree1d08350dd612e816f02145e15700436c5863c664 /chart2/source/model
parent2649239416c939259ec3b015acfd47c01e273b69 (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
Diffstat (limited to 'chart2/source/model')
-rw-r--r--chart2/source/model/template/ChartTypeTemplate.cxx45
1 files changed, 34 insertions, 11 deletions
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index 1698f1593d72..5d28ce8f9fa2 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
@@ -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 )
{