diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-03-26 20:52:16 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-03-26 23:14:58 -0400 |
commit | f6f179c502506ecc6bdbd689e1cd0c1972a628c2 (patch) | |
tree | f5060483f8490999fb2c9ab3978db13e5a0f77ab | |
parent | cea725111c239216324604c430e6084a828cf5f7 (diff) |
Pass the rounded edge property to the diagram object.
Change-Id: I71fa1bf82b879a1da69ca78d53bcf8072bdfa9ae
6 files changed, 42 insertions, 17 deletions
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index 04670ad0f127..a10ee39018c0 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -137,7 +137,9 @@ enum PROP_DIAGRAM_DATATABLEHBORDER, PROP_DIAGRAM_DATATABLEVBORDER, PROP_DIAGRAM_DATATABLEOUTLINE, - PROP_DIAGRAM_EXTERNALDATA + PROP_DIAGRAM_EXTERNALDATA, + + PROP_DIAGRAM_ROUNDED_EDGE }; void lcl_AddPropertiesToVector( @@ -444,6 +446,12 @@ void lcl_AddPropertiesToVector( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID )); + rOutProperties.push_back( + Property( "RoundedEdge", + PROP_DIAGRAM_ROUNDED_EDGE, + ::getCppuBooleanType(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID)); } struct StaticDiagramWrapperPropertyArray_Initializer diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx index 835de9e63929..4ade1fd7a118 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx @@ -60,7 +60,7 @@ ChartTypeParameter::ChartTypeParameter() , nGeometry3D(DataPointGeometry3D::CUBOID) , eThreeDLookScheme(ThreeDLookScheme_Realistic) , bSortByXValues(false) - , mbGLRoundedEdge(false) + , mbRoundedEdge(false) { } @@ -80,7 +80,7 @@ ChartTypeParameter::ChartTypeParameter( sal_Int32 SubTypeIndex, bool HasXAxisWit , nGeometry3D(DataPointGeometry3D::CUBOID) , eThreeDLookScheme(ThreeDLookScheme_Realistic) , bSortByXValues(false) - , mbGLRoundedEdge(false) + , mbRoundedEdge(false) { } ChartTypeParameter::~ChartTypeParameter() @@ -214,7 +214,7 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r CurveStyle eCurveStyle = rParameter.eCurveStyle; sal_Int32 nGeometry3D = rParameter.nGeometry3D; bool bSortByXValues = rParameter.bSortByXValues; - bool bGLRoundedEdge = rParameter.mbGLRoundedEdge; + bool bRoundedEdge = rParameter.mbRoundedEdge; rParameter = (*aIter).second; @@ -225,7 +225,7 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r rParameter.eCurveStyle = eCurveStyle; rParameter.nGeometry3D = nGeometry3D; rParameter.bSortByXValues = bSortByXValues; - rParameter.mbGLRoundedEdge = bGLRoundedEdge; + rParameter.mbRoundedEdge = bRoundedEdge; bFoundSomeMatch = true; break; @@ -338,11 +338,11 @@ bool ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParame if( rParameter.b3DLook ) ThreeDHelper::setScheme( xDiagram, rParameter.eThreeDLookScheme ); - //SortByXValues + uno::Reference<beans::XPropertySet> xDiaProp(xDiagram, uno::UNO_QUERY); + if (xDiaProp.is()) { - uno::Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY ); - if( xDiaProp.is() ) - xDiaProp->setPropertyValue( "SortByXValues" , uno::makeAny( rParameter.bSortByXValues ) ); + xDiaProp->setPropertyValue("SortByXValues" , uno::makeAny(rParameter.bSortByXValues)); + xDiaProp->setPropertyValue("RoundedEdge", uno::makeAny(rParameter.mbRoundedEdge)); } } return false; diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx index 991c806500ce..c4aee6202c8e 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx @@ -80,7 +80,7 @@ public: ThreeDLookScheme eThreeDLookScheme; bool bSortByXValues; - bool mbGLRoundedEdge; + bool mbRoundedEdge; }; typedef ::comphelper::MakeMap< OUString, ChartTypeParameter > tTemplateServiceChartTypeParameterMap; diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index b0c5c1fe2ab0..37e63f8b339a 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -296,12 +296,15 @@ public: void fillParameter( ChartTypeParameter& rParam ); private: + DECL_LINK( SettingChangedHdl, void* ); +private: CheckBox* m_pCB_RoundedEdge; }; GL3DResourceGroup::GL3DResourceGroup( VclBuilderContainer* pWindow ) { pWindow->get(m_pCB_RoundedEdge, "rounded-edge"); + m_pCB_RoundedEdge->SetToggleHdl( LINK(this, GL3DResourceGroup, SettingChangedHdl) ); } void GL3DResourceGroup::showControls( bool bShow ) @@ -311,12 +314,19 @@ void GL3DResourceGroup::showControls( bool bShow ) void GL3DResourceGroup::fillControls( const ChartTypeParameter& rParam ) { - m_pCB_RoundedEdge->Check(rParam.mbGLRoundedEdge); + m_pCB_RoundedEdge->Check(rParam.mbRoundedEdge); } void GL3DResourceGroup::fillParameter( ChartTypeParameter& rParam ) { - rParam.mbGLRoundedEdge = m_pCB_RoundedEdge->IsChecked(); + rParam.mbRoundedEdge = m_pCB_RoundedEdge->IsChecked(); +} + +IMPL_LINK_NOARG( GL3DResourceGroup, SettingChangedHdl ) +{ + if (m_pChangeListener) + m_pChangeListener->stateChanged(this); + return 0; } class SplinePropertiesDialog : public ModalDialog diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 6b80d367df55..157df268d26d 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -75,7 +75,8 @@ enum PROP_DIAGRAM_DATATABLEHBORDER, PROP_DIAGRAM_DATATABLEVBORDER, PROP_DIAGRAM_DATATABLEOUTLINE, - PROP_DIAGRAM_EXTERNALDATA + PROP_DIAGRAM_EXTERNALDATA, + PROP_DIAGRAM_ROUNDED_EDGE }; void lcl_AddPropertiesToVector( @@ -197,6 +198,11 @@ void lcl_AddPropertiesToVector( ::getCppuType( reinterpret_cast< const OUString * >(0)), beans::PropertyAttribute::MAYBEVOID )); + rOutProperties.push_back( + Property( "RoundedEdge", + PROP_DIAGRAM_ROUNDED_EDGE, + ::getCppuBooleanType(), + beans::PropertyAttribute::MAYBEVOID)); } struct StaticDiagramDefaults_Initializer @@ -219,6 +225,7 @@ private: ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_DATATABLEHBORDER, false ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_DATATABLEVBORDER, false ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_DATATABLEOUTLINE, false ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_ROUNDED_EDGE, false ); ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 ); ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_3DRELATIVEHEIGHT, 100 ); ::chart::SceneProperties::AddDefaultsToMap( rOutMap ); diff --git a/chart2/source/model/template/GL3DBarChartType.cxx b/chart2/source/model/template/GL3DBarChartType.cxx index b2a13cb29f57..4dc4e46ce140 100644 --- a/chart2/source/model/template/GL3DBarChartType.cxx +++ b/chart2/source/model/template/GL3DBarChartType.cxx @@ -22,7 +22,7 @@ namespace { enum { - PROP_GL3DCHARTTYPE_ROUNDED_RECTANGLE + PROP_GL3DCHARTTYPE_ROUNDED_EDGE }; struct DefaultsInitializer @@ -40,7 +40,7 @@ private: void addDefaults( tPropertyValueMap & rOutMap ) { - PropertyHelper::setPropertyValueDefault(rOutMap, PROP_GL3DCHARTTYPE_ROUNDED_RECTANGLE, false); + PropertyHelper::setPropertyValueDefault(rOutMap, PROP_GL3DCHARTTYPE_ROUNDED_EDGE, false); } }; @@ -59,8 +59,8 @@ struct InfoHelperInitializer uno::Sequence<beans::Property> aRet(1); aRet[0] = beans::Property( - "RoundedRectangle", - PROP_GL3DCHARTTYPE_ROUNDED_RECTANGLE, + "RoundedEdge", + PROP_GL3DCHARTTYPE_ROUNDED_EDGE, ::getCppuBooleanType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT); |