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

Kohei Yoshida kohei.yoshida at collabora.com
Thu Mar 27 10:49:35 PDT 2014


 chart2/inc/unonames.hxx                                        |   18 ++++++++++
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx    |    5 +-
 chart2/source/controller/dialogs/ChartTypeDialogController.cxx |    5 +-
 chart2/source/controller/dialogs/tp_ChartType.cxx              |   13 +++----
 chart2/source/model/main/Diagram.cxx                           |    6 ++-
 chart2/source/model/template/GL3DBarChartType.cxx              |    3 +
 chart2/source/view/main/ChartView.cxx                          |    5 +-
 7 files changed, 40 insertions(+), 15 deletions(-)

New commits:
commit 00a5d674b938512ff85dd7bdc83c70060d51ea07
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Mar 27 13:47:15 2014 -0400

    Start using common symbols for textural UNO property names.
    
    This will make it easier to track all uses of a UNO property name using
    symbol database lookup, which is much faster and more accurate than grepping.
    
    Change-Id: I8c2857504c29bcce01eb8c1f406dcbfb24331510

diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx
new file mode 100644
index 0000000..6f800f8
--- /dev/null
+++ b/chart2/inc/unonames.hxx
@@ -0,0 +1,18 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef CHART2_UNONAMES_HXX
+#define CHART2_UNONAMES_HXX
+
+#define CHART_UNONAME_SORT_BY_XVALUES "SortByXValues"
+#define CHART_UNONAME_ROUNDED_EDGE "RoundedEdge"
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index a10ee39..01075fc 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -47,6 +47,7 @@
 #include <comphelper/InlineContainer.hxx>
 #include "WrappedAutomaticPositionProperties.hxx"
 #include "CommonConverters.hxx"
+#include <unonames.hxx>
 
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/chart2/XTitled.hpp>
@@ -230,7 +231,7 @@ void lcl_AddPropertiesToVector(
 
     //new for XY charts
     rOutProperties.push_back(
-        Property( "SortByXValues",
+        Property( CHART_UNONAME_SORT_BY_XVALUES,
                   PROP_DIAGRAM_SORT_BY_X_VALUES,
                   ::getBooleanCppuType(),
                   beans::PropertyAttribute::BOUND
@@ -447,7 +448,7 @@ void lcl_AddPropertiesToVector(
                   | beans::PropertyAttribute::MAYBEVOID ));
 
     rOutProperties.push_back(
-         Property( "RoundedEdge",
+         Property( CHART_UNONAME_ROUNDED_EDGE,
                    PROP_DIAGRAM_ROUNDED_EDGE,
                    ::getCppuBooleanType(),
                    beans::PropertyAttribute::BOUND
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index 4ade1fd..031c468 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -27,6 +27,7 @@
 #include "DiagramHelper.hxx"
 #include "ControllerLockGuard.hxx"
 #include "AxisHelper.hxx"
+#include <unonames.hxx>
 
 #include <com/sun/star/chart2/DataPointGeometry3D.hpp>
 #include <com/sun/star/chart2/PieChartOffsetMode.hpp>
@@ -341,8 +342,8 @@ bool ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParame
         uno::Reference<beans::XPropertySet> xDiaProp(xDiagram, uno::UNO_QUERY);
         if (xDiaProp.is())
         {
-            xDiaProp->setPropertyValue("SortByXValues" , uno::makeAny(rParameter.bSortByXValues));
-            xDiaProp->setPropertyValue("RoundedEdge", uno::makeAny(rParameter.mbRoundedEdge));
+            xDiaProp->setPropertyValue(CHART_UNONAME_SORT_BY_XVALUES, uno::makeAny(rParameter.bSortByXValues));
+            xDiaProp->setPropertyValue(CHART_UNONAME_ROUNDED_EDGE, uno::makeAny(rParameter.mbRoundedEdge));
         }
     }
     return false;
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index ab7f525..c7bed9a 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -26,6 +26,7 @@
 #include "ControllerLockGuard.hxx"
 #include "macros.hxx"
 #include "GL3DBarChartDialogController.hxx"
+#include <unonames.hxx>
 
 #include <svtools/controldims.hrc>
 
@@ -832,8 +833,8 @@ void ChartTypeTabPage::stateChanged( ChangingResource* /*pResource*/ )
     try
     {
         uno::Reference<beans::XPropertySet> xPropSet(xDiagram, uno::UNO_QUERY_THROW);
-        xPropSet->getPropertyValue("SortByXValues") >>= aParameter.bSortByXValues;
-        xPropSet->getPropertyValue("RoundedEdge") >>= aParameter.mbRoundedEdge;
+        xPropSet->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= aParameter.bSortByXValues;
+        xPropSet->getPropertyValue(CHART_UNONAME_ROUNDED_EDGE) >>= aParameter.mbRoundedEdge;
     }
     catch ( const uno::Exception& ex )
     {
@@ -899,8 +900,8 @@ void ChartTypeTabPage::selectMainType()
         try
         {
             uno::Reference<beans::XPropertySet> xPropSet(xDiagram, uno::UNO_QUERY_THROW);
-            xPropSet->getPropertyValue("SortByXValues") >>= aParameter.bSortByXValues;
-            xPropSet->getPropertyValue("RoundedEdge") >>= aParameter.mbRoundedEdge;
+            xPropSet->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= aParameter.bSortByXValues;
+            xPropSet->getPropertyValue(CHART_UNONAME_ROUNDED_EDGE) >>= aParameter.mbRoundedEdge;
         }
         catch ( const uno::Exception& ex )
         {
@@ -984,8 +985,8 @@ void ChartTypeTabPage::initializePage()
             try
             {
                 uno::Reference<beans::XPropertySet> xPropSet(xDiagram, uno::UNO_QUERY_THROW);
-                xPropSet->getPropertyValue("SortByXValues") >>= aParameter.bSortByXValues;
-                xPropSet->getPropertyValue("RoundedEdge") >>= aParameter.mbRoundedEdge;
+                xPropSet->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= aParameter.bSortByXValues;
+                xPropSet->getPropertyValue(CHART_UNONAME_ROUNDED_EDGE) >>= aParameter.mbRoundedEdge;
             }
             catch (const uno::Exception& ex)
             {
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx
index 157df26..6c75a3f 100644
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -31,6 +31,8 @@
 #include "SceneProperties.hxx"
 #include "DisposeHelper.hxx"
 #include "BaseGFXHelper.hxx"
+#include <unonames.hxx>
+
 #include <basegfx/numeric/ftools.hxx>
 #include <rtl/instance.hxx>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -104,7 +106,7 @@ void lcl_AddPropertiesToVector(
                   | beans::PropertyAttribute::MAYBEDEFAULT ));
 
     rOutProperties.push_back(
-        Property( "SortByXValues",
+        Property( CHART_UNONAME_SORT_BY_XVALUES,
                   PROP_DIAGRAM_SORT_BY_X_VALUES,
                   ::getBooleanCppuType(),
                   beans::PropertyAttribute::BOUND
@@ -199,7 +201,7 @@ void lcl_AddPropertiesToVector(
                   beans::PropertyAttribute::MAYBEVOID ));
 
    rOutProperties.push_back(
-        Property( "RoundedEdge",
+        Property( CHART_UNONAME_ROUNDED_EDGE,
                   PROP_DIAGRAM_ROUNDED_EDGE,
                   ::getCppuBooleanType(),
                   beans::PropertyAttribute::MAYBEVOID));
diff --git a/chart2/source/model/template/GL3DBarChartType.cxx b/chart2/source/model/template/GL3DBarChartType.cxx
index 4dc4e46..4e8868c 100644
--- a/chart2/source/model/template/GL3DBarChartType.cxx
+++ b/chart2/source/model/template/GL3DBarChartType.cxx
@@ -10,6 +10,7 @@
 #include "GL3DBarChartType.hxx"
 #include <servicenames_charttypes.hxx>
 #include <PropertyHelper.hxx>
+#include <unonames.hxx>
 
 #include <com/sun/star/beans/Property.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -59,7 +60,7 @@ struct InfoHelperInitializer
         uno::Sequence<beans::Property> aRet(1);
 
         aRet[0] = beans::Property(
-            "RoundedEdge",
+            CHART_UNONAME_ROUNDED_EDGE,
             PROP_GL3DCHARTTYPE_ROUNDED_EDGE,
             ::getCppuBooleanType(),
             beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 0490567..ae0929d 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -47,6 +47,7 @@
 #include "DataSeriesHelper.hxx"
 #include "DateHelper.hxx"
 #include "defines.hxx"
+#include <unonames.hxx>
 
 #include <rtl/uuid.h>
 #include <comphelper/scopeguard.hxx>
@@ -141,7 +142,7 @@ void debugGL3DOutput( ChartModel& rModel )
     {
         uno::Reference<beans::XPropertySet> xPropSet(xDiagram, uno::UNO_QUERY_THROW);
         bool bRoundedEdge = false;
-        xPropSet->getPropertyValue("RoundedEdge") >>= bRoundedEdge;
+        xPropSet->getPropertyValue(CHART_UNONAME_ROUNDED_EDGE) >>= bRoundedEdge;
 
         fprintf(stdout, "GL3D: rounded edge = %d\n", bRoundedEdge);
     }
@@ -628,7 +629,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
     try
     {
         uno::Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY_THROW );
-        xDiaProp->getPropertyValue( "SortByXValues" ) >>= bSortByXValues;
+        xDiaProp->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= bSortByXValues;
         xDiaProp->getPropertyValue( "ConnectBars" ) >>= bConnectBars;
         xDiaProp->getPropertyValue( "GroupBarsPerAxis" ) >>= bGroupBarsPerAxis;
         xDiaProp->getPropertyValue( "IncludeHiddenCells" ) >>= bIncludeHiddenCells;


More information about the Libreoffice-commits mailing list