diff options
author | Ingrid Halama [iha] <Ingrid.Halama@oracle.com> | 2011-01-12 14:36:07 +0100 |
---|---|---|
committer | Ingrid Halama [iha] <Ingrid.Halama@oracle.com> | 2011-01-12 14:36:07 +0100 |
commit | bb15dfd763af19c547a27c40882d9cdf1477f375 (patch) | |
tree | c61f11f2407c0ca3ab3072db2415984df595b7d5 /chart2/source/controller | |
parent | 9a8ff5c2508f78394dfda2e22c0b3b600000a284 (diff) |
chart46: #i25706# implement date axis - #i116425# interpret no data as text axis
Diffstat (limited to 'chart2/source/controller')
-rw-r--r-- | chart2/source/controller/dialogs/DataBrowserModel.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx index 7e93afd3b42e..a075f6c3a5c6 100644 --- a/chart2/source/controller/dialogs/DataBrowserModel.cxx +++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx @@ -43,6 +43,7 @@ #include "ExplicitCategoriesProvider.hxx" #include <com/sun/star/container/XIndexReplace.hpp> +#include <com/sun/star/chart2/XAxis.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> #include <com/sun/star/chart2/XInternalDataProvider.hpp> #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> @@ -800,8 +801,19 @@ void DataBrowserModel::updateFromModel() if( lcl_ShowCategories( xDiagram )) { Reference< frame::XModel > xChartModel( m_xChartDocument, uno::UNO_QUERY ); - ExplicitCategoriesProvider aExplicitCategoriesProvider( ChartModelHelper::getFirstCoordinateSystem(xChartModel), xChartModel ); - bool bIsDateAxis = aExplicitCategoriesProvider.isDateAxis(); + Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartModel ) ); + ExplicitCategoriesProvider aExplicitCategoriesProvider( xCooSys, xChartModel ); + bool bIsDateAxis = false; + if( xCooSys.is() ) + { + Reference< chart2::XAxis > xAxis( xCooSys->getAxisByDimension(0,0) ); + if( xAxis.is() ) + { + chart2::ScaleData aScale( xAxis->getScaleData() ); + bIsDateAxis = (aScale.AxisType == chart2::AxisType::DATE); + } + } + sal_Int32 nDateCategoriesNumberFormat = 0; if( bIsDateAxis && aCooSysSeq.getLength() ) nDateCategoriesNumberFormat = DataSeriesHelper::getNumberFormatKeyFromAxis( 0, aCooSysSeq[0], 0, 0 ); |