summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-17 08:33:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-17 09:56:19 +0200
commit1ac9f8ddd7d4126a138b84143f48abdc5c41d0ff (patch)
tree18745cc3ee5fae8d30635d77e8a75525bf144cb3
parent8fc4aecde317a1c49755b1a0695d8359830a2c8d (diff)
convert PropertyType to scoped enum
and drop unused enumerators Change-Id: I61d2a46ed84ce4163757a2da58162c72b1b0950f
-rw-r--r--chart2/source/view/charttypes/VSeriesPlotter.cxx14
-rw-r--r--chart2/source/view/inc/VLegendSymbolFactory.hxx12
-rw-r--r--chart2/source/view/main/VLegendSymbolFactory.cxx24
-rwxr-xr-xcompilerplugins/clang/unusedenumconstants.py4
4 files changed, 23 insertions, 31 deletions
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 134a9898e6d4..9b4b3fa3d764 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 5656bb1d1491..e5ff577bfb07 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 ee8a0df63088..0ccc53df3dcb 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 ebd5ddaba474..f409a5eaa7f0 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",