diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-03-21 16:21:58 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-03-25 22:50:49 -0400 |
commit | be1152e0cc8286eaff05274c71843c3457948393 (patch) | |
tree | 19016a8e547203bee8ddd267f8585cb2f511757d /chart2 | |
parent | 56aaa39ff83962286fb7b627d847914f8144b750 (diff) |
List child type for GL3D bar chart type.
For now there is only one child type.
Change-Id: If39a3e75fdae62f0b20769c21e6a4e235ede941e
Diffstat (limited to 'chart2')
11 files changed, 75 insertions, 7 deletions
diff --git a/chart2/source/controller/dialogs/Bitmaps.hrc b/chart2/source/controller/dialogs/Bitmaps.hrc index b5fc1e736cc2..643ed3dadee1 100644 --- a/chart2/source/controller/dialogs/Bitmaps.hrc +++ b/chart2/source/controller/dialogs/Bitmaps.hrc @@ -199,6 +199,8 @@ // Bubble Chart Subtypes #define BMP_BUBBLE_1 (RID_APP_START + 88) +// GL3D Bar Chart subtypes. +#define BMP_GL3D_BAR_ROUNDRECT (RID_APP_START + 106) //further Images: diff --git a/chart2/source/controller/dialogs/Bitmaps.src b/chart2/source/controller/dialogs/Bitmaps.src index c0888440c4ec..49bd2f8b4147 100644 --- a/chart2/source/controller/dialogs/Bitmaps.src +++ b/chart2/source/controller/dialogs/Bitmaps.src @@ -97,6 +97,12 @@ Bitmap BMP_BUBBLE_1 { File = "bubble_52x60.png" ; }; + +Bitmap BMP_GL3D_BAR_ROUNDRECT +{ + File = "gl3dbar_roundrect.png"; +}; + Bitmap BMP_AREAS_2D { File = "areas_52x60.png" ; diff --git a/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx b/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx index 907c8f4ea2e0..053cbe744660 100644 --- a/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx +++ b/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx @@ -12,6 +12,8 @@ #include <Bitmaps.hrc> #include <ResId.hxx> +#include <svtools/valueset.hxx> + namespace chart { GL3DBarChartDialogController::GL3DBarChartDialogController() {} @@ -36,6 +38,15 @@ GL3DBarChartDialogController::getTemplateMap() const return aMap; } +void GL3DBarChartDialogController::fillSubTypeList( + ValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ ) +{ + rSubTypeList.Clear(); + rSubTypeList.InsertItem(1, Image(Bitmap(SchResId(BMP_GL3D_BAR_ROUNDRECT)))); + + rSubTypeList.SetItemText(1, SchResId(STR_GL3D_BAR).toString()); +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx b/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx index 72aac01bfc47..e2f31e26bf29 100644 --- a/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx +++ b/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx @@ -23,6 +23,8 @@ public: virtual OUString getName(); virtual Image getImage(); virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const; + + virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ); }; } diff --git a/chart2/source/controller/dialogs/Strings_ChartTypes.src b/chart2/source/controller/dialogs/Strings_ChartTypes.src index 3ece3a3a95b3..88717805f0d8 100644 --- a/chart2/source/controller/dialogs/Strings_ChartTypes.src +++ b/chart2/source/controller/dialogs/Strings_ChartTypes.src @@ -144,7 +144,12 @@ String STR_BUBBLE_1 String STR_TYPE_GL3D_BAR { - Text [ en-US ] = "GL 3D Bar"; + Text [ en-US ] = "GL3D Bar"; +}; + +String STR_GL3D_BAR +{ + Text [ en-US ] = "GL3D Bar Chart"; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/inc/Strings.hrc b/chart2/source/inc/Strings.hrc index f102f40fa8de..59de25d68de0 100644 --- a/chart2/source/inc/Strings.hrc +++ b/chart2/source/inc/Strings.hrc @@ -65,6 +65,7 @@ #define STR_BUBBLE_1 (RID_APP_START + 283) #define STR_TYPE_GL3D_BAR (RID_APP_START + 127) +#define STR_GL3D_BAR (RID_APP_START + 128) //additional strings #define STR_TEXT_SEPARATOR (RID_APP_START + 20) diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index 748d40d2d38a..6cc13bc0e34b 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -179,7 +179,6 @@ uno::Reference< XDiagram > SAL_CALL ChartTypeTemplate::createDiagramByDataSource } sal_Bool SAL_CALL ChartTypeTemplate::supportsCategories() - throw (uno::RuntimeException, std::exception) { return sal_True; } diff --git a/chart2/source/model/template/ChartTypeTemplate.hxx b/chart2/source/model/template/ChartTypeTemplate.hxx index 19278a2d1426..5f551b09e088 100644 --- a/chart2/source/model/template/ChartTypeTemplate.hxx +++ b/chart2/source/model/template/ChartTypeTemplate.hxx @@ -92,8 +92,8 @@ protected: const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments ) throw (::com::sun::star::uno::RuntimeException, std::exception); /// denotes if the chart needs categories at the first scale - virtual sal_Bool SAL_CALL supportsCategories() - throw (::com::sun::star::uno::RuntimeException, std::exception); + virtual sal_Bool SAL_CALL supportsCategories(); + virtual void SAL_CALL changeDiagram( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& xDiagram ) throw (::com::sun::star::uno::RuntimeException, std::exception); diff --git a/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx b/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx index 306481e5420e..262828c2c8aa 100644 --- a/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx +++ b/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx @@ -8,6 +8,8 @@ */ #include "GL3DBarChartTypeTemplate.hxx" +#include <servicenames_charttypes.hxx> +#include <macros.hxx> using namespace com::sun::star; @@ -21,14 +23,49 @@ GL3DBarChartTypeTemplate::~GL3DBarChartTypeTemplate() {} uno::Reference<chart2::XChartType> GL3DBarChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ ) { - return uno::Reference<chart2::XChartType>(); + uno::Reference<chart2::XChartType> xResult; + + try + { + uno::Reference<lang::XMultiServiceFactory> xFact( + GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW); + + xResult.set(xFact->createInstance(CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR), uno::UNO_QUERY_THROW); + } + catch (const uno::Exception & ex) + { + ASSERT_EXCEPTION( ex ); + } + + return xResult; } uno::Reference<chart2::XChartType> GL3DBarChartTypeTemplate::getChartTypeForNewSeries( - const uno::Sequence<uno::Reference<chart2::XChartType> >& /*xOldChartTypes*/ ) + const uno::Sequence<uno::Reference<chart2::XChartType> >& xOldChartTypes ) +{ + uno::Reference<chart2::XChartType> xResult; + + try + { + uno::Reference<lang::XMultiServiceFactory> xFact( + GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW); + + xResult.set(xFact->createInstance(CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR), uno::UNO_QUERY_THROW); + + ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem(xOldChartTypes, xResult); + } + catch (const uno::Exception & ex) + { + ASSERT_EXCEPTION( ex ); + } + + return xResult; +} + +sal_Bool GL3DBarChartTypeTemplate::supportsCategories() { - return uno::Reference<chart2::XChartType>(); + return false; } } diff --git a/chart2/source/model/template/GL3DBarChartTypeTemplate.hxx b/chart2/source/model/template/GL3DBarChartTypeTemplate.hxx index 257432918e4e..47a7b06cf2d7 100644 --- a/chart2/source/model/template/GL3DBarChartTypeTemplate.hxx +++ b/chart2/source/model/template/GL3DBarChartTypeTemplate.hxx @@ -34,6 +34,8 @@ public: virtual css::uno::Reference<css::chart2::XChartType> SAL_CALL getChartTypeForNewSeries( const css::uno::Sequence<css::uno::Reference<css::chart2::XChartType> >& xOldChartTypes ); + + virtual sal_Bool SAL_CALL supportsCategories(); }; } diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 944b31a63bff..5202cc10dee2 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -2416,6 +2416,9 @@ VSeriesPlotter* VSeriesPlotter::createSeriesPlotter( , sal_Int32 nDimensionCount , bool bExcludingPositioning ) { + if (!xChartTypeModel.is()) + return NULL; + OUString aChartType = xChartTypeModel->getChartType(); VSeriesPlotter* pRet=NULL; |