convert PropertyType to scoped enum

and drop unused enumerators

Change-Id: I61d2a46ed84ce4163757a2da58162c72b1b0950f
This commit is contained in:
Noel Grandin
2017-02-17 08:33:01 +02:00
parent 8fc4aecde3
commit 1ac9f8ddd7
4 changed files with 23 additions and 31 deletions

View File

@@ -2356,15 +2356,15 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForSeries(
LegendSymbolStyle eLegendSymbolStyle = this->getLegendSymbolStyle(); LegendSymbolStyle eLegendSymbolStyle = this->getLegendSymbolStyle();
uno::Any aExplicitSymbol( this->getExplicitSymbol( rSeries, -1 ) ); uno::Any aExplicitSymbol( this->getExplicitSymbol( rSeries, -1 ) );
VLegendSymbolFactory::tPropertyType ePropType = VLegendSymbolFactory::PropertyType ePropType =
VLegendSymbolFactory::PROP_TYPE_FILLED_SERIES; VLegendSymbolFactory::PropertyType::FilledSeries;
// todo: maybe the property-style does not solely depend on the // todo: maybe the property-style does not solely depend on the
// legend-symbol type // legend-symbol type
switch( eLegendSymbolStyle ) switch( eLegendSymbolStyle )
{ {
case LegendSymbolStyle_LINE: case LegendSymbolStyle_LINE:
ePropType = VLegendSymbolFactory::PROP_TYPE_LINE_SERIES; ePropType = VLegendSymbolFactory::PropertyType::LineSeries;
break; break;
default: default:
break; break;
@@ -2387,15 +2387,15 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForPoint(
LegendSymbolStyle eLegendSymbolStyle = this->getLegendSymbolStyle(); LegendSymbolStyle eLegendSymbolStyle = this->getLegendSymbolStyle();
uno::Any aExplicitSymbol( this->getExplicitSymbol(rSeries,nPointIndex) ); uno::Any aExplicitSymbol( this->getExplicitSymbol(rSeries,nPointIndex) );
VLegendSymbolFactory::tPropertyType ePropType = VLegendSymbolFactory::PropertyType ePropType =
VLegendSymbolFactory::PROP_TYPE_FILLED_SERIES; VLegendSymbolFactory::PropertyType::FilledSeries;
// todo: maybe the property-style does not solely depend on the // todo: maybe the property-style does not solely depend on the
// legend-symbol type // legend-symbol type
switch( eLegendSymbolStyle ) switch( eLegendSymbolStyle )
{ {
case LegendSymbolStyle_LINE: case LegendSymbolStyle_LINE:
ePropType = VLegendSymbolFactory::PROP_TYPE_LINE_SERIES; ePropType = VLegendSymbolFactory::PropertyType::LineSeries;
break; break;
default: default:
break; break;
@@ -2537,7 +2537,7 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio, Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
xSymbolGroup, LegendSymbolStyle_LINE, xShapeFactory, xSymbolGroup, LegendSymbolStyle_LINE, xShapeFactory,
Reference< beans::XPropertySet >( aCurves[i], uno::UNO_QUERY ), 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 // set CID to symbol for selection
if( xShape.is()) if( xShape.is())

View File

@@ -29,13 +29,11 @@ namespace chart
namespace VLegendSymbolFactory namespace VLegendSymbolFactory
{ {
enum tPropertyType enum class PropertyType
{ {
PROP_TYPE_FILLED_SERIES, FilledSeries,
PROP_TYPE_LINE_SERIES, LineSeries,
PROP_TYPE_FILL, Line,
PROP_TYPE_LINE,
PROP_TYPE_FILL_AND_LINE
}; };
css::uno::Reference< css::drawing::XShape > css::uno::Reference< css::drawing::XShape >
@@ -45,7 +43,7 @@ namespace VLegendSymbolFactory
LegendSymbolStyle eStyle, LegendSymbolStyle eStyle,
const css::uno::Reference< css::lang::XMultiServiceFactory > & xShapeFactory, const css::uno::Reference< css::lang::XMultiServiceFactory > & xShapeFactory,
const css::uno::Reference< css::beans::XPropertySet > & xLegendEntryProperties, 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*/); const css::uno::Any& rExplicitSymbol /*should contain a css::chart2::Symbol without automatic symbol if the charttype does support symbols else empty*/);
} }

View File

@@ -34,33 +34,25 @@ namespace
void getPropNamesAndValues( const Reference< beans::XPropertySet >& xProp, void getPropNamesAndValues( const Reference< beans::XPropertySet >& xProp,
::chart::tNameSequence& rNames, ::chart::tNameSequence& rNames,
::chart::tAnySequence& rValues, ::chart::tAnySequence& rValues,
::chart::VLegendSymbolFactory::tPropertyType ePropertyType, ::chart::VLegendSymbolFactory::PropertyType ePropertyType,
const awt::Size& aMaxSymbolExtent) const awt::Size& aMaxSymbolExtent)
{ {
const ::chart::tPropertyNameMap & aFilledSeriesNameMap( ::chart::PropertyMapper::getPropertyNameMapForFilledSeriesProperties()); const ::chart::tPropertyNameMap & aFilledSeriesNameMap( ::chart::PropertyMapper::getPropertyNameMapForFilledSeriesProperties());
const ::chart::tPropertyNameMap & aLineSeriesNameMap( ::chart::PropertyMapper::getPropertyNameMapForLineSeriesProperties()); const ::chart::tPropertyNameMap & aLineSeriesNameMap( ::chart::PropertyMapper::getPropertyNameMapForLineSeriesProperties());
const ::chart::tPropertyNameMap & aLineNameMap( ::chart::PropertyMapper::getPropertyNameMapForLineProperties()); const ::chart::tPropertyNameMap & aLineNameMap( ::chart::PropertyMapper::getPropertyNameMapForLineProperties());
const ::chart::tPropertyNameMap & aFillNameMap( ::chart::PropertyMapper::getPropertyNameMapForFillProperties());
const ::chart::tPropertyNameMap & aFillLineNameMap( ::chart::PropertyMapper::getPropertyNameMapForFillAndLineProperties());
::chart::tPropertyNameValueMap aValueMap; ::chart::tPropertyNameValueMap aValueMap;
switch( ePropertyType ) switch( ePropertyType )
{ {
case ::chart::VLegendSymbolFactory::PROP_TYPE_FILLED_SERIES: case ::chart::VLegendSymbolFactory::PropertyType::FilledSeries:
::chart::PropertyMapper::getValueMap( aValueMap, aFilledSeriesNameMap, xProp ); ::chart::PropertyMapper::getValueMap( aValueMap, aFilledSeriesNameMap, xProp );
break; break;
case ::chart::VLegendSymbolFactory::PROP_TYPE_LINE_SERIES: case ::chart::VLegendSymbolFactory::PropertyType::LineSeries:
::chart::PropertyMapper::getValueMap( aValueMap, aLineSeriesNameMap, xProp ); ::chart::PropertyMapper::getValueMap( aValueMap, aLineSeriesNameMap, xProp );
break; break;
case ::chart::VLegendSymbolFactory::PROP_TYPE_LINE: case ::chart::VLegendSymbolFactory::PropertyType::Line:
::chart::PropertyMapper::getValueMap( aValueMap, aLineNameMap, xProp ); ::chart::PropertyMapper::getValueMap( aValueMap, aLineNameMap, xProp );
break; 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 ); ::chart::PropertyMapper::getMultiPropertyListsFromValueMap( rNames, rValues, aValueMap );
@@ -79,7 +71,7 @@ void getPropNamesAndValues( const Reference< beans::XPropertySet >& xProp,
void lcl_setPropertiesToShape( void lcl_setPropertiesToShape(
const Reference< beans::XPropertySet > & xProp, const Reference< beans::XPropertySet > & xProp,
const Reference< drawing::XShape > & xShape, const Reference< drawing::XShape > & xShape,
::chart::VLegendSymbolFactory::tPropertyType ePropertyType, ::chart::VLegendSymbolFactory::PropertyType ePropertyType,
const awt::Size& aMaxSymbolExtent) const awt::Size& aMaxSymbolExtent)
{ {
::chart::tNameSequence aPropNames; ::chart::tNameSequence aPropNames;
@@ -102,7 +94,7 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
LegendSymbolStyle eStyle, LegendSymbolStyle eStyle,
const Reference< lang::XMultiServiceFactory > & xShapeFactory, const Reference< lang::XMultiServiceFactory > & xShapeFactory,
const Reference< beans::XPropertySet > & xLegendEntryProperties, const Reference< beans::XPropertySet > & xLegendEntryProperties,
tPropertyType ePropertyType, const uno::Any& rExplicitSymbol ) PropertyType ePropertyType, const uno::Any& rExplicitSymbol )
{ {
Reference< drawing::XShape > xResult; 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 )); awt::Point( rEntryKeyAspectRatio.Width/2-nSize/2, rEntryKeyAspectRatio.Height/2-nSize/2 ));
if( xShape.is() ) 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 else // eStyle == LegendSymbolStyle_BOX
@@ -187,7 +179,7 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
tAnySequence aPropValues; tAnySequence aPropValues;
getPropNamesAndValues( xLegendEntryProperties, aPropNames, 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 = Reference< drawing::XShape > xShape =
pShapeFactory->createRectangle( xResultGroup, pShapeFactory->createRectangle( xResultGroup,

View File

@@ -117,6 +117,7 @@ for d in definitionSet:
"basic/source/inc/filefmt.hxx", # FileOffset "basic/source/inc/filefmt.hxx", # FileOffset
"include/basic/sbxdef.hxx", # SbxDataType "include/basic/sbxdef.hxx", # SbxDataType
"connectivity/source/inc/dbase/DTable.hxx", # ODbaseTable::DBFType "connectivity/source/inc/dbase/DTable.hxx", # ODbaseTable::DBFType
"codemaker/source/javamaker/classfile.hxx", # AccessFlags
# unit test code # unit test code
"cppu/source/uno/check.cxx", "cppu/source/uno/check.cxx",
# general weird nonsense going on # general weird nonsense going on
@@ -177,7 +178,8 @@ for d in definitionSet:
"cui/source/tabpages/tparea.cxx", # FillType (from UI) "cui/source/tabpages/tparea.cxx", # FillType (from UI)
"include/editeng/svxenum.hxx", # css::style::NumberingType "include/editeng/svxenum.hxx", # css::style::NumberingType
"include/editeng/bulletitem.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 # represents constants from an external API
"opencl/inc/opencl_device_selection.h", "opencl/inc/opencl_device_selection.h",
"vcl/inc/sft.hxx", "vcl/inc/sft.hxx",