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

Kohei Yoshida kohei.yoshida at collabora.com
Wed Mar 26 20:08:46 PDT 2014


 chart2/source/controller/dialogs/tp_ChartType.cxx |   59 ++++++++++++----------
 include/xmloff/xmltoken.hxx                       |    1 
 xmloff/source/chart/PropertyMap.hxx               |    3 +
 xmloff/source/core/xmltoken.cxx                   |    1 
 4 files changed, 39 insertions(+), 25 deletions(-)

New commits:
commit 0c13539e8dd36e629dd74420a23b1d8ed631c870
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 a00f17c4950cc5ee336323bf19adb2be36abce6b
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 ),


More information about the Libreoffice-commits mailing list