[Libreoffice-commits] core.git: chart2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 18 10:13:37 UTC 2019


 chart2/source/model/template/ChartTypeManager.cxx       |    8 ++++----
 chart2/source/model/template/StockChartTypeTemplate.cxx |    8 ++++----
 chart2/source/model/template/StockChartTypeTemplate.hxx |   10 +++++-----
 chart2/source/model/template/StockDataInterpreter.cxx   |   16 ++++++++--------
 4 files changed, 21 insertions(+), 21 deletions(-)

New commits:
commit 34e0120ce5c9892380729a0a6e90c00c6b2eec9f
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jan 18 09:43:33 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jan 18 11:13:09 2019 +0100

    convert StockVariant to scoped enum
    
    and simplify naming
    
    Change-Id: Ieada4e83fcc2eafd03f65b1216bf5ad026ced4c7
    Reviewed-on: https://gerrit.libreoffice.org/66567
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx
index 2d458a05faec..3634e075d8d8 100644
--- a/chart2/source/model/template/ChartTypeManager.cxx
+++ b/chart2/source/model/template/ChartTypeManager.cxx
@@ -498,19 +498,19 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance(
 
             case TEMPLATE_STOCKLOWHIGHCLOSE:
                 xTemplate.set( new StockChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StockChartTypeTemplate::LOW_HI_CLOSE, false ));
+                    StockChartTypeTemplate::StockVariant::NONE, false ));
                 break;
             case TEMPLATE_STOCKOPENLOWHIGHCLOSE:
                 xTemplate.set( new StockChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StockChartTypeTemplate::OPEN_LOW_HI_CLOSE, true ));
+                    StockChartTypeTemplate::StockVariant::Open, true ));
                 break;
             case TEMPLATE_STOCKVOLUMELOWHIGHCLOSE:
                 xTemplate.set( new StockChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StockChartTypeTemplate::VOL_LOW_HI_CLOSE, false ));
+                    StockChartTypeTemplate::StockVariant::Volume, false ));
                 break;
             case TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE:
                 xTemplate.set( new StockChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StockChartTypeTemplate::VOL_OPEN_LOW_HI_CLOSE, true ));
+                    StockChartTypeTemplate::StockVariant::VolumeOpen, true ));
                 break;
 
             //BubbleChart
diff --git a/chart2/source/model/template/StockChartTypeTemplate.cxx b/chart2/source/model/template/StockChartTypeTemplate.cxx
index 1e452770fb4c..8b4f6552b1c4 100644
--- a/chart2/source/model/template/StockChartTypeTemplate.cxx
+++ b/chart2/source/model/template/StockChartTypeTemplate.cxx
@@ -156,12 +156,12 @@ StockChartTypeTemplate::StockChartTypeTemplate(
 {
     setFastPropertyValue_NoBroadcast(
         PROP_STOCKCHARTTYPE_TEMPLATE_OPEN,
-        uno::Any( ( eVariant == OPEN_LOW_HI_CLOSE ||
-                        eVariant == VOL_OPEN_LOW_HI_CLOSE )));
+        uno::Any( ( eVariant == StockVariant::Open ||
+                        eVariant == StockVariant::VolumeOpen )));
     setFastPropertyValue_NoBroadcast(
         PROP_STOCKCHARTTYPE_TEMPLATE_VOLUME,
-        uno::Any( ( eVariant == VOL_LOW_HI_CLOSE ||
-                        eVariant == VOL_OPEN_LOW_HI_CLOSE )));
+        uno::Any( ( eVariant == StockVariant::Volume ||
+                        eVariant == StockVariant::VolumeOpen )));
     setFastPropertyValue_NoBroadcast(
         PROP_STOCKCHARTTYPE_TEMPLATE_JAPANESE,
         uno::Any( bJapaneseStyle ));
diff --git a/chart2/source/model/template/StockChartTypeTemplate.hxx b/chart2/source/model/template/StockChartTypeTemplate.hxx
index 4977b7a9dcee..6a05450f8194 100644
--- a/chart2/source/model/template/StockChartTypeTemplate.hxx
+++ b/chart2/source/model/template/StockChartTypeTemplate.hxx
@@ -33,12 +33,12 @@ class StockChartTypeTemplate :
         public ::property::OPropertySet
 {
 public:
-    enum StockVariant
+    enum class StockVariant
     {
-        LOW_HI_CLOSE,
-        OPEN_LOW_HI_CLOSE,
-        VOL_LOW_HI_CLOSE,
-        VOL_OPEN_LOW_HI_CLOSE
+        NONE,
+        Open,
+        Volume,
+        VolumeOpen
     };
 
     /** CTOR
diff --git a/chart2/source/model/template/StockDataInterpreter.cxx b/chart2/source/model/template/StockDataInterpreter.cxx
index 634231f832ca..cb36912c67bd 100644
--- a/chart2/source/model/template/StockDataInterpreter.cxx
+++ b/chart2/source/model/template/StockDataInterpreter.cxx
@@ -57,10 +57,10 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource(
 
     // sub-type properties
     const StockChartTypeTemplate::StockVariant eVar( GetStockVariant());
-    const bool bHasOpenValues (( eVar == StockChartTypeTemplate::OPEN_LOW_HI_CLOSE ) ||
-                               ( eVar == StockChartTypeTemplate::VOL_OPEN_LOW_HI_CLOSE ));
-    const bool bHasVolume (( eVar == StockChartTypeTemplate::VOL_LOW_HI_CLOSE ) ||
-                           ( eVar == StockChartTypeTemplate::VOL_OPEN_LOW_HI_CLOSE ));
+    const bool bHasOpenValues (( eVar == StockChartTypeTemplate::StockVariant::Open ) ||
+                               ( eVar == StockChartTypeTemplate::StockVariant::VolumeOpen ));
+    const bool bHasVolume (( eVar == StockChartTypeTemplate::StockVariant::Volume ) ||
+                           ( eVar == StockChartTypeTemplate::StockVariant::VolumeOpen ));
     const bool bHasCategories( HasCategories( rArguments, aData ));
 
     // necessary roles for "full series"
@@ -258,12 +258,12 @@ sal_Bool SAL_CALL StockDataInterpreter::isDataCompatible(
     sal_Int32 nNumberOfNecessarySequences = 3;
     // open
     StockChartTypeTemplate::StockVariant eVar( GetStockVariant());
-    if( ( eVar == StockChartTypeTemplate::OPEN_LOW_HI_CLOSE ) ||
-        ( eVar == StockChartTypeTemplate::VOL_OPEN_LOW_HI_CLOSE ))
+    if( ( eVar == StockChartTypeTemplate::StockVariant::Open ) ||
+        ( eVar == StockChartTypeTemplate::StockVariant::VolumeOpen ))
         ++nNumberOfNecessarySequences;
     // volume
-    bool bHasVolume = (( eVar == StockChartTypeTemplate::VOL_LOW_HI_CLOSE ) ||
-                       ( eVar == StockChartTypeTemplate::VOL_OPEN_LOW_HI_CLOSE ));
+    bool bHasVolume = (( eVar == StockChartTypeTemplate::StockVariant::Volume ) ||
+                       ( eVar == StockChartTypeTemplate::StockVariant::VolumeOpen ));
 
     // 1. correct number of sub-types
     if( aInterpretedData.Series.getLength() < (bHasVolume ? 2 : 1 ))


More information about the Libreoffice-commits mailing list