diff options
author | Ingrid Halama [iha] <Ingrid.Halama@oracle.com> | 2010-12-01 13:46:27 +0100 |
---|---|---|
committer | Ingrid Halama [iha] <Ingrid.Halama@oracle.com> | 2010-12-01 13:46:27 +0100 |
commit | 4f958ff57dc8654ae10f6ee5da1e7a37a526d6ee (patch) | |
tree | 471eb2d0f82a7b938d5d0cf6057be67e911b5b75 /chart2 | |
parent | 039076d86f2fe956bfe9a13fb774a7ac71c73248 (diff) |
chart46: #i25706# implement date axis - switching to net chart
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/dialogs/tp_Scale.cxx | 2 | ||||
-rw-r--r-- | chart2/source/model/template/ChartTypeTemplate.cxx | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx index c2099c4ae460..7314764db49c 100644 --- a/chart2/source/controller/dialogs/tp_Scale.cxx +++ b/chart2/source/controller/dialogs/tp_Scale.cxx @@ -445,6 +445,8 @@ void ScaleTabPage::Reset(const SfxItemSet& rInAttrs) m_nAxisType=chart2::AxisType::REALNUMBER; if (rInAttrs.GetItemState(SCHATTR_AXISTYPE, TRUE, &pPoolItem) == SFX_ITEM_SET) m_nAxisType = (int) ((const SfxInt32Item*)pPoolItem)->GetValue(); + if( m_nAxisType==chart2::AxisType::DATE && !m_bAllowDateAxis ) + m_nAxisType=chart2::AxisType::CATEGORY; if( m_bAllowDateAxis ) { bool bAutoDateAxis = false; diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index 498be4e2daf9..82aa3e12075e 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -643,17 +643,21 @@ void ChartTypeTemplate::adaptScales( sal_Int32 nDim( xCooSys->getDimension()); if( nDim > 0 ) { - const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(0); + const sal_Int32 nDimensionX = 0; + const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionX); for(sal_Int32 nI=0; nI<=nMaxIndex; ++nI) { - Reference< XAxis > xAxis( xCooSys->getAxisByDimension(0,nI) ); + Reference< XAxis > xAxis( xCooSys->getAxisByDimension(nDimensionX,nI) ); if( xAxis.is()) { ScaleData aData( xAxis->getScaleData() ); aData.Categories = xCategories; if(bSupportsCategories) { - if( aData.AxisType != AxisType::CATEGORY && aData.AxisType != AxisType::DATE ) + + Reference< XChartType > xChartType( getChartTypeForNewSeries(Sequence< Reference< XChartType > >() )); + bool bSupportsDates = ::chart::ChartTypeHelper::isSupportingDateAxis( xChartType, 2, nDimensionX ); + if( aData.AxisType != AxisType::CATEGORY && ( aData.AxisType != AxisType::DATE || !bSupportsDates) ) { aData.AxisType = AxisType::CATEGORY; aData.AutoDateAxis = true; |