diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-10-15 07:55:26 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-11-19 13:47:36 +0100 |
commit | 401f01caf5b357ac6c15b37a89c0a9aaeb46f4e4 (patch) | |
tree | 587823c8639fe4c5166ccd8a70b6a5335242677f /chart2/source/controller/dialogs/DataBrowserModel.cxx | |
parent | cf90715b35b11286d800c0e1d57ce3a62303e883 (diff) |
use ChartModel instead of XModel in a few places
This allows us easier implementation of some advanced features. Mainly
the 4D chartting will now be able to work without several ugly layers of
UNO.
Change-Id: I74d07229eaef921c508f3bab8fae6d6075ad737a
Diffstat (limited to 'chart2/source/controller/dialogs/DataBrowserModel.cxx')
-rw-r--r-- | chart2/source/controller/dialogs/DataBrowserModel.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx index 6e2c6576b269..8bfa963a0aaf 100644 --- a/chart2/source/controller/dialogs/DataBrowserModel.cxx +++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx @@ -31,6 +31,8 @@ #include "chartview/ExplicitValueProvider.hxx" #include "ExplicitCategoriesProvider.hxx" +#include "ChartModel.hxx" + #include <com/sun/star/container/XIndexReplace.hpp> #include <com/sun/star/chart2/XAxis.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> @@ -432,7 +434,7 @@ void DataBrowserModel::insertComplexCategoryLevel( sal_Int32 nAfterColumnIndex ) } m_apDialogModel->startControllerLockTimer(); - ControllerLockGuard aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) ); + ControllerLockGuardUNO aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) ); xDataProvider->insertComplexCategoryLevel( nAfterColumnIndex+1 ); updateFromModel(); } @@ -498,7 +500,7 @@ void DataBrowserModel::removeDataSeriesOrComplexCategoryLevel( sal_Int32 nAtColu if( xDataProvider.is() ) { m_apDialogModel->startControllerLockTimer(); - ControllerLockGuard aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) ); + ControllerLockGuardUNO aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) ); xDataProvider->deleteComplexCategoryLevel( nAtColumnIndex ); updateFromModel(); } @@ -526,7 +528,7 @@ void DataBrowserModel::swapDataPointForAllSeries( sal_Int32 nFirstIndex ) Reference< chart2::XInternalDataProvider > xDataProvider( m_apDialogModel->getDataProvider(), uno::UNO_QUERY ); // lockControllers - ControllerLockGuard aGuard( m_apDialogModel->getChartModel()); + ControllerLockGuardUNO aGuard( m_apDialogModel->getChartModel()); if( xDataProvider.is()) xDataProvider->swapDataPointWithNextOneForAllSequences( nFirstIndex ); // unlockControllers @@ -537,7 +539,7 @@ void DataBrowserModel::insertDataPointForAllSeries( sal_Int32 nAfterIndex ) Reference< chart2::XInternalDataProvider > xDataProvider( m_apDialogModel->getDataProvider(), uno::UNO_QUERY ); // lockControllers - ControllerLockGuard aGuard( m_apDialogModel->getChartModel()); + ControllerLockGuardUNO aGuard( m_apDialogModel->getChartModel()); if( xDataProvider.is()) xDataProvider->insertDataPointForAllSequences( nAfterIndex ); // unlockControllers @@ -548,7 +550,7 @@ void DataBrowserModel::removeDataPointForAllSeries( sal_Int32 nAtIndex ) Reference< chart2::XInternalDataProvider > xDataProvider( m_apDialogModel->getDataProvider(), uno::UNO_QUERY ); // lockControllers - ControllerLockGuard aGuard( m_apDialogModel->getChartModel()); + ControllerLockGuardUNO aGuard( m_apDialogModel->getChartModel()); if( xDataProvider.is()) xDataProvider->deleteDataPointForAllSequences( nAtIndex ); // unlockControllers @@ -663,7 +665,7 @@ bool DataBrowserModel::setCellAny( sal_Int32 nAtColumn, sal_Int32 nAtRow, const bResult = true; try { - ControllerLockGuard aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) ); + ControllerLockGuardUNO aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) ); // label if( nAtRow == -1 ) @@ -790,7 +792,8 @@ void DataBrowserModel::updateFromModel() if( lcl_ShowCategories( xDiagram )) { Reference< frame::XModel > xChartModel( m_xChartDocument, uno::UNO_QUERY ); - ExplicitCategoriesProvider aExplicitCategoriesProvider( ChartModelHelper::getFirstCoordinateSystem(xChartModel), xChartModel ); + ChartModel* pModel = dynamic_cast<ChartModel*>(xChartModel.get()); + ExplicitCategoriesProvider aExplicitCategoriesProvider( ChartModelHelper::getFirstCoordinateSystem(xChartModel), *pModel ); const Sequence< Reference< chart2::data::XLabeledDataSequence> >& rSplitCategoriesList( aExplicitCategoriesProvider.getSplitCategoriesList() ); sal_Int32 nLevelCount = rSplitCategoriesList.getLength(); |