[Libreoffice-commits] core.git: 6 commits - chart2/source chart2/uiconfig include/xmloff udkapi/com xmloff/source

Kohei Yoshida kohei.yoshida at collabora.com
Wed Mar 26 20:19:15 PDT 2014


 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx       |   10 
 chart2/source/controller/dialogs/ChartTypeDialogController.cxx    |   17 +
 chart2/source/controller/dialogs/ChartTypeDialogController.hxx    |    3 
 chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx |    5 
 chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx |    2 
 chart2/source/controller/dialogs/tp_ChartType.cxx                 |  111 +++++++---
 chart2/source/controller/dialogs/tp_ChartType.hxx                 |    2 
 chart2/source/model/main/Diagram.cxx                              |    9 
 chart2/source/model/template/GL3DBarChartType.cxx                 |   95 ++++++++
 chart2/source/model/template/GL3DBarChartType.hxx                 |   19 +
 chart2/uiconfig/ui/tp_ChartType.ui                                |   25 ++
 include/xmloff/xmltoken.hxx                                       |    1 
 udkapi/com/sun/star/beans/PropertyAttribute.idl                   |    4 
 xmloff/source/chart/PropertyMap.hxx                               |    3 
 xmloff/source/core/xmltoken.cxx                                   |    1 
 15 files changed, 269 insertions(+), 38 deletions(-)

New commits:
commit d87240c0b2fba39b437f87be2b3c9cf54ad0ee5f
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Mar 26 23:07:14 2014 -0400

    Make sure to set the RoundedEdge check box on load.
    
    Change-Id: Ic62e3f26b2cda28e823c465efb78a397fe781d51

diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 37e63f8..ab7f525 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -37,27 +37,6 @@ namespace chart
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::chart2;
 
-namespace
-{
-    sal_Bool lcl_getSortByXValues( const uno::Reference< chart2::XChartDocument >& xChartDoc )
-    {
-        sal_Bool bRet = sal_False;
-        if( xChartDoc.is() )
-        {
-            try
-            {
-                uno::Reference< beans::XPropertySet > xDiaProp( xChartDoc->getFirstDiagram(), uno::UNO_QUERY_THROW );
-                xDiaProp->getPropertyValue( "SortByXValues" ) >>= bRet;
-            }
-            catch( const uno::Exception & ex )
-            {
-                ASSERT_EXCEPTION( ex );
-            }
-        }
-        return bRet;
-    }
-}
-
 #define POS_3DSCHEME_SIMPLE    0
 #define POS_3DSCHEME_REALISTIC 1
 
@@ -848,8 +827,18 @@ void ChartTypeTabPage::stateChanged( ChangingResource* /*pResource*/ )
         commitToModel( aParameter );
 
     //detect the new ThreeDLookScheme
-    aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme( ChartModelHelper::findDiagram( m_xChartModel ) );
-    aParameter.bSortByXValues = lcl_getSortByXValues( m_xChartModel );
+    uno::Reference<XDiagram> xDiagram = ChartModelHelper::findDiagram(m_xChartModel);
+    aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme(xDiagram);
+    try
+    {
+        uno::Reference<beans::XPropertySet> xPropSet(xDiagram, uno::UNO_QUERY_THROW);
+        xPropSet->getPropertyValue("SortByXValues") >>= aParameter.bSortByXValues;
+        xPropSet->getPropertyValue("RoundedEdge") >>= aParameter.mbRoundedEdge;
+    }
+    catch ( const uno::Exception& ex )
+    {
+        ASSERT_EXCEPTION(ex);
+    }
     //the controls have to be enabled/disabled accordingly
     this->fillAllControls( aParameter );
 
@@ -906,7 +895,18 @@ void ChartTypeTabPage::selectMainType()
         if(!aParameter.b3DLook && aParameter.eThreeDLookScheme!=ThreeDLookScheme_Realistic )
             aParameter.eThreeDLookScheme=ThreeDLookScheme_Realistic;
 
-        aParameter.bSortByXValues = lcl_getSortByXValues( m_xChartModel );
+        uno::Reference<XDiagram> xDiagram = ChartModelHelper::findDiagram(m_xChartModel);
+        try
+        {
+            uno::Reference<beans::XPropertySet> xPropSet(xDiagram, uno::UNO_QUERY_THROW);
+            xPropSet->getPropertyValue("SortByXValues") >>= aParameter.bSortByXValues;
+            xPropSet->getPropertyValue("RoundedEdge") >>= aParameter.mbRoundedEdge;
+        }
+        catch ( const uno::Exception& ex )
+        {
+            ASSERT_EXCEPTION(ex);
+        }
+
         this->fillAllControls( aParameter );
         uno::Reference< beans::XPropertySet > xTemplateProps( this->getCurrentTemplate(), uno::UNO_QUERY );
         m_pCurrentMainType->fillExtraControls(aParameter,m_xChartModel,xTemplateProps);
@@ -981,7 +981,16 @@ void ChartTypeTabPage::initializePage()
             if(!aParameter.b3DLook && aParameter.eThreeDLookScheme!=ThreeDLookScheme_Realistic )
                 aParameter.eThreeDLookScheme=ThreeDLookScheme_Realistic;
 
-            aParameter.bSortByXValues = lcl_getSortByXValues( m_xChartModel );
+            try
+            {
+                uno::Reference<beans::XPropertySet> xPropSet(xDiagram, uno::UNO_QUERY_THROW);
+                xPropSet->getPropertyValue("SortByXValues") >>= aParameter.bSortByXValues;
+                xPropSet->getPropertyValue("RoundedEdge") >>= aParameter.mbRoundedEdge;
+            }
+            catch (const uno::Exception& ex)
+            {
+                ASSERT_EXCEPTION(ex);
+            }
 
             this->fillAllControls( aParameter );
             if( m_pCurrentMainType )
commit defa767632511fd1c0ebcb9388b2a1ddc1ffb2db
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Mar 26 22:46:43 2014 -0400

    Export RoundedEdge property to ODF.
    
    Change-Id: I3b20ef70dac4dc9905a169245e0b48b98a20c697

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 3a5996a..6f6ad44 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -1533,6 +1533,7 @@ namespace xmloff { namespace token {
         XML_ROTATION_ALIGN,
         XML_ROTATION_ANGLE,
         XML_ROUND,
+        XML_ROUNDED_EDGE,
         XML_ROW,
         XML_ROW_HEIGHT,
         XML_ROW_NUMBER,
diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx
index 81a18dd..4f307b0 100644
--- a/xmloff/source/chart/PropertyMap.hxx
+++ b/xmloff/source/chart/PropertyMap.hxx
@@ -143,6 +143,9 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
     MAP_ENTRY_ODF_EXT( "BuiltInUnit", LO_EXT, XML_CHART_DUNITS_BUILTINUNIT, XML_TYPE_STRING ),
     MAP_ENTRY_ODF_EXT( "ExternalData", LO_EXT, XML_EXTERNALDATA, XML_TYPE_STRING),
 
+    // OpenGL 3D chart flags
+    MAP_ENTRY_ODF_EXT( "RoundedEdge", LO_EXT, XML_ROUNDED_EDGE, XML_TYPE_BOOL),
+
     MAP_ENTRY( "ScaleText", CHART, XML_SCALE_TEXT, XML_TYPE_BOOL ),
 
     // spline settings
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index e013431..4002ae0 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -1538,6 +1538,7 @@ namespace xmloff { namespace token {
         TOKEN( "rotation-align",                  XML_ROTATION_ALIGN ),
         TOKEN( "rotation-angle",                  XML_ROTATION_ANGLE ),
         TOKEN( "round",                           XML_ROUND ),
+        TOKEN( "rounded-edge",                    XML_ROUNDED_EDGE ),
         TOKEN( "row",                             XML_ROW ),
         TOKEN( "row-height",                      XML_ROW_HEIGHT ),
         TOKEN( "row-number",                      XML_ROW_NUMBER ),
commit f6f179c502506ecc6bdbd689e1cd0c1972a628c2
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);
 
commit cea725111c239216324604c430e6084a828cf5f7
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Mar 26 15:38:25 2014 -0400

    Add the UI bits for showing "rounded edge" property for GL3D chart.
    
    Change-Id: Ia6083c423bf8286a0b562d490283f8e1328a0124

diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index c3faa74..835de9e6 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -60,6 +60,7 @@ ChartTypeParameter::ChartTypeParameter()
                     , nGeometry3D(DataPointGeometry3D::CUBOID)
                     , eThreeDLookScheme(ThreeDLookScheme_Realistic)
                     , bSortByXValues(false)
+                    , mbGLRoundedEdge(false)
 {
 }
 
@@ -79,6 +80,7 @@ ChartTypeParameter::ChartTypeParameter( sal_Int32 SubTypeIndex, bool HasXAxisWit
                     , nGeometry3D(DataPointGeometry3D::CUBOID)
                     , eThreeDLookScheme(ThreeDLookScheme_Realistic)
                     , bSortByXValues(false)
+                    , mbGLRoundedEdge(false)
 {
 }
 ChartTypeParameter::~ChartTypeParameter()
@@ -212,6 +214,7 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r
                 CurveStyle       eCurveStyle = rParameter.eCurveStyle;
                 sal_Int32        nGeometry3D = rParameter.nGeometry3D;
                 bool             bSortByXValues = rParameter.bSortByXValues;
+                bool bGLRoundedEdge = rParameter.mbGLRoundedEdge;
 
                 rParameter = (*aIter).second;
 
@@ -222,6 +225,7 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r
                 rParameter.eCurveStyle = eCurveStyle;
                 rParameter.nGeometry3D = nGeometry3D;
                 rParameter.bSortByXValues = bSortByXValues;
+                rParameter.mbGLRoundedEdge = bGLRoundedEdge;
 
                 bFoundSomeMatch = true;
                 break;
@@ -372,6 +376,11 @@ bool ChartTypeDialogController::shouldShow_SortByXValuesResourceGroup() const
     return false;
 }
 
+bool ChartTypeDialogController::shouldShow_GL3DResourceGroup() const
+{
+    return false;
+}
+
 void ChartTypeDialogController::showExtraControls( VclBuilderContainer* /*pParent*/ )
 {
 }
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
index 4d450b0..991c806 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
@@ -79,6 +79,8 @@ public:
 
     ThreeDLookScheme    eThreeDLookScheme;
     bool                bSortByXValues;
+
+    bool mbGLRoundedEdge;
 };
 
 typedef ::comphelper::MakeMap< OUString, ChartTypeParameter > tTemplateServiceChartTypeParameterMap;
@@ -100,6 +102,7 @@ public:
     virtual bool    shouldShow_SplineControl() const;
     virtual bool    shouldShow_GeometryControl() const;
     virtual bool    shouldShow_SortByXValuesResourceGroup() const;
+    virtual bool    shouldShow_GL3DResourceGroup() const;
 
     virtual void    showExtraControls(VclBuilderContainer* pParent);
     virtual void    hideExtraControls() const;
diff --git a/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx b/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx
index 1b3bfdc..08cb2ec 100644
--- a/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx
+++ b/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx
@@ -20,6 +20,11 @@ GL3DBarChartDialogController::GL3DBarChartDialogController() {}
 
 GL3DBarChartDialogController::~GL3DBarChartDialogController() {}
 
+bool GL3DBarChartDialogController::shouldShow_GL3DResourceGroup() const
+{
+    return true;
+}
+
 OUString GL3DBarChartDialogController::getName()
 {
     return SchResId(STR_TYPE_GL3D_BAR).toString();
diff --git a/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx b/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx
index e2f31e2..0adba32 100644
--- a/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx
+++ b/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx
@@ -20,6 +20,8 @@ public:
     GL3DBarChartDialogController();
     virtual ~GL3DBarChartDialogController();
 
+    virtual bool shouldShow_GL3DResourceGroup() const;
+
     virtual OUString getName();
     virtual Image getImage();
     virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const;
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 3a880ec..b0c5c1f 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -285,6 +285,40 @@ IMPL_LINK_NOARG(StackingResourceGroup, StackingEnableHdl)
         m_pChangeListener->stateChanged(this);
     return 0;
 }
+
+class GL3DResourceGroup : public ChangingResource
+{
+public:
+    GL3DResourceGroup( VclBuilderContainer* pWindow );
+
+    void showControls( bool bShow );
+    void fillControls( const ChartTypeParameter& rParam );
+    void fillParameter( ChartTypeParameter& rParam );
+
+private:
+    CheckBox* m_pCB_RoundedEdge;
+};
+
+GL3DResourceGroup::GL3DResourceGroup( VclBuilderContainer* pWindow )
+{
+    pWindow->get(m_pCB_RoundedEdge, "rounded-edge");
+}
+
+void GL3DResourceGroup::showControls( bool bShow )
+{
+    m_pCB_RoundedEdge->Show(bShow);
+}
+
+void GL3DResourceGroup::fillControls( const ChartTypeParameter& rParam )
+{
+    m_pCB_RoundedEdge->Check(rParam.mbGLRoundedEdge);
+}
+
+void GL3DResourceGroup::fillParameter( ChartTypeParameter& rParam )
+{
+    rParam.mbGLRoundedEdge = m_pCB_RoundedEdge->IsChecked();
+}
+
 class SplinePropertiesDialog : public ModalDialog
 {
 public:
@@ -662,6 +696,7 @@ ChartTypeTabPage::ChartTypeTabPage(Window* pParent
         , m_pSplineResourceGroup( new SplineResourceGroup(this) )
         , m_pGeometryResourceGroup( new GeometryResourceGroup( this ) )
         , m_pSortByXValuesResourceGroup( new SortByXValuesResourceGroup( this ) )
+        , m_pGL3DResourceGroup(new GL3DResourceGroup(this))
         , m_xChartModel( xChartModel )
         , m_xCC( xContext )
         , m_aChartTypeDialogControllerList(0)
@@ -744,6 +779,7 @@ ChartTypeTabPage::ChartTypeTabPage(Window* pParent
     m_pSplineResourceGroup->setChangeListener( this );
     m_pGeometryResourceGroup->setChangeListener( this );
     m_pSortByXValuesResourceGroup->setChangeListener( this );
+    m_pGL3DResourceGroup->setChangeListener(this);
 }
 
 ChartTypeTabPage::~ChartTypeTabPage()
@@ -763,6 +799,7 @@ ChartTypeTabPage::~ChartTypeTabPage()
     delete m_pSplineResourceGroup;
     delete m_pGeometryResourceGroup;
     delete m_pSortByXValuesResourceGroup;
+    delete m_pGL3DResourceGroup;
 }
 ChartTypeParameter ChartTypeTabPage::getCurrentParamter() const
 {
@@ -773,6 +810,7 @@ ChartTypeParameter ChartTypeTabPage::getCurrentParamter() const
     m_pSplineResourceGroup->fillParameter( aParameter );
     m_pGeometryResourceGroup->fillParameter( aParameter );
     m_pSortByXValuesResourceGroup->fillParameter( aParameter );
+    m_pGL3DResourceGroup->fillParameter(aParameter);
     return aParameter;
 }
 void ChartTypeTabPage::commitToModel( const ChartTypeParameter& rParameter )
@@ -879,6 +917,8 @@ void ChartTypeTabPage::showAllControls( ChartTypeDialogController& rTypeControll
     m_pGeometryResourceGroup->showControls( bShow );
     bShow = rTypeController.shouldShow_SortByXValuesResourceGroup();
     m_pSortByXValuesResourceGroup->showControls( bShow );
+    bShow = rTypeController.shouldShow_GL3DResourceGroup();
+    m_pGL3DResourceGroup->showControls(bShow);
     rTypeController.showExtraControls(this);
 }
 
@@ -895,6 +935,7 @@ void ChartTypeTabPage::fillAllControls( const ChartTypeParameter& rParameter, bo
     m_pSplineResourceGroup->fillControls( rParameter );
     m_pGeometryResourceGroup->fillControls( rParameter );
     m_pSortByXValuesResourceGroup->fillControls( rParameter );
+    m_pGL3DResourceGroup->fillControls(rParameter);
     m_nChangingCalls--;
 }
 
@@ -947,6 +988,7 @@ void ChartTypeTabPage::initializePage()
         m_pSplineResourceGroup->showControls( false );
         m_pGeometryResourceGroup->showControls( false );
         m_pSortByXValuesResourceGroup->showControls( false );
+        m_pGL3DResourceGroup->showControls(false);
     }
 }
 
diff --git a/chart2/source/controller/dialogs/tp_ChartType.hxx b/chart2/source/controller/dialogs/tp_ChartType.hxx
index ea46e2bb..87c59c2 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.hxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.hxx
@@ -45,6 +45,7 @@ class SplineResourceGroup;
 class GeometryResourceGroup;
 class ChartTypeParameter;
 class SortByXValuesResourceGroup;
+class GL3DResourceGroup;
 
 class ChartTypeTabPage : public ResourceChangeListener, public svt::OWizardPage, public ChartTypeTemplateProvider
 {
@@ -87,6 +88,7 @@ protected:
     SplineResourceGroup*        m_pSplineResourceGroup;
     GeometryResourceGroup*      m_pGeometryResourceGroup;
     SortByXValuesResourceGroup* m_pSortByXValuesResourceGroup;
+    GL3DResourceGroup* m_pGL3DResourceGroup;
 
     ::com::sun::star::uno::Reference<
                        ::com::sun::star::chart2::XChartDocument >   m_xChartModel;
diff --git a/chart2/source/model/template/GL3DBarChartType.cxx b/chart2/source/model/template/GL3DBarChartType.cxx
index 7b94095..b2a13cb 100644
--- a/chart2/source/model/template/GL3DBarChartType.cxx
+++ b/chart2/source/model/template/GL3DBarChartType.cxx
@@ -104,9 +104,10 @@ APPHELPER_XSERVICEINFO_IMPL(
 
 uno::Sequence<OUString> GL3DBarChartType::getSupportedServiceNames_Static()
 {
-    uno::Sequence<OUString> aServices(2);
+    uno::Sequence<OUString> aServices(3);
     aServices[0] = CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR;
     aServices[1] = "com.sun.star.chart2.ChartType";
+    aServices[2] = "com.sun.star.beans.PropertySet";
     return aServices;
 }
 
diff --git a/chart2/uiconfig/ui/tp_ChartType.ui b/chart2/uiconfig/ui/tp_ChartType.ui
index 27067d0..cc4452b 100644
--- a/chart2/uiconfig/ui/tp_ChartType.ui
+++ b/chart2/uiconfig/ui/tp_ChartType.ui
@@ -412,6 +412,31 @@
                     <property name="height">1</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkGrid" id="gl3dblock">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <object class="GtkCheckButton" id="rounded-edge">
+                        <property name="label" translatable="yes">Rounded edge</property>
+                        <property name="can_focus">True</property>
+                        <property name="no_show_all">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">3</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
               </object>
               <packing>
                 <property name="left_attach">1</property>
commit e1823a9f8abc8907f155215bc5f5280d06c41d82
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Mar 26 14:28:19 2014 -0400

    Add a boolean "RoundedRectangle" property to the GL 3D chart.
    
    Change-Id: I3cb23461718c5713c1e76d0b37d92b3e7849d13b

diff --git a/chart2/source/model/template/GL3DBarChartType.cxx b/chart2/source/model/template/GL3DBarChartType.cxx
index 033c38c..7b94095 100644
--- a/chart2/source/model/template/GL3DBarChartType.cxx
+++ b/chart2/source/model/template/GL3DBarChartType.cxx
@@ -9,11 +9,84 @@
 
 #include "GL3DBarChartType.hxx"
 #include <servicenames_charttypes.hxx>
+#include <PropertyHelper.hxx>
+
+#include <com/sun/star/beans/Property.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
 
 using namespace com::sun::star;
 
 namespace chart {
 
+namespace {
+
+enum
+{
+    PROP_GL3DCHARTTYPE_ROUNDED_RECTANGLE
+};
+
+struct DefaultsInitializer
+{
+    tPropertyValueMap* operator()()
+    {
+        static tPropertyValueMap aStaticDefaults;
+
+        if (aStaticDefaults.empty())
+            addDefaults(aStaticDefaults);
+
+        return &aStaticDefaults;
+    }
+private:
+
+    void addDefaults( tPropertyValueMap & rOutMap )
+    {
+        PropertyHelper::setPropertyValueDefault(rOutMap, PROP_GL3DCHARTTYPE_ROUNDED_RECTANGLE, false);
+    }
+};
+
+struct Defaults : public rtl::StaticAggregate<tPropertyValueMap, DefaultsInitializer> {};
+
+struct InfoHelperInitializer
+{
+    cppu::OPropertyArrayHelper* operator()()
+    {
+        static cppu::OPropertyArrayHelper aHelper(getProperties());
+        return &aHelper;
+    }
+
+    uno::Sequence<beans::Property> getProperties()
+    {
+        uno::Sequence<beans::Property> aRet(1);
+
+        aRet[0] = beans::Property(
+            "RoundedRectangle",
+            PROP_GL3DCHARTTYPE_ROUNDED_RECTANGLE,
+            ::getCppuBooleanType(),
+            beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
+
+        return aRet;
+    }
+};
+
+struct InfoHelper : public rtl::StaticAggregate<cppu::OPropertyArrayHelper, InfoHelperInitializer> {};
+
+struct ChartTypeInfoInitializer
+{
+    uno::Reference<beans::XPropertySetInfo>* operator()()
+    {
+        static uno::Reference<beans::XPropertySetInfo> xPropertySetInfo;
+
+        if (!xPropertySetInfo.is())
+            xPropertySetInfo = cppu::OPropertySetHelper::createPropertySetInfo(*InfoHelper::get());
+
+        return &xPropertySetInfo;
+    }
+};
+
+struct ChartTypeInfo : public rtl::StaticAggregate<uno::Reference<beans::XPropertySetInfo>, ChartTypeInfoInitializer> {};
+
+}
+
 GL3DBarChartType::GL3DBarChartType( const uno::Reference<uno::XComponentContext>& xContext ) :
     ChartType(xContext)
 {
@@ -50,6 +123,25 @@ GL3DBarChartType::createClone()
     return uno::Reference<util::XCloneable>(new GL3DBarChartType(*this));
 }
 
+css::uno::Any GL3DBarChartType::GetDefaultValue( sal_Int32 nHandle ) const
+    throw (css::beans::UnknownPropertyException)
+{
+    const tPropertyValueMap& rDefaults = *Defaults::get();
+    tPropertyValueMap::const_iterator it = rDefaults.find(nHandle);
+    return it == rDefaults.end() ? uno::Any() : it->second;
+}
+
+cppu::IPropertyArrayHelper& GL3DBarChartType::getInfoHelper()
+{
+    return *InfoHelper::get();
+}
+
+css::uno::Reference<css::beans::XPropertySetInfo> GL3DBarChartType::getPropertySetInfo()
+    throw (css::uno::RuntimeException, std::exception)
+{
+    return *ChartTypeInfo::get();
+}
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/template/GL3DBarChartType.hxx b/chart2/source/model/template/GL3DBarChartType.hxx
index ee9d0ab..c5da45c 100644
--- a/chart2/source/model/template/GL3DBarChartType.hxx
+++ b/chart2/source/model/template/GL3DBarChartType.hxx
@@ -33,11 +33,22 @@ protected:
     GL3DBarChartType( const GL3DBarChartType& rOther );
 
     virtual OUString SAL_CALL getChartType()
-        throw (com::sun::star::uno::RuntimeException, std::exception);
+        throw (css::uno::RuntimeException, std::exception);
 
-    virtual com::sun::star::uno::Reference<com::sun::star::util::XCloneable>
-        SAL_CALL createClone()
-            throw (com::sun::star::uno::RuntimeException, std::exception);
+    virtual css::uno::Reference<css::util::XCloneable> SAL_CALL
+        createClone()
+            throw (css::uno::RuntimeException, std::exception);
+
+    // OPropertySet
+    virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
+        throw (css::beans::UnknownPropertyException);
+
+    virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+    // XPropertySet
+    virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL
+        getPropertySetInfo()
+            throw (css::uno::RuntimeException, std::exception);
 };
 
 }
commit 1f5659fcd1928cd82c6f57331f1147049b40bce8
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Mar 26 13:15:08 2014 -0400

    Close those <p> tags.
    
    Change-Id: I72ba74164e660bfbe496cc63b98e397ee1e2425c

diff --git a/udkapi/com/sun/star/beans/PropertyAttribute.idl b/udkapi/com/sun/star/beans/PropertyAttribute.idl
index 5ab1de9..a75f4af 100644
--- a/udkapi/com/sun/star/beans/PropertyAttribute.idl
+++ b/udkapi/com/sun/star/beans/PropertyAttribute.idl
@@ -30,7 +30,7 @@ published constants PropertyAttribute
 
     /** indicates that a property value can be void.
 
-        <p>It does not mean that the type of the property is void!
+        <p>It does not mean that the type of the property is void!</p>
      */
     const short MAYBEVOID = 1;
 
@@ -85,7 +85,7 @@ published constants PropertyAttribute
 
         <p>This attribute is not of interest for concrete property
         implementations. It's needed for property specifications inside
-        service specifications in UNOIDL.
+        service specifications in UNOIDL.</p>
 
         @see com::sun::star::reflection::XPropertyTypeDescription
         @see com::sun::star::reflection::XServiceTypeDescription


More information about the Libreoffice-commits mailing list