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/inc | |
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/inc')
-rw-r--r-- | chart2/source/inc/AxisHelper.hxx | 4 | ||||
-rw-r--r-- | chart2/source/inc/ChartModelHelper.hxx | 13 | ||||
-rw-r--r-- | chart2/source/inc/ControllerLockGuard.hxx | 18 | ||||
-rw-r--r-- | chart2/source/inc/DataSourceHelper.hxx | 6 | ||||
-rw-r--r-- | chart2/source/inc/DiagramHelper.hxx | 9 | ||||
-rw-r--r-- | chart2/source/inc/ExplicitCategoriesProvider.hxx | 13 | ||||
-rw-r--r-- | chart2/source/inc/LegendHelper.hxx | 12 | ||||
-rw-r--r-- | chart2/source/inc/ObjectIdentifier.hxx | 21 | ||||
-rw-r--r-- | chart2/source/inc/TitleHelper.hxx | 14 | ||||
-rw-r--r-- | chart2/source/inc/chartview/ExplicitValueProvider.hxx | 8 |
10 files changed, 86 insertions, 32 deletions
diff --git a/chart2/source/inc/AxisHelper.hxx b/chart2/source/inc/AxisHelper.hxx index f016495dd081..b6e4a611c9dd 100644 --- a/chart2/source/inc/AxisHelper.hxx +++ b/chart2/source/inc/AxisHelper.hxx @@ -28,6 +28,8 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#include "ChartModel.hxx" + #include <vector> namespace chart @@ -50,7 +52,7 @@ public: ::com::sun::star::chart2::XScaling >& xScaling ); static void checkDateAxis( ::com::sun::star::chart2::ScaleData& rScale, ExplicitCategoriesProvider* pExplicitCategoriesProvider, bool bChartTypeAllowsDateAxis ); - static ::com::sun::star::chart2::ScaleData getDateCheckedScale( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel ); + static ::com::sun::star::chart2::ScaleData getDateCheckedScale( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis, ChartModel& rModel ); static sal_Int32 getExplicitNumberFormatKeyForAxis( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis diff --git a/chart2/source/inc/ChartModelHelper.hxx b/chart2/source/inc/ChartModelHelper.hxx index 4ae5782c916f..9b947cd45a72 100644 --- a/chart2/source/inc/ChartModelHelper.hxx +++ b/chart2/source/inc/ChartModelHelper.hxx @@ -31,6 +31,8 @@ #include <com/sun/star/frame/XModel.hpp> #include "charttoolsdllapi.hxx" +#include "ChartModel.hxx" + #include <vector> namespace chart @@ -58,10 +60,18 @@ public: static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem > + getFirstCoordinateSystem( ChartModel& rModel ); + + static ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XCoordinateSystem > getFirstCoordinateSystem( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel ); SAL_DLLPRIVATE static ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > > getDataSeries( + ChartModel& rModel ); + + SAL_DLLPRIVATE static ::std::vector< ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XDataSeries > > getDataSeries( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > & xChartDoc ); static ::std::vector< ::com::sun::star::uno::Reference< @@ -93,8 +103,7 @@ public: static bool isIncludeHiddenCells( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel ); - static bool setIncludeHiddenCells( bool bIncludeHiddenCells, const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel >& xChartModel ); + static bool setIncludeHiddenCells( bool bIncludeHiddenCells, ChartModel& rModel); }; } //namespace chart diff --git a/chart2/source/inc/ControllerLockGuard.hxx b/chart2/source/inc/ControllerLockGuard.hxx index aa1bdaf70e51..22036d0605f0 100644 --- a/chart2/source/inc/ControllerLockGuard.hxx +++ b/chart2/source/inc/ControllerLockGuard.hxx @@ -21,6 +21,7 @@ #include <com/sun/star/frame/XModel.hpp> #include "charttoolsdllapi.hxx" +#include "ChartModel.hxx" namespace chart { @@ -29,17 +30,26 @@ namespace chart unlockControllers in the DTOR. Using this ensures that controllers do not remain locked when leaving a function even in case an exception is thrown. */ -class OOO_DLLPUBLIC_CHARTTOOLS ControllerLockGuard +class OOO_DLLPUBLIC_CHARTTOOLS ControllerLockGuardUNO { public: - explicit ControllerLockGuard( + explicit ControllerLockGuardUNO( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModel ); + ~ControllerLockGuardUNO(); + +private: + com::sun::star::uno::Reference< com::sun::star::frame::XModel > mxModel; +}; + +class OOO_DLLPUBLIC_CHARTTOOLS ControllerLockGuard +{ +public: + explicit ControllerLockGuard( ChartModel& rModel ); ~ControllerLockGuard(); private: - ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel > m_xModel; + ChartModel& mrModel; }; /** This helper class can be used to pass a locking mechanism to other objects diff --git a/chart2/source/inc/DataSourceHelper.hxx b/chart2/source/inc/DataSourceHelper.hxx index aa40363d9cde..a0f4d5b10f53 100644 --- a/chart2/source/inc/DataSourceHelper.hxx +++ b/chart2/source/inc/DataSourceHelper.hxx @@ -28,6 +28,8 @@ #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +#include "ChartModel.hxx" + #include "charttoolsdllapi.hxx" #include <vector> @@ -99,6 +101,10 @@ public: static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource > getUsedData( + ChartModel& rModel ); + + static ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::data::XDataSource > getUsedData( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel ); diff --git a/chart2/source/inc/DiagramHelper.hxx b/chart2/source/inc/DiagramHelper.hxx index febb2b9670e4..375aa70d51ca 100644 --- a/chart2/source/inc/DiagramHelper.hxx +++ b/chart2/source/inc/DiagramHelper.hxx @@ -33,6 +33,8 @@ #include <com/sun/star/util/XNumberFormats.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#include "ChartModel.hxx" + #include <utility> #include <vector> @@ -224,9 +226,7 @@ public: ::com::sun::star::chart2::XDiagram > & xDiagram ); static ::com::sun::star::uno::Sequence< OUString > - getExplicitSimpleCategories( - const ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::XChartDocument > & xChartDoc ); + getExplicitSimpleCategories( ChartModel& rModel ); SAL_DLLPRIVATE static ::com::sun::star::uno::Sequence< OUString > generateAutomaticCategoriesFromCooSys( @@ -340,8 +340,7 @@ public: static ::com::sun::star::awt::Rectangle getDiagramRectangleFromModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel ); - static bool switchDiagramPositioningToExcludingPositioning( const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel >& xChartModel + static bool switchDiagramPositioningToExcludingPositioning( ChartModel& rModel , bool bResetModifiedState //set model back to unchanged if it was unchanged before , bool bConvertAlsoFromAutoPositioning ); diff --git a/chart2/source/inc/ExplicitCategoriesProvider.hxx b/chart2/source/inc/ExplicitCategoriesProvider.hxx index ddc5ca5762b4..7b24560e34ae 100644 --- a/chart2/source/inc/ExplicitCategoriesProvider.hxx +++ b/chart2/source/inc/ExplicitCategoriesProvider.hxx @@ -24,8 +24,8 @@ #include <cppuhelper/weakref.hxx> #include <com/sun/star/chart2/XCoordinateSystem.hpp> #include <com/sun/star/chart2/data/XTextualDataSequence.hpp> -#include <com/sun/star/frame/XModel.hpp> #include "charttoolsdllapi.hxx" +#include "ChartModel.hxx" #include <vector> @@ -73,8 +73,7 @@ class OOO_DLLPUBLIC_CHARTTOOLS ExplicitCategoriesProvider public: ExplicitCategoriesProvider( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem >& xCooSysModel - , const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel >& xChartModel + , ChartModel& rChartModel ); virtual ~ExplicitCategoriesProvider(); @@ -89,8 +88,7 @@ public: static OUString getCategoryByIndex( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem >& xCooSysModel - , const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel >& xChartModel + , ChartModel& rModel , sal_Int32 nIndex ); static ::com::sun::star::uno::Sequence< OUString > getExplicitSimpleCategories( @@ -98,7 +96,7 @@ public: static void convertCategoryAnysToText( ::com::sun::star::uno::Sequence< OUString >& rOutTexts , const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rInAnys - , ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xChartModel ); + , ChartModel& rModel ); bool hasComplexCategories() const; sal_Int32 getCategoryLevelCount() const; @@ -113,8 +111,7 @@ private: //member bool volatile m_bDirty; ::com::sun::star::uno::WeakReference< ::com::sun::star::chart2::XCoordinateSystem > m_xCooSysModel; - ::com::sun::star::uno::WeakReference< - ::com::sun::star::frame::XModel > m_xChartModel; + ChartModel& mrModel; ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence> m_xOriginalCategories; diff --git a/chart2/source/inc/LegendHelper.hxx b/chart2/source/inc/LegendHelper.hxx index 98c5ee529cb4..e30297c42b6f 100644 --- a/chart2/source/inc/LegendHelper.hxx +++ b/chart2/source/inc/LegendHelper.hxx @@ -23,10 +23,11 @@ #include <rtl/ustring.hxx> #include <com/sun/star/chart2/XLegend.hpp> #include <com/sun/star/chart2/XDiagram.hpp> -#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include "charttoolsdllapi.hxx" +#include "ChartModel.hxx" + namespace chart { @@ -38,18 +39,15 @@ class OOO_DLLPUBLIC_CHARTTOOLS LegendHelper public: static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XLegend > - showLegend( const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel >& xModel + showLegend( ChartModel& rModel , const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); - static void hideLegend( const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel >& xModel ); + static void hideLegend( ChartModel& rModel ); static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XLegend > - getLegend( const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel >& xModel + getLegend( ChartModel& rModel , const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext = 0 , bool bCreate = false ); diff --git a/chart2/source/inc/ObjectIdentifier.hxx b/chart2/source/inc/ObjectIdentifier.hxx index 17b7f9c2afef..193e21421701 100644 --- a/chart2/source/inc/ObjectIdentifier.hxx +++ b/chart2/source/inc/ObjectIdentifier.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/chart2/XChartDocument.hpp> #include "TitleHelper.hxx" #include "charttoolsdllapi.hxx" +#include "ChartModel.hxx" // header for class OUString #include <rtl/ustring.hxx> @@ -104,6 +105,11 @@ public: static OUString createClassifiedIdentifierForObject( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xObject + , ChartModel& rModel); + + static OUString createClassifiedIdentifierForObject( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface >& xObject , const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel ); @@ -126,12 +132,22 @@ public: SAL_DLLPRIVATE static OUString createParticleForDiagram( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& xDiagram + , ChartModel& rModel); + + SAL_DLLPRIVATE static OUString createParticleForDiagram( + const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XDiagram >& xDiagram , const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel ); static OUString createParticleForCoordinateSystem( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem >& xCooSys + , ChartModel& rModel ); + + static OUString createParticleForCoordinateSystem( + const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XCoordinateSystem >& xCooSys , const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel ); @@ -147,6 +163,11 @@ public: static OUString createParticleForLegend( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XLegend >& xLegend + , ChartModel& rModel ); + + static OUString createParticleForLegend( + const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XLegend >& xLegend , const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel ); diff --git a/chart2/source/inc/TitleHelper.hxx b/chart2/source/inc/TitleHelper.hxx index 36c7a99c1533..f5f299f098ef 100644 --- a/chart2/source/inc/TitleHelper.hxx +++ b/chart2/source/inc/TitleHelper.hxx @@ -26,6 +26,8 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/chart2/XDiagram.hpp> +#include "ChartModel.hxx" + namespace chart { @@ -52,8 +54,13 @@ public: static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitle > getTitle( eTitleType nTitleIndex + , ChartModel& rModel ); + + static ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XTitle > + getTitle( eTitleType nTitleIndex , const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel >& xModel ); + ::com::sun::star::frame::XModel >& xModel ); static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitle > @@ -81,6 +88,11 @@ public: static bool getTitleType( eTitleType& rType , const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitle >& xTitle + , ChartModel& rModel); + + static bool getTitleType( eTitleType& rType + , const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XTitle >& xTitle , const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel ); }; diff --git a/chart2/source/inc/chartview/ExplicitValueProvider.hxx b/chart2/source/inc/chartview/ExplicitValueProvider.hxx index 0614ace7438f..5367c199ac5f 100644 --- a/chart2/source/inc/chartview/ExplicitValueProvider.hxx +++ b/chart2/source/inc/chartview/ExplicitValueProvider.hxx @@ -32,6 +32,8 @@ #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include "chartviewdllapi.hxx" +#include "ChartModel.hxx" + namespace chart { @@ -69,16 +71,14 @@ public: static ::com::sun::star::awt::Rectangle addAxisTitleSizes( - const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel >& xChartModel + ChartModel& rModel , const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xChartView , const ::com::sun::star::awt::Rectangle& rExcludingPositionAndSize ); static ::com::sun::star::awt::Rectangle substractAxisTitleSizes( - const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel >& xChartModel + ChartModel& rModel , const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xChartView , const ::com::sun::star::awt::Rectangle& rPositionAndSizeIncludingTitles ); |