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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 18 09:27:30 UTC 2019


 chart2/source/view/axes/VAxisBase.cxx              |    2 +-
 chart2/source/view/axes/VAxisProperties.cxx        |   14 +++++++-------
 chart2/source/view/axes/VAxisProperties.hxx        |   10 +++++-----
 chart2/source/view/axes/VCartesianAxis.cxx         |   16 ++++++++--------
 chart2/source/view/charttypes/AreaChart.cxx        |    4 ++--
 chart2/source/view/charttypes/BubbleChart.cxx      |    2 +-
 chart2/source/view/charttypes/CandleStickChart.cxx |    2 +-
 chart2/source/view/charttypes/NetChart.cxx         |    4 ++--
 chart2/source/view/charttypes/VSeriesPlotter.cxx   |   10 +++++-----
 chart2/source/view/inc/LegendEntryProvider.hxx     |    8 ++++----
 chart2/source/view/inc/ShapeFactory.hxx            |    4 ++--
 chart2/source/view/main/ShapeFactory.cxx           |    2 +-
 chart2/source/view/main/VLegend.cxx                |    2 +-
 chart2/source/view/main/VLegendSymbolFactory.cxx   |    6 +++---
 14 files changed, 43 insertions(+), 43 deletions(-)

New commits:
commit 4bf3edca63dc937112366f1067fc3fc1f0fd132c
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jan 18 09:27:09 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jan 18 10:27:04 2019 +0100

    convert some enums to scoped
    
    Change-Id: Ib381bb24abb4bf09c87d9fa372374ce133cb7848
    Reviewed-on: https://gerrit.libreoffice.org/66566
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx
index 49bd9cd14382..861ed4f63b33 100644
--- a/chart2/source/view/axes/VAxisBase.cxx
+++ b/chart2/source/view/axes/VAxisBase.cxx
@@ -87,7 +87,7 @@ void VAxisBase::initAxisLabelProperties( const css::awt::Size& rFontReferenceSiz
     m_aAxisLabelProperties.nNumberFormatKey = m_aAxisProperties.m_nNumberFormatKey;
     m_aAxisLabelProperties.init(m_aAxisProperties.m_xAxisModel);
     if( m_aAxisProperties.m_bComplexCategories && m_aAxisProperties.m_nAxisType == AxisType::CATEGORY )
-        m_aAxisLabelProperties.eStaggering = SIDE_BY_SIDE;
+        m_aAxisLabelProperties.eStaggering = AxisLabelStaggering::SideBySide;
 }
 
 bool VAxisBase::isDateAxis() const
diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx
index c52650eb3b13..ee94a6dacf52 100644
--- a/chart2/source/view/axes/VAxisProperties.cxx
+++ b/chart2/source/view/axes/VAxisProperties.cxx
@@ -335,7 +335,7 @@ AxisLabelProperties::AxisLabelProperties()
                         : m_aFontReferenceSize( ChartModelHelper::getDefaultPageSize() )
                         , m_aMaximumSpaceForLabels( 0 , 0, m_aFontReferenceSize.Width, m_aFontReferenceSize.Height )
                         , nNumberFormatKey(0)
-                        , eStaggering( SIDE_BY_SIDE )
+                        , eStaggering( AxisLabelStaggering::SideBySide )
                         , bLineBreakAllowed( false )
                         , bOverlapAllowed( false )
                         , bStackCharacters( false )
@@ -363,16 +363,16 @@ void AxisLabelProperties::init( const uno::Reference< XAxis >& xAxisModel )
             switch(eArrangeOrder)
             {
                 case css::chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE:
-                    eStaggering = SIDE_BY_SIDE;
+                    eStaggering = AxisLabelStaggering::SideBySide;
                     break;
                 case css::chart::ChartAxisArrangeOrderType_STAGGER_EVEN:
-                    eStaggering = STAGGER_EVEN;
+                    eStaggering = AxisLabelStaggering::StaggerEven;
                     break;
                 case css::chart::ChartAxisArrangeOrderType_STAGGER_ODD:
-                    eStaggering = STAGGER_ODD;
+                    eStaggering = AxisLabelStaggering::StaggerOdd;
                     break;
                 default:
-                    eStaggering = STAGGER_AUTO;
+                    eStaggering = AxisLabelStaggering::StaggerAuto;
                     break;
             }
         }
@@ -385,14 +385,14 @@ void AxisLabelProperties::init( const uno::Reference< XAxis >& xAxisModel )
 
 bool AxisLabelProperties::isStaggered() const
 {
-    return ( eStaggering == STAGGER_ODD || eStaggering == STAGGER_EVEN );
+    return ( eStaggering == AxisLabelStaggering::StaggerOdd || eStaggering == AxisLabelStaggering::StaggerEven );
 }
 
 void AxisLabelProperties::autoRotate45()
 {
     fRotationAngleDegree = 45;
     bLineBreakAllowed = false;
-    eStaggering = SIDE_BY_SIDE;
+    eStaggering = AxisLabelStaggering::SideBySide;
 }
 
 } //namespace chart
diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx
index 10116ee22f26..bac143034962 100644
--- a/chart2/source/view/axes/VAxisProperties.hxx
+++ b/chart2/source/view/axes/VAxisProperties.hxx
@@ -44,12 +44,12 @@ namespace chart
 //The couple can contain all labels for all tickmark depth or just the labels for one single depth or
 //the labels from an coherent range of tick depths (e.g. the major and first minor tickmarks should be handled together).
 //... only allow side by side for different tick depth
-enum AxisLabelStaggering
+enum class AxisLabelStaggering
 {
-      SIDE_BY_SIDE
-    , STAGGER_EVEN
-    , STAGGER_ODD
-    , STAGGER_AUTO
+      SideBySide
+    , StaggerEven
+    , StaggerOdd
+    , StaggerAuto
 };
 
 struct AxisLabelProperties final
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index feaf09027c01..ed31fabbb215 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -270,9 +270,9 @@ TickInfo* LabelIterator::firstInfo()
         pTickInfo = m_aPureTickIter.nextInfo();
     if(!pTickInfo)
         return nullptr;
-    if( (m_eAxisLabelStaggering==STAGGER_EVEN && m_bInnerLine)
+    if( (m_eAxisLabelStaggering==AxisLabelStaggering::StaggerEven && m_bInnerLine)
         ||
-        (m_eAxisLabelStaggering==STAGGER_ODD && !m_bInnerLine)
+        (m_eAxisLabelStaggering==AxisLabelStaggering::StaggerOdd && !m_bInnerLine)
         )
     {
         //skip first label
@@ -293,8 +293,8 @@ TickInfo* LabelIterator::nextInfo()
         pTickInfo = m_aPureTickIter.nextInfo();
     while( pTickInfo && !pTickInfo->xTextShape.is() );
 
-    if(  m_eAxisLabelStaggering==STAGGER_EVEN
-      || m_eAxisLabelStaggering==STAGGER_ODD )
+    if(  m_eAxisLabelStaggering==AxisLabelStaggering::StaggerEven
+      || m_eAxisLabelStaggering==AxisLabelStaggering::StaggerOdd )
     {
         //skip one label
         do
@@ -553,7 +553,7 @@ bool canAutoAdjustLabelPlacement(
 bool isAutoStaggeringOfLabelsAllowed(
     const AxisLabelProperties& rAxisLabelProperties, bool bIsHorizontalAxis, bool bIsVerticalAxis )
 {
-    if( rAxisLabelProperties.eStaggering != STAGGER_AUTO )
+    if( rAxisLabelProperties.eStaggering != AxisLabelStaggering::StaggerAuto )
         return false;
     return canAutoAdjustLabelPlacement(rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis);
 }
@@ -784,7 +784,7 @@ bool VCartesianAxis::createTextShapes(
                 if( !bIsStaggered && isAutoStaggeringOfLabelsAllowed( rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis ) )
                 {
                     bIsStaggered = true;
-                    rAxisLabelProperties.eStaggering = STAGGER_EVEN;
+                    rAxisLabelProperties.eStaggering = AxisLabelStaggering::StaggerEven;
                     pLastVisibleNeighbourTickInfo = pPREPreviousVisibleTickInfo;
                     if( !pLastVisibleNeighbourTickInfo ||
                         !lcl_doesShapeOverlapWithTickmark( pLastVisibleNeighbourTickInfo->xTextShape
@@ -865,7 +865,7 @@ bool VCartesianAxis::createTextShapes(
                         || m_aAxisProperties.m_bTryStaggeringFirst )
                     {
                         bIsStaggered = true;
-                        rAxisLabelProperties.eStaggering = STAGGER_EVEN;
+                        rAxisLabelProperties.eStaggering = AxisLabelStaggering::StaggerEven;
                         pLastVisibleNeighbourTickInfo = pPREPreviousVisibleTickInfo;
                         if( !pLastVisibleNeighbourTickInfo ||
                             !lcl_doesShapeOverlapWithTickmark( pLastVisibleNeighbourTickInfo->xTextShape
@@ -1650,7 +1650,7 @@ void VCartesianAxis::createMaximumLabels()
 
     AxisLabelProperties aAxisLabelProperties( m_aAxisLabelProperties );
     if( isAutoStaggeringOfLabelsAllowed( aAxisLabelProperties, pTickFactory2D->isHorizontalAxis(), pTickFactory2D->isVerticalAxis() ) )
-        aAxisLabelProperties.eStaggering = STAGGER_EVEN;
+        aAxisLabelProperties.eStaggering = AxisLabelStaggering::StaggerEven;
 
     aAxisLabelProperties.bOverlapAllowed = true;
     aAxisLabelProperties.bLineBreakAllowed = false;
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index 570dd0840f8b..306267c44de5 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -105,8 +105,8 @@ bool AreaChart::isSeparateStackingForDifferentSigns( sal_Int32 /*nDimensionIndex
 LegendSymbolStyle AreaChart::getLegendSymbolStyle()
 {
     if( m_bArea || m_nDimension == 3 )
-        return LegendSymbolStyle_BOX;
-    return LegendSymbolStyle_LINE;
+        return LegendSymbolStyle::Box;
+    return LegendSymbolStyle::Line;
 }
 
 uno::Any AreaChart::getExplicitSymbol( const VDataSeries& rSeries, sal_Int32 nPointIndex )
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
index c97d23682c61..ddc9e039b3ae 100644
--- a/chart2/source/view/charttypes/BubbleChart.cxx
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -128,7 +128,7 @@ bool BubbleChart::isSeparateStackingForDifferentSigns( sal_Int32 /*nDimensionInd
 
 LegendSymbolStyle BubbleChart::getLegendSymbolStyle()
 {
-    return LegendSymbolStyle_CIRCLE;
+    return LegendSymbolStyle::Circle;
 }
 
 drawing::Direction3D BubbleChart::getPreferredDiagramAspectRatio() const
diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx
index 1297a23ba85f..d869d7ca44d1 100644
--- a/chart2/source/view/charttypes/CandleStickChart.cxx
+++ b/chart2/source/view/charttypes/CandleStickChart.cxx
@@ -56,7 +56,7 @@ bool CandleStickChart::isSeparateStackingForDifferentSigns( sal_Int32 /* nDimens
 
 LegendSymbolStyle CandleStickChart::getLegendSymbolStyle()
 {
-    return LegendSymbolStyle_LINE;
+    return LegendSymbolStyle::Line;
 }
 
 drawing::Direction3D CandleStickChart::getPreferredDiagramAspectRatio() const
diff --git a/chart2/source/view/charttypes/NetChart.cxx b/chart2/source/view/charttypes/NetChart.cxx
index eef6aa067885..56e46bf1d791 100644
--- a/chart2/source/view/charttypes/NetChart.cxx
+++ b/chart2/source/view/charttypes/NetChart.cxx
@@ -87,8 +87,8 @@ bool NetChart::isSeparateStackingForDifferentSigns( sal_Int32 /*nDimensionIndex*
 LegendSymbolStyle NetChart::getLegendSymbolStyle()
 {
     if( m_bArea )
-        return LegendSymbolStyle_BOX;
-    return LegendSymbolStyle_LINE;
+        return LegendSymbolStyle::Box;
+    return LegendSymbolStyle::Line;
 }
 
 uno::Any NetChart::getExplicitSymbol( const VDataSeries& rSeries, sal_Int32 nPointIndex )
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 055f2743baba..d15bb92f8075 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -2323,7 +2323,7 @@ bool lcl_HasRegressionCurves( const VDataSeries& rSeries, bool& rbHasDashedLine
 }
 LegendSymbolStyle VSeriesPlotter::getLegendSymbolStyle()
 {
-    return LegendSymbolStyle_BOX;
+    return LegendSymbolStyle::Box;
 }
 
 awt::Size VSeriesPlotter::getPreferredLegendKeyAspectRatio()
@@ -2332,7 +2332,7 @@ awt::Size VSeriesPlotter::getPreferredLegendKeyAspectRatio()
     if( m_nDimension==3 )
         return aRet;
 
-    bool bSeriesAllowsLines = (getLegendSymbolStyle() == LegendSymbolStyle_LINE);
+    bool bSeriesAllowsLines = (getLegendSymbolStyle() == LegendSymbolStyle::Line);
     bool bHasLines = false;
     bool bHasDashedLines = false;
     //iterate through all series
@@ -2394,7 +2394,7 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForSeries(
     // legend-symbol type
     switch( eLegendSymbolStyle )
     {
-        case LegendSymbolStyle_LINE:
+        case LegendSymbolStyle::Line:
             ePropType = VLegendSymbolFactory::PropertyType::LineSeries;
             break;
         default:
@@ -2425,7 +2425,7 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForPoint(
     // legend-symbol type
     switch( eLegendSymbolStyle )
     {
-        case LegendSymbolStyle_LINE:
+        case LegendSymbolStyle::Line:
             ePropType = VLegendSymbolFactory::PropertyType::LineSeries;
             break;
         default:
@@ -2566,7 +2566,7 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
 
                     // create the symbol
                     Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
-                        xSymbolGroup, LegendSymbolStyle_LINE, xShapeFactory,
+                        xSymbolGroup, LegendSymbolStyle::Line, xShapeFactory,
                         Reference< beans::XPropertySet >( aCurves[i], uno::UNO_QUERY ),
                         VLegendSymbolFactory::PropertyType::Line, uno::Any() ));
 
diff --git a/chart2/source/view/inc/LegendEntryProvider.hxx b/chart2/source/view/inc/LegendEntryProvider.hxx
index aff7a5d84116..481583d5a5f8 100644
--- a/chart2/source/view/inc/LegendEntryProvider.hxx
+++ b/chart2/source/view/inc/LegendEntryProvider.hxx
@@ -36,20 +36,20 @@ namespace com { namespace sun { namespace star { namespace uno { class XComponen
 namespace chart
 {
 
-enum LegendSymbolStyle
+enum class LegendSymbolStyle
 {
     /** A square box with border.
      */
-    LegendSymbolStyle_BOX,
+    Box,
 
     /** A line like with a symbol.
      */
-    LegendSymbolStyle_LINE,
+    Line,
 
     /** A bordered circle which has the same bounding-box as the
         <member>BOX</member>.
      */
-    LegendSymbolStyle_CIRCLE
+    Circle
 };
 
 struct ViewLegendEntry
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index 70ca02217f6c..50f4b39b8532 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -74,7 +74,7 @@ class ShapeFactory
         {m_xShapeFactory = xFactory;}
 
 public:
-    enum StackPosition { Top, Bottom };
+    enum class StackPosition { Top, Bottom };
 
     static ShapeFactory* getOrCreateShapeFactory(const css::uno::Reference< css::lang::XMultiServiceFactory>& xFactory);
 
@@ -261,7 +261,7 @@ public:
             const css::awt::Point& rPosition,
             const tNameSequence& rPropNames,
             const tAnySequence& rPropValues,
-            StackPosition ePos = Top );
+            StackPosition ePos = StackPosition::Top );
 
     css::uno::Reference< css::drawing::XShape >
         createRectangle(
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index bc452c17f04e..fa2a007672c8 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -2087,7 +2087,7 @@ uno::Reference< drawing::XShape > ShapeFactory::createRectangle(
                 "com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY );
     if( xShape.is())
     {
-        if (ePos == Bottom)
+        if (ePos == StackPosition::Bottom)
         {
             uno::Reference<drawing::XShapes2> xTarget2(xTarget, uno::UNO_QUERY);
             if (xTarget2.is())
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index d201a2c72756..dd534f3b6023 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -998,7 +998,7 @@ void VLegend::createShapes(
                         aLegendSize,
                         awt::Point(0,0),
                         aLineFillProperties.first,
-                        aLineFillProperties.second, ShapeFactory::Bottom );
+                        aLineFillProperties.second, ShapeFactory::StackPosition::Bottom );
 
             //because of this name this border will be used for marking the legend
             ShapeFactory::setShapeName( xBorder, "MarkHandles" );
diff --git a/chart2/source/view/main/VLegendSymbolFactory.cxx b/chart2/source/view/main/VLegendSymbolFactory.cxx
index 02870ca52869..88e21eb95d28 100644
--- a/chart2/source/view/main/VLegendSymbolFactory.cxx
+++ b/chart2/source/view/main/VLegendSymbolFactory.cxx
@@ -118,7 +118,7 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
     // create symbol
     try
     {
-        if( eStyle == LegendSymbolStyle_LINE )
+        if( eStyle == LegendSymbolStyle::Line )
         {
             Reference< drawing::XShape > xLine =
                 pShapeFactory->createLine( xResultGroup, awt::Size( rEntryKeyAspectRatio.Width, 0 ),
@@ -165,7 +165,7 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
                 }
             }
         }
-        else if( eStyle == LegendSymbolStyle_CIRCLE )
+        else if( eStyle == LegendSymbolStyle::Circle )
         {
             sal_Int32 nSize = std::min( rEntryKeyAspectRatio.Width, rEntryKeyAspectRatio.Height );
             Reference< drawing::XShape > xShape =
@@ -176,7 +176,7 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
                 lcl_setPropertiesToShape( xLegendEntryProperties, xShape, ePropertyType, awt::Size(0,0) ); // PropertyType::FilledSeries );
             }
         }
-        else // eStyle == LegendSymbolStyle_BOX
+        else // eStyle == LegendSymbolStyle::Box
         {
             tNameSequence aPropNames;
             tAnySequence aPropValues;


More information about the Libreoffice-commits mailing list