[Libreoffice-commits] core.git: Branch 'private/kohei/new-chart-type-skeleton' - chart2/source

Kohei Yoshida kohei.yoshida at collabora.com
Wed Mar 26 17:53:37 PDT 2014


 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx    |   10 +++++-
 chart2/source/controller/dialogs/ChartTypeDialogController.cxx |   16 +++++-----
 chart2/source/controller/dialogs/ChartTypeDialogController.hxx |    2 -
 chart2/source/controller/dialogs/tp_ChartType.cxx              |   14 +++++++-
 chart2/source/model/main/Diagram.cxx                           |    9 +++++
 chart2/source/model/template/GL3DBarChartType.cxx              |    8 ++---
 6 files changed, 42 insertions(+), 17 deletions(-)

New commits:
commit b54fa152efad24890e5d80822ebff003c41e1913
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Mar 26 20:52:16 2014 -0400

    Pass the rounded edge property to the diagram object.
    
    Change-Id: I71fa1bf82b879a1da69ca78d53bcf8072bdfa9ae

diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index 04670ad..a10ee39 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 835de9e6..4ade1fd 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 991c806..c4aee62 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 b0c5c1f..37e63f8 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 6b80d36..157df26 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 b2a13cb..4dc4e46 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);
 


More information about the Libreoffice-commits mailing list