[Libreoffice-commits] core.git: 6 commits - chart2/source compilerplugins/clang configmgr/source connectivity/source include/formula sc/inc sc/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Feb 17 07:56:56 UTC 2017


 chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx |    6 
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx   |   14 -
 chart2/source/inc/StackMode.hxx                               |   11 -
 chart2/source/model/template/BubbleChartTypeTemplate.cxx      |    2 
 chart2/source/model/template/ChartTypeManager.cxx             |   94 +++++-----
 chart2/source/model/template/ChartTypeTemplate.cxx            |   14 -
 chart2/source/model/template/ChartTypeTemplate.hxx            |    2 
 chart2/source/model/template/ColumnLineChartTypeTemplate.cxx  |    2 
 chart2/source/model/template/ScatterChartTypeTemplate.cxx     |    4 
 chart2/source/tools/ChartTypeHelper.cxx                       |    6 
 chart2/source/tools/DataSeriesHelper.cxx                      |   11 -
 chart2/source/tools/DiagramHelper.cxx                         |   27 +-
 chart2/source/view/charttypes/PieChart.cxx                    |    9 
 chart2/source/view/charttypes/VSeriesPlotter.cxx              |   14 -
 chart2/source/view/inc/PlottingPositionHelper.hxx             |   11 -
 chart2/source/view/inc/VLegendSymbolFactory.hxx               |   12 -
 chart2/source/view/main/PlottingPositionHelper.cxx            |   40 ----
 chart2/source/view/main/VLegendSymbolFactory.cxx              |   24 --
 compilerplugins/clang/unusedenumconstants.py                  |   11 -
 configmgr/source/valueparser.cxx                              |   30 +--
 configmgr/source/valueparser.hxx                              |    2 
 connectivity/source/drivers/dbase/DResultSet.cxx              |    5 
 connectivity/source/inc/TSortIndex.hxx                        |    1 
 include/formula/errorcodes.hxx                                |   10 -
 sc/inc/globstr.hrc                                            |    2 
 sc/source/core/data/formulacell.cxx                           |    4 
 sc/source/core/data/global.cxx                                |    6 
 sc/source/core/data/simpleformulacalc.cxx                     |    4 
 sc/source/ui/src/globstr.src                                  |    4 
 29 files changed, 153 insertions(+), 229 deletions(-)

New commits:
commit 1400cec1642039c2ff2021e574954d4b4576f5ac
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Feb 17 09:06:53 2017 +0200

    remove unused formula ErrorCode enumerators
    
    Change-Id: I0d81b43ba4e0a8734074651228743acaeae7aa97

diff --git a/include/formula/errorcodes.hxx b/include/formula/errorcodes.hxx
index 2af9b11..bb970a9 100644
--- a/include/formula/errorcodes.hxx
+++ b/include/formula/errorcodes.hxx
@@ -34,8 +34,6 @@ enum class FormulaError : sal_uInt16
     IllegalArgument      = 502,
     IllegalFPOperation   = 503, // #NUM!
     IllegalParameter     = 504,
-    IllegalJump          = 505,
-    Separator            = 506,
     Pair                 = 507,
     PairExpected         = 508,
     OperatorExpected     = 509,
@@ -55,10 +53,6 @@ enum class FormulaError : sal_uInt16
     NoConvergence        = 523,
     NoRef                = 524, // #REF!
     NoName               = 525, // #NAME?
-    DoubleRef            = 526,
-// Not displayed, temporary for TrackFormulas,
-// Cell depends on another cell that has FormulaError::CircularReference
-    TrackFromCircRef     = 528,
 // ScInterpreter internal:  no numeric value but numeric queried. If this is
 // set as mnStringNoValueError no error is generated but 0 returned.
     CellNoValue          = 529,
@@ -137,8 +131,6 @@ inline bool isPublishedFormulaError( FormulaError nErr )
         case FormulaError::IllegalArgument:
         case FormulaError::IllegalFPOperation:
         case FormulaError::IllegalParameter:
-        case FormulaError::IllegalJump:
-        case FormulaError::Separator:
         case FormulaError::Pair:
         case FormulaError::PairExpected:
         case FormulaError::OperatorExpected:
@@ -158,10 +150,8 @@ inline bool isPublishedFormulaError( FormulaError nErr )
         case FormulaError::NoConvergence:
         case FormulaError::NoRef:
         case FormulaError::NoName:
-        case FormulaError::DoubleRef:
             return true;
 
-        case FormulaError::TrackFromCircRef:
         case FormulaError::CellNoValue:
             return false;
 
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index a4e8b22..21b1436 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -195,7 +195,7 @@
 #define STR_LONG_ERR_ILL_PAR        134
 #define STR_LONG_ERR_ILL_FPO        135
 #define STR_LONG_ERR_ILL_CHAR       136
-#define STR_LONG_ERR_ILL_SEP        137
+// empty
 #define STR_LONG_ERR_PAIR           138
 #define STR_LONG_ERR_OP_EXP         139
 #define STR_LONG_ERR_VAR_EXP        140
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index d41a9cf..f988de9 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2608,7 +2608,7 @@ bool ScFormulaCell::IsValueNoError() const
 double ScFormulaCell::GetValue()
 {
     MaybeInterpret();
-    if ((pCode->GetCodeError() == FormulaError::NONE || pCode->GetCodeError() == FormulaError::DoubleRef) &&
+    if ((pCode->GetCodeError() == FormulaError::NONE) &&
             aResult.GetResultError() == FormulaError::NONE)
         return aResult.GetDouble();
     return 0.0;
@@ -2617,7 +2617,7 @@ double ScFormulaCell::GetValue()
 svl::SharedString ScFormulaCell::GetString()
 {
     MaybeInterpret();
-    if ((pCode->GetCodeError() == FormulaError::NONE || pCode->GetCodeError() == FormulaError::DoubleRef) &&
+    if ((pCode->GetCodeError() == FormulaError::NONE) &&
             aResult.GetResultError() == FormulaError::NONE)
         return aResult.GetString();
 
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 6579df0..0bd052b 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -361,7 +361,6 @@ OUString ScGlobal::GetErrorString(FormulaError nErr)
         case FormulaError::NoName             : nErrNumber = STR_NO_NAME_REF; break;
         case FormulaError::NoAddin            : nErrNumber = STR_NO_ADDIN; break;
         case FormulaError::NoMacro            : nErrNumber = STR_NO_MACRO; break;
-        case FormulaError::DoubleRef          :
         case FormulaError::NoValue            : nErrNumber = STR_NO_VALUE; break;
         case FormulaError::NoCode             : nErrNumber = STR_NULL_ERROR; break;
         case FormulaError::DivisionByZero     : nErrNumber = STR_DIV_ZERO; break;
@@ -392,9 +391,6 @@ OUString ScGlobal::GetLongErrorString(FormulaError nErr)
         case FormulaError::IllegalParameter:
             nErrNumber = STR_LONG_ERR_ILL_PAR;
         break;
-        case FormulaError::Separator:
-            nErrNumber = STR_LONG_ERR_ILL_SEP;
-        break;
         case FormulaError::Pair:
         case FormulaError::PairExpected:
             nErrNumber = STR_LONG_ERR_PAIR;
@@ -418,14 +414,12 @@ OUString ScGlobal::GetLongErrorString(FormulaError nErr)
         case FormulaError::MatrixSize:
             nErrNumber = STR_LONG_ERR_MATRIX_SIZE;
         break;
-        case FormulaError::IllegalJump:
         case FormulaError::UnknownState:
         case FormulaError::UnknownVariable:
         case FormulaError::UnknownOpCode:
         case FormulaError::UnknownStackVariable:
         case FormulaError::UnknownToken:
         case FormulaError::NoCode:
-        case FormulaError::DoubleRef:
             nErrNumber = STR_LONG_ERR_SYNTAX;
         break;
         case FormulaError::CircularReference:
diff --git a/sc/source/core/data/simpleformulacalc.cxx b/sc/source/core/data/simpleformulacalc.cxx
index 6a64dcf..4337f87 100644
--- a/sc/source/core/data/simpleformulacalc.cxx
+++ b/sc/source/core/data/simpleformulacalc.cxx
@@ -113,7 +113,7 @@ double ScSimpleFormulaCalculator::GetValue()
 {
     Calculate();
 
-    if ((mpCode->GetCodeError() == FormulaError::NONE || mpCode->GetCodeError() == FormulaError::DoubleRef) &&
+    if ((mpCode->GetCodeError() == FormulaError::NONE) &&
             maResult.GetResultError() == FormulaError::NONE)
         return maResult.GetDouble();
 
@@ -127,7 +127,7 @@ svl::SharedString ScSimpleFormulaCalculator::GetString()
     if (mbMatrixResult)
         return svl::SharedString( maMatrixFormulaResult);   // string not interned
 
-    if ((mpCode->GetCodeError() == FormulaError::NONE || mpCode->GetCodeError() == FormulaError::DoubleRef) &&
+    if ((mpCode->GetCodeError() == FormulaError::NONE) &&
             maResult.GetResultError() == FormulaError::NONE)
         return maResult.GetString();
 
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index a09b9da..9fa14e5 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -836,10 +836,6 @@ String STR_LONG_ERR_ILL_CHAR+RID_GLOBSTR_OFFSET
 {
     Text [ en-US ] = "Error: Invalid character" ;
 };
-String STR_LONG_ERR_ILL_SEP+RID_GLOBSTR_OFFSET
-{
-    Text [ en-US ] = "Error: Invalid semicolon" ;
-};
 String STR_LONG_ERR_PAIR+RID_GLOBSTR_OFFSET
 {
     Text [ en-US ] = "Error: in bracketing" ;
commit be021ba04d56b45bcb3c6cf09c193abc7f5e9dc0
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Feb 17 08:49:02 2017 +0200

    convert StackMode to scoped enum
    
    and drop unused AMBIGUOUS enumerator
    
    Change-Id: I71954d75a64928061c0e520beb47f979c53ee5a8

diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
index 705f9fc..4493a48 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
@@ -671,11 +671,11 @@ void ChartDataWrapper::applyData( lcl_Operator& rDataOperator )
     //correct stacking mode
     if( bStacked || bPercent || bDeep )
     {
-        StackMode eStackMode = StackMode_Y_STACKED;
+        StackMode eStackMode = StackMode::YStacked;
         if( bDeep )
-            eStackMode = StackMode_Z_STACKED;
+            eStackMode = StackMode::ZStacked;
         else if( bPercent )
-            eStackMode = StackMode_Y_STACKED_PERCENT;
+            eStackMode = StackMode::YStackedPercent;
         DiagramHelper::setStackMode( xDia, eStackMode );
     }
 
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index e18882a..1d67914 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -1273,13 +1273,13 @@ WrappedStackingProperty::WrappedStackingProperty(StackMode eStackMode, const std
 {
     switch( m_eStackMode )
     {
-    case StackMode_Y_STACKED:
+    case StackMode::YStacked:
         m_aOuterName = "Stacked";
         break;
-    case StackMode_Y_STACKED_PERCENT:
+    case StackMode::YStackedPercent:
         m_aOuterName = "Percent";
         break;
-    case StackMode_Z_STACKED:
+    case StackMode::ZStacked:
         m_aOuterName = "Deep";
         break;
     default:
@@ -1320,7 +1320,7 @@ void WrappedStackingProperty::setPropertyValue( const Any& rOuterValue, const Re
     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
     if( xDiagram.is() )
     {
-        StackMode eNewStackMode = bNewValue ? m_eStackMode : StackMode_NONE;
+        StackMode eNewStackMode = bNewValue ? m_eStackMode : StackMode::NONE;
         DiagramHelper::setStackMode( xDiagram, eNewStackMode );
     }
 }
@@ -1913,9 +1913,9 @@ const std::vector< WrappedProperty* > DiagramWrapper::createWrappedProperties()
     WrappedGL3DProperties::addWrappedProperties(aWrappedProperties, m_spChart2ModelContact);
 
     aWrappedProperties.push_back( new WrappedDataRowSourceProperty( m_spChart2ModelContact ) );
-    aWrappedProperties.push_back( new WrappedStackingProperty( StackMode_Y_STACKED,m_spChart2ModelContact ) );
-    aWrappedProperties.push_back( new WrappedStackingProperty( StackMode_Y_STACKED_PERCENT, m_spChart2ModelContact ) );
-    aWrappedProperties.push_back( new WrappedStackingProperty( StackMode_Z_STACKED, m_spChart2ModelContact ) );
+    aWrappedProperties.push_back( new WrappedStackingProperty( StackMode::YStacked,m_spChart2ModelContact ) );
+    aWrappedProperties.push_back( new WrappedStackingProperty( StackMode::YStackedPercent, m_spChart2ModelContact ) );
+    aWrappedProperties.push_back( new WrappedStackingProperty( StackMode::ZStacked, m_spChart2ModelContact ) );
     aWrappedProperties.push_back( new WrappedDim3DProperty( m_spChart2ModelContact ) );
     aWrappedProperties.push_back( new WrappedVerticalProperty( m_spChart2ModelContact ) );
     aWrappedProperties.push_back( new WrappedNumberOfLinesProperty( m_spChart2ModelContact ) );
diff --git a/chart2/source/inc/StackMode.hxx b/chart2/source/inc/StackMode.hxx
index 43b8f1f..dd6fcee 100644
--- a/chart2/source/inc/StackMode.hxx
+++ b/chart2/source/inc/StackMode.hxx
@@ -24,13 +24,12 @@ namespace chart
 
 // needed for chart type templates
 
-enum StackMode
+enum class StackMode
 {
-    StackMode_NONE = 0,
-    StackMode_Y_STACKED,
-    StackMode_Y_STACKED_PERCENT,
-    StackMode_Z_STACKED,
-    StackMode_AMBIGUOUS
+    NONE,
+    YStacked,
+    YStackedPercent,
+    ZStacked
 };
 
 } //  namespace chart
diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.cxx b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
index 1ee1807..71c77ff 100644
--- a/chart2/source/model/template/BubbleChartTypeTemplate.cxx
+++ b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
@@ -137,7 +137,7 @@ sal_Int32 BubbleChartTypeTemplate::getDimension() const
 
 StackMode BubbleChartTypeTemplate::getStackMode( sal_Int32 /* nChartTypeIndex */ ) const
 {
-    return StackMode_NONE;
+    return StackMode::NONE;
 }
 
 void SAL_CALL BubbleChartTypeTemplate::applyStyle(
diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx
index a746bf2..c98d797 100644
--- a/chart2/source/model/template/ChartTypeManager.cxx
+++ b/chart2/source/model/template/ChartTypeManager.cxx
@@ -267,114 +267,114 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance(
             // Point (category x axis)
             case TEMPLATE_SYMBOL:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_NONE, true, false ));
+                    StackMode::NONE, true, false ));
                 break;
             case TEMPLATE_STACKEDSYMBOL:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED, true, false ));
+                    StackMode::YStacked, true, false ));
                 break;
             case TEMPLATE_PERCENTSTACKEDSYMBOL:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED_PERCENT, true, false ));
+                    StackMode::YStackedPercent, true, false ));
                 break;
             // Line (category x axis)
             case TEMPLATE_LINE:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_NONE, false ));
+                    StackMode::NONE, false ));
                 break;
             case TEMPLATE_STACKEDLINE:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED, false ));
+                    StackMode::YStacked, false ));
                 break;
             case TEMPLATE_PERCENTSTACKEDLINE:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED_PERCENT, false ));
+                    StackMode::YStackedPercent, false ));
                 break;
             case TEMPLATE_LINESYMBOL:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_NONE, true ));
+                    StackMode::NONE, true ));
                 break;
             case TEMPLATE_STACKEDLINESYMBOL:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED, true ));
+                    StackMode::YStacked, true ));
                 break;
             case TEMPLATE_PERCENTSTACKEDLINESYMBOL:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED_PERCENT, true ));
+                    StackMode::YStackedPercent, true ));
                 break;
             case TEMPLATE_THREEDLINE:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_NONE, false, true, 3 ));
+                    StackMode::NONE, false, true, 3 ));
                 break;
             case TEMPLATE_STACKEDTHREEDLINE:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED, false, true, 3 ));
+                    StackMode::YStacked, false, true, 3 ));
                 break;
             case TEMPLATE_PERCENTSTACKEDTHREEDLINE:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED_PERCENT, false, true, 3 ));
+                    StackMode::YStackedPercent, false, true, 3 ));
                 break;
             case TEMPLATE_THREEDLINEDEEP:
                 xTemplate.set( new LineChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Z_STACKED, false, true, 3 ));
+                    StackMode::ZStacked, false, true, 3 ));
                 break;
 
             // Bar/Column
             case TEMPLATE_COLUMN:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_NONE, BarChartTypeTemplate::VERTICAL ));
+                    StackMode::NONE, BarChartTypeTemplate::VERTICAL ));
                 break;
             case TEMPLATE_STACKEDCOLUMN:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED, BarChartTypeTemplate::VERTICAL ));
+                    StackMode::YStacked, BarChartTypeTemplate::VERTICAL ));
                 break;
             case TEMPLATE_PERCENTSTACKEDCOLUMN:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED_PERCENT, BarChartTypeTemplate::VERTICAL ));
+                    StackMode::YStackedPercent, BarChartTypeTemplate::VERTICAL ));
                 break;
             case TEMPLATE_BAR:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_NONE, BarChartTypeTemplate::HORIZONTAL ));
+                    StackMode::NONE, BarChartTypeTemplate::HORIZONTAL ));
                 break;
             case TEMPLATE_STACKEDBAR:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED, BarChartTypeTemplate::HORIZONTAL ));
+                    StackMode::YStacked, BarChartTypeTemplate::HORIZONTAL ));
                 break;
             case TEMPLATE_PERCENTSTACKEDBAR:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED_PERCENT, BarChartTypeTemplate::HORIZONTAL ));
+                    StackMode::YStackedPercent, BarChartTypeTemplate::HORIZONTAL ));
                 break;
             case TEMPLATE_THREEDCOLUMNDEEP:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Z_STACKED, BarChartTypeTemplate::VERTICAL, 3 ));
+                    StackMode::ZStacked, BarChartTypeTemplate::VERTICAL, 3 ));
                 break;
             case TEMPLATE_THREEDCOLUMNFLAT:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_NONE, BarChartTypeTemplate::VERTICAL, 3 ));
+                    StackMode::NONE, BarChartTypeTemplate::VERTICAL, 3 ));
                 break;
             case TEMPLATE_STACKEDTHREEDCOLUMNFLAT:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED, BarChartTypeTemplate::VERTICAL, 3 ));
+                    StackMode::YStacked, BarChartTypeTemplate::VERTICAL, 3 ));
                 break;
             case TEMPLATE_PERCENTSTACKEDTHREEDCOLUMNFLAT:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED_PERCENT, BarChartTypeTemplate::VERTICAL, 3 ));
+                    StackMode::YStackedPercent, BarChartTypeTemplate::VERTICAL, 3 ));
                 break;
             case TEMPLATE_THREEDBARDEEP:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Z_STACKED, BarChartTypeTemplate::HORIZONTAL, 3 ));
+                    StackMode::ZStacked, BarChartTypeTemplate::HORIZONTAL, 3 ));
                 break;
             case TEMPLATE_THREEDBARFLAT:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_NONE, BarChartTypeTemplate::HORIZONTAL, 3 ));
+                    StackMode::NONE, BarChartTypeTemplate::HORIZONTAL, 3 ));
                 break;
             case TEMPLATE_STACKEDTHREEDBARFLAT:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED, BarChartTypeTemplate::HORIZONTAL, 3 ));
+                    StackMode::YStacked, BarChartTypeTemplate::HORIZONTAL, 3 ));
                 break;
             case TEMPLATE_PERCENTSTACKEDTHREEDBARFLAT:
                 xTemplate.set( new BarChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED_PERCENT, BarChartTypeTemplate::HORIZONTAL, 3 ));
+                    StackMode::YStackedPercent, BarChartTypeTemplate::HORIZONTAL, 3 ));
                 break;
 
             // Combi-Chart Line/Column
@@ -382,8 +382,8 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance(
             case TEMPLATE_STACKEDCOLUMNWITHLINE:
             {
                 StackMode eMode = ( nId == TEMPLATE_COLUMNWITHLINE )
-                    ? StackMode_NONE
-                    : StackMode_Y_STACKED;
+                    ? StackMode::NONE
+                    : StackMode::YStacked;
 
                 xTemplate.set( new ColumnLineChartTypeTemplate( m_xContext, aServiceSpecifier, eMode, 1 ));
             }
@@ -391,22 +391,22 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance(
 
             // Area
             case TEMPLATE_AREA:
-                xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode_NONE ));
+                xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode::NONE ));
                 break;
             case TEMPLATE_STACKEDAREA:
-                xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode_Y_STACKED ));
+                xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode::YStacked ));
                 break;
             case TEMPLATE_PERCENTSTACKEDAREA:
-                xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode_Y_STACKED_PERCENT ));
+                xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode::YStackedPercent ));
                 break;
             case TEMPLATE_THREEDAREA:
-                xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode_Z_STACKED, 3 ));
+                xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode::ZStacked, 3 ));
                 break;
             case TEMPLATE_STACKEDTHREEDAREA:
-                xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode_Y_STACKED, 3 ));
+                xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode::YStacked, 3 ));
                 break;
             case TEMPLATE_PERCENTSTACKEDTHREEDAREA:
-                xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode_Y_STACKED_PERCENT, 3 ));
+                xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode::YStackedPercent, 3 ));
                 break;
 
             case TEMPLATE_PIE:
@@ -458,54 +458,54 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance(
             // NetChart
             case TEMPLATE_NET:
                 xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_NONE, true ));
+                    StackMode::NONE, true ));
                 break;
             case TEMPLATE_NETSYMBOL:
                 xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_NONE, true, false ));
+                    StackMode::NONE, true, false ));
                 break;
             case TEMPLATE_NETLINE:
                 xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_NONE, false ));
+                    StackMode::NONE, false ));
                 break;
 
             case TEMPLATE_STACKEDNET:
                 xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED, true ));
+                    StackMode::YStacked, true ));
                 break;
             case TEMPLATE_STACKEDNETSYMBOL:
                 xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED, true, false ));
+                    StackMode::YStacked, true, false ));
                 break;
             case TEMPLATE_STACKEDNETLINE:
                 xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED, false, true ));
+                    StackMode::YStacked, false, true ));
                 break;
 
             case TEMPLATE_PERCENTSTACKEDNET:
                 xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED_PERCENT, true ));
+                    StackMode::YStackedPercent, true ));
                 break;
             case TEMPLATE_PERCENTSTACKEDNETSYMBOL:
                 xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED_PERCENT, true, false ));
+                    StackMode::YStackedPercent, true, false ));
                 break;
             case TEMPLATE_PERCENTSTACKEDNETLINE:
                 xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED_PERCENT, false, true ));
+                    StackMode::YStackedPercent, false, true ));
                 break;
 
             case TEMPLATE_FILLEDNET:
                 xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_NONE, false, false, true ));
+                    StackMode::NONE, false, false, true ));
                 break;
             case TEMPLATE_STACKEDFILLEDNET:
                 xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED, false, false, true ));
+                    StackMode::YStacked, false, false, true ));
                 break;
             case TEMPLATE_PERCENTSTACKEDFILLEDNET:
                 xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
-                    StackMode_Y_STACKED_PERCENT, false, false, true ));
+                    StackMode::YStackedPercent, false, false, true ));
                 break;
 
             case TEMPLATE_STOCKLOWHIGHCLOSE:
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index 76fc37d..d876ae0 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -389,10 +389,10 @@ void SAL_CALL ChartTypeTemplate::applyStyle(
         {
             StackMode eStackMode = getStackMode( nChartTypeIndex );
             const uno::Any aPropValue = uno::Any(
-                ( (eStackMode == StackMode_Y_STACKED) ||
-                  (eStackMode == StackMode_Y_STACKED_PERCENT) )
+                ( (eStackMode == StackMode::YStacked) ||
+                  (eStackMode == StackMode::YStackedPercent) )
                 ? chart2::StackingDirection_Y_STACKING
-                : (eStackMode == StackMode_Z_STACKED )
+                : (eStackMode == StackMode::ZStacked )
                 ? chart2::StackingDirection_Z_STACKING
                 : chart2::StackingDirection_NO_STACKING );
             xSeriesProp->setPropertyValue( "StackingDirection", aPropValue );
@@ -435,7 +435,7 @@ void SAL_CALL ChartTypeTemplate::applyStyles( const Reference< chart2::XDiagram
 void SAL_CALL ChartTypeTemplate::resetStyles( const Reference< chart2::XDiagram >& xDiagram )
 {
     // reset number format if we had percent stacking on
-    bool bPercent = (getStackMode(0) == StackMode_Y_STACKED_PERCENT);
+    bool bPercent = (getStackMode(0) == StackMode::YStackedPercent);
     if( bPercent )
     {
         Sequence< Reference< chart2::XAxis > > aAxisSeq( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
@@ -523,7 +523,7 @@ sal_Int32 ChartTypeTemplate::getDimension() const
 
 StackMode ChartTypeTemplate::getStackMode( sal_Int32 /* nChartTypeIndex */ ) const
 {
-    return StackMode_NONE;
+    return StackMode::NONE;
 }
 
 bool ChartTypeTemplate::isSwapXAndY() const
@@ -652,7 +652,7 @@ void ChartTypeTemplate::adaptScales(
                     Reference< chart2::XAxis > xAxis( xCooSys->getAxisByDimension( 1,nI ));
                     if( xAxis.is())
                     {
-                        bool bPercent = (getStackMode(0) == StackMode_Y_STACKED_PERCENT);
+                        bool bPercent = (getStackMode(0) == StackMode::YStackedPercent);
                         chart2::ScaleData aScaleData = xAxis->getScaleData();
 
                         if( bPercent != (aScaleData.AxisType==AxisType::PERCENT) )
@@ -738,7 +738,7 @@ void ChartTypeTemplate::adaptAxes(
                     if( nAxisIndex == MAIN_AXIS_INDEX || nAxisIndex == SECONDARY_AXIS_INDEX )
                     {
                         // adapt scales
-                        bool bPercent = (getStackMode(0) == StackMode_Y_STACKED_PERCENT);
+                        bool bPercent = (getStackMode(0) == StackMode::YStackedPercent);
                         if( bPercent && nDim == 1 )
                         {
                             Reference< beans::XPropertySet > xAxisProp( xAxis, uno::UNO_QUERY );
diff --git a/chart2/source/model/template/ChartTypeTemplate.hxx b/chart2/source/model/template/ChartTypeTemplate.hxx
index c32fcbd..4cf11ca 100644
--- a/chart2/source/model/template/ChartTypeTemplate.hxx
+++ b/chart2/source/model/template/ChartTypeTemplate.hxx
@@ -118,7 +118,7 @@ protected:
     /// returns 2 by default.  Supported are 2 and 3
     virtual sal_Int32 getDimension() const;
 
-    /** returns StackMode_NONE by default.  This is a global flag used for all
+    /** returns StackMode::NONE by default.  This is a global flag used for all
         series of a specific chart type.  If percent stacking is supported, the
         percent stacking mode is retrieved from the first chart type (index 0)
 
diff --git a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
index 33bac47..f6dd851 100644
--- a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
@@ -260,7 +260,7 @@ StackMode ColumnLineChartTypeTemplate::getStackMode( sal_Int32 nChartTypeIndex )
 {
     if( nChartTypeIndex == 0 )
         return m_eStackMode;
-    return StackMode_NONE;
+    return StackMode::NONE;
 }
 
 // ____ XChartTypeTemplate ____
diff --git a/chart2/source/model/template/ScatterChartTypeTemplate.cxx b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
index e510280..fe216ea 100644
--- a/chart2/source/model/template/ScatterChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
@@ -192,8 +192,8 @@ sal_Int32 ScatterChartTypeTemplate::getDimension() const
 StackMode ScatterChartTypeTemplate::getStackMode( sal_Int32 /* nChartTypeIndex */ ) const
 {
     if( m_nDim == 3 )
-        return StackMode_Z_STACKED;
-    return StackMode_NONE;
+        return StackMode::ZStacked;
+    return StackMode::NONE;
 }
 
 void SAL_CALL ScatterChartTypeTemplate::applyStyle(
diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx
index a1cf622..f822e29 100644
--- a/chart2/source/tools/ChartTypeHelper.cxx
+++ b/chart2/source/tools/ChartTypeHelper.cxx
@@ -45,7 +45,7 @@ bool ChartTypeHelper::isSupportingAxisSideBySide(
         bool bFound=false;
         bool bAmbiguous=false;
         StackMode eStackMode = DiagramHelper::getStackModeFromChartType( xChartType, bFound, bAmbiguous, nullptr );
-        if( eStackMode == StackMode_NONE && !bAmbiguous )
+        if( eStackMode == StackMode::NONE && !bAmbiguous )
         {
             OUString aChartTypeName = xChartType->getChartType();
             bResult = ( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN) ||
@@ -223,7 +223,7 @@ bool ChartTypeHelper::isSupportingBarConnectors(
         bool bFound=false;
         bool bAmbiguous=false;
         StackMode eStackMode = DiagramHelper::getStackModeFromChartType( xChartType, bFound, bAmbiguous, nullptr );
-        if( eStackMode != StackMode_Y_STACKED || bAmbiguous )
+        if( eStackMode != StackMode::YStacked || bAmbiguous )
             return false;
 
         OUString aChartTypeName = xChartType->getChartType();
@@ -574,7 +574,7 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedMissingValueTreatments(
     bool bFound=false;
     bool bAmbiguous=false;
     StackMode eStackMode = DiagramHelper::getStackModeFromChartType( xChartType, bFound, bAmbiguous, nullptr );
-    bool bStacked = bFound && (StackMode_Y_STACKED == eStackMode);
+    bool bStacked = bFound && (StackMode::YStacked == eStackMode);
 
     OUString aChartTypeName = xChartType->getChartType();
     if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN) ||
diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx
index 2ca3a1d..5837ea2 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -387,14 +387,11 @@ void setStackModeAtSeries(
     const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem,
     StackMode eStackMode )
 {
-    if( eStackMode == StackMode_AMBIGUOUS )
-        return;
-
     const uno::Any aPropValue(
-        ( (eStackMode == StackMode_Y_STACKED) ||
-          (eStackMode == StackMode_Y_STACKED_PERCENT) )
+        ( (eStackMode == StackMode::YStacked) ||
+          (eStackMode == StackMode::YStackedPercent) )
         ? chart2::StackingDirection_Y_STACKING
-        : (eStackMode == StackMode_Z_STACKED )
+        : (eStackMode == StackMode::ZStacked )
         ? chart2::StackingDirection_Z_STACKING
         : chart2::StackingDirection_NO_STACKING );
 
@@ -435,7 +432,7 @@ void setStackModeAtSeries(
                 xCorrespondingCoordinateSystem->getAxisByDimension( 1, nAxisIndex ));
             if( xAxis.is())
             {
-                bool bPercent = (eStackMode == StackMode_Y_STACKED_PERCENT);
+                bool bPercent = (eStackMode == StackMode::YStackedPercent);
                 chart2::ScaleData aScaleData = xAxis->getScaleData();
 
                 if( bPercent != (aScaleData.AxisType==chart2::AxisType::PERCENT) )
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index c70f7e1..1866bf1 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -232,9 +232,6 @@ void DiagramHelper::setStackMode(
 {
     try
     {
-        if( eStackMode == StackMode_AMBIGUOUS )
-            return;
-
         bool bValueFound = false;
         bool bIsAmbiguous = false;
         StackMode eOldStackMode = DiagramHelper::getStackMode( xDiagram, bValueFound, bIsAmbiguous );
@@ -243,15 +240,15 @@ void DiagramHelper::setStackMode(
             return;
 
         StackingDirection eNewDirection = StackingDirection_NO_STACKING;
-        if( eStackMode == StackMode_Y_STACKED || eStackMode == StackMode_Y_STACKED_PERCENT )
+        if( eStackMode == StackMode::YStacked || eStackMode == StackMode::YStackedPercent )
             eNewDirection = StackingDirection_Y_STACKING;
-        else if( eStackMode == StackMode_Z_STACKED )
+        else if( eStackMode == StackMode::ZStacked )
             eNewDirection = StackingDirection_Z_STACKING;
 
         uno::Any aNewDirection( eNewDirection );
 
         bool bPercent = false;
-        if( eStackMode == StackMode_Y_STACKED_PERCENT )
+        if( eStackMode == StackMode::YStackedPercent )
             bPercent = true;
 
         //iterate through all coordinate systems
@@ -319,7 +316,7 @@ StackMode DiagramHelper::getStackMode( const Reference< XDiagram > & xDiagram, b
     rbFound=false;
     rbAmbiguous=false;
 
-    StackMode eGlobalStackMode = StackMode_NONE;
+    StackMode eGlobalStackMode = StackMode::NONE;
 
     //iterate through all coordinate systems
     uno::Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
@@ -360,7 +357,7 @@ StackMode DiagramHelper::getStackModeFromChartType(
     bool& rbFound, bool& rbAmbiguous,
     const Reference< XCoordinateSystem > & xCorrespondingCoordinateSystem )
 {
-    StackMode eStackMode = StackMode_NONE;
+    StackMode eStackMode = StackMode::NONE;
     rbFound = false;
     rbAmbiguous = false;
 
@@ -403,10 +400,10 @@ StackMode DiagramHelper::getStackModeFromChartType(
         if( rbFound )
         {
             if( eCommonDirection == chart2::StackingDirection_Z_STACKING )
-                eStackMode = StackMode_Z_STACKED;
+                eStackMode = StackMode::ZStacked;
             else if( eCommonDirection == chart2::StackingDirection_Y_STACKING )
             {
-                eStackMode = StackMode_Y_STACKED;
+                eStackMode = StackMode::YStacked;
 
                 // percent stacking
                 if( xCorrespondingCoordinateSystem.is() )
@@ -423,7 +420,7 @@ StackMode DiagramHelper::getStackModeFromChartType(
                         {
                             chart2::ScaleData aScaleData = xAxis->getScaleData();
                             if( aScaleData.AxisType==chart2::AxisType::PERCENT )
-                                eStackMode = StackMode_Y_STACKED_PERCENT;
+                                eStackMode = StackMode::YStackedPercent;
                         }
                     }
                 }
@@ -519,10 +516,10 @@ void DiagramHelper::setDimension(
         }
 
         //correct stack mode if necessary
-        if( nNewDimensionCount==3 && eStackMode != StackMode_Z_STACKED && bIsSupportingOnlyDeepStackingFor3D )
-            DiagramHelper::setStackMode( xDiagram, StackMode_Z_STACKED );
-        else if( nNewDimensionCount==2 && eStackMode == StackMode_Z_STACKED )
-            DiagramHelper::setStackMode( xDiagram, StackMode_NONE );
+        if( nNewDimensionCount==3 && eStackMode != StackMode::ZStacked && bIsSupportingOnlyDeepStackingFor3D )
+            DiagramHelper::setStackMode( xDiagram, StackMode::ZStacked );
+        else if( nNewDimensionCount==2 && eStackMode == StackMode::ZStacked )
+            DiagramHelper::setStackMode( xDiagram, StackMode::NONE );
     }
     catch( const uno::Exception & ex )
     {
diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index f409a5e..cb45db7 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -180,6 +180,7 @@ for d in definitionSet:
          "include/editeng/bulletitem.hxx", # css::style::NumberingType
          "basic/source/sbx/sbxdec.hxx", # SbxDecimal::CmpResult, must match some Windows API
          "codemaker/source/javamaker/javatype.cxx", # TypeInfo::Flags, from UNO
+         "chart2/source/view/inc/AbstractShapeFactory.hxx", # chart::SymbolEnum, called via int UNO param
         # represents constants from an external API
          "opencl/inc/opencl_device_selection.h",
          "vcl/inc/sft.hxx",
commit ce92b5da976122a9120fbb499f7a823ed67a4d01
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Feb 17 08:37:46 2017 +0200

    drop enum NormalAxis
    
    since we only ever use the Z enumerator
    
    Change-Id: Ia162a6be650704649f5232fff0fa229c7b346450

diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index 34001ef..3549cea 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -97,7 +97,7 @@ struct PieChart::ShapeParam
 class PiePositionHelper : public PolarPlottingPositionHelper
 {
 public:
-    PiePositionHelper( NormalAxis eNormalAxis, double fAngleDegreeOffset );
+    PiePositionHelper( double fAngleDegreeOffset );
 
     bool    getInnerAndOuterRadius( double fCategoryX, double& fLogicInnerRadius, double& fLogicOuterRadius, bool bUseRings, double fMaxOffset ) const;
 
@@ -106,9 +106,8 @@ public:
     double  m_fRingDistance; //>=0 m_fRingDistance=1 --> distance == width
 };
 
-PiePositionHelper::PiePositionHelper( NormalAxis eNormalAxis, double fAngleDegreeOffset )
-        : PolarPlottingPositionHelper(eNormalAxis)
-        , m_fRingDistance(0.0)
+PiePositionHelper::PiePositionHelper( double fAngleDegreeOffset )
+        : m_fRingDistance(0.0)
 {
     m_fRadiusOffset = 0.0;
     m_fAngleDegreeOffset = fAngleDegreeOffset;
@@ -166,7 +165,7 @@ PieChart::PieChart( const uno::Reference<XChartType>& xChartTypeModel
                    , sal_Int32 nDimensionCount
                    , bool bExcludingPositioning )
         : VSeriesPlotter( xChartTypeModel, nDimensionCount )
-        , m_pPosHelper( new PiePositionHelper( NormalAxis_Z, (m_nDimension==3)?0.0:90.0 ) )
+        , m_pPosHelper( new PiePositionHelper( (m_nDimension==3) ? 0.0 : 90.0 ) )
         , m_bUseRings(false)
         , m_bSizeExcludesLabelsAndExplodedSegments(bExcludingPositioning)
 {
diff --git a/chart2/source/view/inc/PlottingPositionHelper.hxx b/chart2/source/view/inc/PlottingPositionHelper.hxx
index 19c341b..39a3757 100644
--- a/chart2/source/view/inc/PlottingPositionHelper.hxx
+++ b/chart2/source/view/inc/PlottingPositionHelper.hxx
@@ -134,18 +134,10 @@ protected: //member
     bool   m_bAllowShiftZAxisPos;
 };
 
-//describes which axis of the drawinglayer scene or screen axis are the normal axis
-enum NormalAxis
-{
-      NormalAxis_X
-    , NormalAxis_Y
-    , NormalAxis_Z
-};
-
 class PolarPlottingPositionHelper : public PlottingPositionHelper
 {
 public:
-    PolarPlottingPositionHelper( NormalAxis eNormalAxis=NormalAxis_Z );
+    PolarPlottingPositionHelper();
     PolarPlottingPositionHelper( const PolarPlottingPositionHelper& rSource );
     virtual ~PolarPlottingPositionHelper() override;
 
@@ -217,7 +209,6 @@ public:
 
 private:
     ::basegfx::B3DHomMatrix m_aUnitCartesianToScene;
-    NormalAxis  m_eNormalAxis;
 
     ::basegfx::B3DHomMatrix impl_calculateMatrixUnitCartesianToScene( const ::basegfx::B3DHomMatrix& rMatrixScreenToScene ) const;
 };
diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx
index b074d85..02ada77 100644
--- a/chart2/source/view/main/PlottingPositionHelper.cxx
+++ b/chart2/source/view/main/PlottingPositionHelper.cxx
@@ -316,11 +316,10 @@ drawing::Direction3D PlottingPositionHelper::getScaledLogicWidth() const
     return aRet;
 }
 
-PolarPlottingPositionHelper::PolarPlottingPositionHelper( NormalAxis eNormalAxis )
+PolarPlottingPositionHelper::PolarPlottingPositionHelper()
     : m_fRadiusOffset(0.0)
     , m_fAngleDegreeOffset(90.0)
     , m_aUnitCartesianToScene()
-    , m_eNormalAxis(eNormalAxis)
 {
     m_bMaySkipPointsInRegressionCalculation = false;
 }
@@ -330,7 +329,6 @@ PolarPlottingPositionHelper::PolarPlottingPositionHelper( const PolarPlottingPos
     , m_fRadiusOffset( rSource.m_fRadiusOffset )
     , m_fAngleDegreeOffset( rSource.m_fAngleDegreeOffset )
     , m_aUnitCartesianToScene( rSource.m_aUnitCartesianToScene )
-    , m_eNormalAxis( rSource.m_eNormalAxis )
 {
 }
 
@@ -390,27 +388,8 @@ void PolarPlottingPositionHelper::setScales( const std::vector< ExplicitScaleDat
     double fScaleY = fScale;
     double fScaleZ = fScale;
 
-    switch(m_eNormalAxis)
-    {
-        case NormalAxis_X:
-            {
-                fTranslateX = fTranslateLogicZ;
-                fScaleX = fScaleLogicZ;
-            }
-            break;
-        case NormalAxis_Y:
-            {
-                fTranslateY = fTranslateLogicZ;
-                fScaleY = fScaleLogicZ;
-            }
-            break;
-        default: //NormalAxis_Z:
-            {
-                fTranslateZ = fTranslateLogicZ;
-                fScaleZ = fScaleLogicZ;
-            }
-            break;
-    }
+    fTranslateZ = fTranslateLogicZ;
+    fScaleZ = fScaleLogicZ;
 
     aRet.translate(fTranslateX, fTranslateY, fTranslateZ);//x first
     aRet.scale(fScaleX, fScaleY, fScaleZ);//x first
@@ -645,19 +624,6 @@ drawing::Position3D PolarPlottingPositionHelper::transformUnitCircleToScene( dou
     double fY=fUnitRadius*rtl::math::sin(fAnglePi);
     double fZ=fLogicZ;
 
-    switch(m_eNormalAxis)
-    {
-        case NormalAxis_X:
-            std::swap(fX,fZ);
-            break;
-        case NormalAxis_Y:
-            std::swap(fY,fZ);
-            fZ*=-1;
-            break;
-        default: //NormalAxis_Z
-            break;
-    }
-
     //!! applying matrix to vector does ignore translation, so it is important to use a B3DPoint here instead of B3DVector
     ::basegfx::B3DPoint aPoint(fX,fY,fZ);
     ::basegfx::B3DPoint aRet = m_aUnitCartesianToScene * aPoint;
commit 1ac9f8ddd7d4126a138b84143f48abdc5c41d0ff
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Feb 17 08:33:01 2017 +0200

    convert PropertyType to scoped enum
    
    and drop unused enumerators
    
    Change-Id: I61d2a46ed84ce4163757a2da58162c72b1b0950f

diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 134a989..9b4b3fa 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -2356,15 +2356,15 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForSeries(
     LegendSymbolStyle eLegendSymbolStyle = this->getLegendSymbolStyle();
     uno::Any aExplicitSymbol( this->getExplicitSymbol( rSeries, -1 ) );
 
-    VLegendSymbolFactory::tPropertyType ePropType =
-        VLegendSymbolFactory::PROP_TYPE_FILLED_SERIES;
+    VLegendSymbolFactory::PropertyType ePropType =
+        VLegendSymbolFactory::PropertyType::FilledSeries;
 
     // todo: maybe the property-style does not solely depend on the
     // legend-symbol type
     switch( eLegendSymbolStyle )
     {
         case LegendSymbolStyle_LINE:
-            ePropType = VLegendSymbolFactory::PROP_TYPE_LINE_SERIES;
+            ePropType = VLegendSymbolFactory::PropertyType::LineSeries;
             break;
         default:
             break;
@@ -2387,15 +2387,15 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForPoint(
     LegendSymbolStyle eLegendSymbolStyle = this->getLegendSymbolStyle();
     uno::Any aExplicitSymbol( this->getExplicitSymbol(rSeries,nPointIndex) );
 
-    VLegendSymbolFactory::tPropertyType ePropType =
-        VLegendSymbolFactory::PROP_TYPE_FILLED_SERIES;
+    VLegendSymbolFactory::PropertyType ePropType =
+        VLegendSymbolFactory::PropertyType::FilledSeries;
 
     // todo: maybe the property-style does not solely depend on the
     // legend-symbol type
     switch( eLegendSymbolStyle )
     {
         case LegendSymbolStyle_LINE:
-            ePropType = VLegendSymbolFactory::PROP_TYPE_LINE_SERIES;
+            ePropType = VLegendSymbolFactory::PropertyType::LineSeries;
             break;
         default:
             break;
@@ -2537,7 +2537,7 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
                     Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
                         xSymbolGroup, LegendSymbolStyle_LINE, xShapeFactory,
                         Reference< beans::XPropertySet >( aCurves[i], uno::UNO_QUERY ),
-                        VLegendSymbolFactory::PROP_TYPE_LINE, uno::Any() ));
+                        VLegendSymbolFactory::PropertyType::Line, uno::Any() ));
 
                     // set CID to symbol for selection
                     if( xShape.is())
diff --git a/chart2/source/view/inc/VLegendSymbolFactory.hxx b/chart2/source/view/inc/VLegendSymbolFactory.hxx
index 5656bb1..e5ff577 100644
--- a/chart2/source/view/inc/VLegendSymbolFactory.hxx
+++ b/chart2/source/view/inc/VLegendSymbolFactory.hxx
@@ -29,13 +29,11 @@ namespace chart
 
 namespace VLegendSymbolFactory
 {
-    enum tPropertyType
+    enum class PropertyType
     {
-        PROP_TYPE_FILLED_SERIES,
-        PROP_TYPE_LINE_SERIES,
-        PROP_TYPE_FILL,
-        PROP_TYPE_LINE,
-        PROP_TYPE_FILL_AND_LINE
+        FilledSeries,
+        LineSeries,
+        Line,
     };
 
     css::uno::Reference< css::drawing::XShape >
@@ -45,7 +43,7 @@ namespace VLegendSymbolFactory
             LegendSymbolStyle eStyle,
             const css::uno::Reference< css::lang::XMultiServiceFactory > & xShapeFactory,
             const css::uno::Reference< css::beans::XPropertySet > & xLegendEntryProperties,
-            tPropertyType ePropertyType,
+            PropertyType ePropertyType,
             const css::uno::Any& rExplicitSymbol /*should contain a css::chart2::Symbol without automatic symbol if the charttype does support symbols else empty*/);
 }
 
diff --git a/chart2/source/view/main/VLegendSymbolFactory.cxx b/chart2/source/view/main/VLegendSymbolFactory.cxx
index ee8a0df..0ccc53d 100644
--- a/chart2/source/view/main/VLegendSymbolFactory.cxx
+++ b/chart2/source/view/main/VLegendSymbolFactory.cxx
@@ -34,33 +34,25 @@ namespace
 void getPropNamesAndValues( const Reference< beans::XPropertySet >& xProp,
         ::chart::tNameSequence& rNames,
         ::chart::tAnySequence& rValues,
-        ::chart::VLegendSymbolFactory::tPropertyType ePropertyType,
+        ::chart::VLegendSymbolFactory::PropertyType ePropertyType,
         const awt::Size& aMaxSymbolExtent)
 {
     const ::chart::tPropertyNameMap & aFilledSeriesNameMap( ::chart::PropertyMapper::getPropertyNameMapForFilledSeriesProperties());
     const ::chart::tPropertyNameMap & aLineSeriesNameMap( ::chart::PropertyMapper::getPropertyNameMapForLineSeriesProperties());
     const ::chart::tPropertyNameMap & aLineNameMap( ::chart::PropertyMapper::getPropertyNameMapForLineProperties());
-    const ::chart::tPropertyNameMap & aFillNameMap( ::chart::PropertyMapper::getPropertyNameMapForFillProperties());
-    const ::chart::tPropertyNameMap & aFillLineNameMap( ::chart::PropertyMapper::getPropertyNameMapForFillAndLineProperties());
 
     ::chart::tPropertyNameValueMap aValueMap;
     switch( ePropertyType )
     {
-        case ::chart::VLegendSymbolFactory::PROP_TYPE_FILLED_SERIES:
+        case ::chart::VLegendSymbolFactory::PropertyType::FilledSeries:
             ::chart::PropertyMapper::getValueMap( aValueMap, aFilledSeriesNameMap, xProp );
             break;
-        case ::chart::VLegendSymbolFactory::PROP_TYPE_LINE_SERIES:
+        case ::chart::VLegendSymbolFactory::PropertyType::LineSeries:
             ::chart::PropertyMapper::getValueMap( aValueMap, aLineSeriesNameMap, xProp );
             break;
-        case ::chart::VLegendSymbolFactory::PROP_TYPE_LINE:
+        case ::chart::VLegendSymbolFactory::PropertyType::Line:
             ::chart::PropertyMapper::getValueMap( aValueMap, aLineNameMap, xProp );
             break;
-        case ::chart::VLegendSymbolFactory::PROP_TYPE_FILL:
-            ::chart::PropertyMapper::getValueMap( aValueMap, aFillNameMap, xProp );
-            break;
-        case ::chart::VLegendSymbolFactory::PROP_TYPE_FILL_AND_LINE:
-            ::chart::PropertyMapper::getValueMap( aValueMap, aFillLineNameMap, xProp );
-            break;
     }
 
     ::chart::PropertyMapper::getMultiPropertyListsFromValueMap( rNames, rValues, aValueMap );
@@ -79,7 +71,7 @@ void getPropNamesAndValues( const Reference< beans::XPropertySet >& xProp,
 void lcl_setPropertiesToShape(
     const Reference< beans::XPropertySet > & xProp,
     const Reference< drawing::XShape > & xShape,
-    ::chart::VLegendSymbolFactory::tPropertyType ePropertyType,
+    ::chart::VLegendSymbolFactory::PropertyType ePropertyType,
     const awt::Size& aMaxSymbolExtent)
 {
     ::chart::tNameSequence aPropNames;
@@ -102,7 +94,7 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
     LegendSymbolStyle eStyle,
     const Reference< lang::XMultiServiceFactory > & xShapeFactory,
     const Reference< beans::XPropertySet > & xLegendEntryProperties,
-    tPropertyType ePropertyType, const uno::Any& rExplicitSymbol )
+    PropertyType ePropertyType, const uno::Any& rExplicitSymbol )
 {
     Reference< drawing::XShape > xResult;
 
@@ -178,7 +170,7 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
                         awt::Point( rEntryKeyAspectRatio.Width/2-nSize/2, rEntryKeyAspectRatio.Height/2-nSize/2 ));
             if( xShape.is() )
             {
-                lcl_setPropertiesToShape( xLegendEntryProperties, xShape, ePropertyType, awt::Size(0,0) ); // PROP_TYPE_FILLED_SERIES );
+                lcl_setPropertiesToShape( xLegendEntryProperties, xShape, ePropertyType, awt::Size(0,0) ); // PropertyType::FilledSeries );
             }
         }
         else // eStyle == LegendSymbolStyle_BOX
@@ -187,7 +179,7 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
             tAnySequence aPropValues;
 
             getPropNamesAndValues( xLegendEntryProperties, aPropNames, aPropValues,
-                    ePropertyType, awt::Size(0,0) );// PROP_TYPE_FILLED_SERIES
+                    ePropertyType, awt::Size(0,0) );// PropertyType::FilledSeries
 
             Reference< drawing::XShape > xShape =
                 pShapeFactory->createRectangle( xResultGroup,
diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index ebd5dda..f409a5e 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -117,6 +117,7 @@ for d in definitionSet:
          "basic/source/inc/filefmt.hxx", # FileOffset
          "include/basic/sbxdef.hxx", # SbxDataType
          "connectivity/source/inc/dbase/DTable.hxx", # ODbaseTable::DBFType
+         "codemaker/source/javamaker/classfile.hxx", # AccessFlags
         # unit test code
          "cppu/source/uno/check.cxx",
         # general weird nonsense going on
@@ -177,7 +178,8 @@ for d in definitionSet:
          "cui/source/tabpages/tparea.cxx", # FillType (from UI)
          "include/editeng/svxenum.hxx", # css::style::NumberingType
          "include/editeng/bulletitem.hxx", # css::style::NumberingType
-         ":basic/source/sbx/sbxdec.hxx", # SbxDecimal::CmpResult, must match some Windows API
+         "basic/source/sbx/sbxdec.hxx", # SbxDecimal::CmpResult, must match some Windows API
+         "codemaker/source/javamaker/javatype.cxx", # TypeInfo::Flags, from UNO
         # represents constants from an external API
          "opencl/inc/opencl_device_selection.h",
          "vcl/inc/sft.hxx",
commit 8fc4aecde317a1c49755b1a0695d8359830a2c8d
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Feb 17 08:22:47 2017 +0200

    convert ValueParser::State to scoped enum
    
    Change-Id: I20c8217576fb6993107f1e45429adc5660d38da8

diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index 34d52cb..ebd5dda 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -116,6 +116,7 @@ for d in definitionSet:
          "filter/source/graphicfilter/icgm/cgmtypes.hxx",
          "basic/source/inc/filefmt.hxx", # FileOffset
          "include/basic/sbxdef.hxx", # SbxDataType
+         "connectivity/source/inc/dbase/DTable.hxx", # ODbaseTable::DBFType
         # unit test code
          "cppu/source/uno/check.cxx",
         # general weird nonsense going on
@@ -142,6 +143,7 @@ for d in definitionSet:
          "basic/source/inc/opcodes.hxx", # SbiOpcode
          "basic/source/inc/token.hxx", # SbiToken
          "binaryurp/source/specialfunctionids.hxx", # binaryurp::SpecialFunctionIds
+         "connectivity/source/inc/odbc/OTools.hxx", # ODBC3SQLFunctionId
         # Windows or OSX only
          "include/canvas/rendering/icolorbuffer.hxx",
          "include/vcl/commandevent.hxx",
@@ -184,6 +186,7 @@ for d in definitionSet:
          "vcl/unx/gtk/salnativewidgets-gtk.cxx",
          "sc/inc/callform.hxx", # ParamType
          "include/i18nlangtag/applelangid.hxx", # AppleLanguageId
+         "connectivity/source/drivers/firebird/Util.hxx", # firebird::BlobSubtype
          ]):
         continue
 
diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
index 3317607..d26bddc 100644
--- a/configmgr/source/valueparser.cxx
+++ b/configmgr/source/valueparser.cxx
@@ -256,12 +256,12 @@ ValueParser::~ValueParser() {}
 xmlreader::XmlReader::Text ValueParser::getTextMode() const {
     if (node_.is()) {
         switch (state_) {
-        case STATE_TEXT:
+        case State::Text:
             if (!items_.empty()) {
                 break;
             }
             SAL_FALLTHROUGH;
-        case STATE_IT:
+        case State::IT:
             return
                 (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST ||
                  !separator_.isEmpty())
@@ -282,18 +282,18 @@ bool ValueParser::startElement(
         return false;
     }
     switch (state_) {
-    case STATE_TEXT:
+    case State::Text:
         if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals("it") &&
             isListType(type_) && separator_.isEmpty())
         {
             pad_.clear();
                 // before first <it>, characters are not ignored; assume they
                 // are only whitespace
-            state_ = STATE_IT;
+            state_ = State::IT;
             return true;
         }
         SAL_FALLTHROUGH;
-    case STATE_IT:
+    case State::IT:
         if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
             name.equals("unicode") &&
             (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST))
@@ -327,7 +327,7 @@ bool ValueParser::startElement(
                 throw css::uno::RuntimeException(
                     "bad unicode scalar attribute in " + reader.getUrl());
             }
-            state_ = State(state_ + 1);
+            state_ = state_ == State::Text ? State::TextUnicode : State::ITUnicode;
             return true;
         }
         break;
@@ -343,7 +343,7 @@ bool ValueParser::endElement() {
         return false;
     }
     switch (state_) {
-    case STATE_TEXT:
+    case State::Text:
         {
             css::uno::Any *pValue = nullptr;
 
@@ -407,15 +407,17 @@ bool ValueParser::endElement() {
             node_.clear();
         }
         break;
-    case STATE_TEXT_UNICODE:
-    case STATE_IT_UNICODE:
-        state_ = State(state_ - 1);
+    case State::TextUnicode:
+        state_ = State::Text;
         break;
-    case STATE_IT:
+    case State::ITUnicode:
+        state_ = State::IT;
+        break;
+    case State::IT:
         items_.push_back(
             parseValue(OString(), pad_.get(), elementType(type_)));
         pad_.clear();
-        state_ = STATE_TEXT;
+        state_ = State::Text;
         break;
     }
     return true;
@@ -423,7 +425,7 @@ bool ValueParser::endElement() {
 
 void ValueParser::characters(xmlreader::Span const & text) {
     if (node_.is()) {
-        assert(state_ == STATE_TEXT || state_ == STATE_IT);
+        assert(state_ == State::Text || state_ == State::IT);
         pad_.add(text.begin, text.length);
     }
 }
@@ -434,7 +436,7 @@ void ValueParser::start(
     assert(node.is() && !node_.is());
     node_ = node;
     localizedName_ = localizedName;
-    state_ = STATE_TEXT;
+    state_ = State::Text;
 }
 
 
diff --git a/configmgr/source/valueparser.hxx b/configmgr/source/valueparser.hxx
index 092d910..50cab46 100644
--- a/configmgr/source/valueparser.hxx
+++ b/configmgr/source/valueparser.hxx
@@ -73,7 +73,7 @@ private:
 
     template< typename T > css::uno::Any convertItems();
 
-    enum State { STATE_TEXT, STATE_TEXT_UNICODE, STATE_IT, STATE_IT_UNICODE };
+    enum class State { Text, TextUnicode, IT, ITUnicode };
 
     int layer_;
     rtl::Reference< Node > node_;
commit 2c06083c75cca66885c356520b5a83b4a722796b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Feb 17 08:12:58 2017 +0200

    remove unused NONE from TAscendingOrder enum
    
    Change-Id: I31c793df40b2a687b4a6c84854f34aba72ac0494

diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index 8188c5a..34d52cb 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -114,7 +114,8 @@ for d in definitionSet:
          "sd/source/filter/eppt/epptbase.hxx", # PPTExTextAttr
          "sc/source/filter/inc/tokstack.hxx", # E_TYPE
          "filter/source/graphicfilter/icgm/cgmtypes.hxx",
-         ":basic/source/inc/filefmt.hxx", # FileOffset
+         "basic/source/inc/filefmt.hxx", # FileOffset
+         "include/basic/sbxdef.hxx", # SbxDataType
         # unit test code
          "cppu/source/uno/check.cxx",
         # general weird nonsense going on
diff --git a/connectivity/source/drivers/dbase/DResultSet.cxx b/connectivity/source/drivers/dbase/DResultSet.cxx
index cc13355..af17e61 100644
--- a/connectivity/source/drivers/dbase/DResultSet.cxx
+++ b/connectivity/source/drivers/dbase/DResultSet.cxx
@@ -170,10 +170,7 @@ bool ODbaseResultSet::fillIndexValues(const Reference< XColumnsSupplier> &_xInde
                 sal_uInt32 nRec = pIter->First();
                 while (nRec != NODE_NOTFOUND)
                 {
-                    if (m_aOrderbyAscending[0] != TAscendingOrder::NONE)
-                        m_pFileSet->get().push_back(nRec);
-                    else
-                        m_pFileSet->get().insert(m_pFileSet->get().begin(),nRec);
+                    m_pFileSet->get().push_back(nRec);
                     nRec = pIter->Next();
                 }
                 m_pFileSet->setFrozen();
diff --git a/connectivity/source/inc/TSortIndex.hxx b/connectivity/source/inc/TSortIndex.hxx
index 599e8f7..be1a04d 100644
--- a/connectivity/source/inc/TSortIndex.hxx
+++ b/connectivity/source/inc/TSortIndex.hxx
@@ -34,7 +34,6 @@ namespace connectivity
     enum class TAscendingOrder
     {
         ASC     = 1,            // ascending
-        NONE    = 0,
         DESC    = -1            // otherwise
     };
 


More information about the Libreoffice-commits mailing list