diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-17 08:33:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-17 09:56:19 +0200 |
commit | 1ac9f8ddd7d4126a138b84143f48abdc5c41d0ff (patch) | |
tree | 18745cc3ee5fae8d30635d77e8a75525bf144cb3 /chart2 | |
parent | 8fc4aecde317a1c49755b1a0695d8359830a2c8d (diff) |
convert PropertyType to scoped enum
and drop unused enumerators
Change-Id: I61d2a46ed84ce4163757a2da58162c72b1b0950f
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/charttypes/VSeriesPlotter.cxx | 14 | ||||
-rw-r--r-- | chart2/source/view/inc/VLegendSymbolFactory.hxx | 12 | ||||
-rw-r--r-- | chart2/source/view/main/VLegendSymbolFactory.cxx | 24 |
3 files changed, 20 insertions, 30 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, |