diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-17 07:57:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-17 07:57:52 +0200 |
commit | 80dd757500eeca2ee899bcf8e6d972d867690de0 (patch) | |
tree | a76dbfe782a1273aeaf6787e0188f13f3f3cc4a9 /chart2 | |
parent | convert AccessibleBase::EventType to scoped enum (diff) | |
download | core-80dd757500eeca2ee899bcf8e6d972d867690de0.tar.gz core-80dd757500eeca2ee899bcf8e6d972d867690de0.zip |
convert GraphicObjectType to scoped enum
and drop unused FILL_PROPERTIES enumerator
Change-Id: I302d9d1d997c4fc491f7950b220060740f831539
Diffstat (limited to 'chart2')
12 files changed, 150 insertions, 172 deletions
diff --git a/chart2/source/controller/inc/DataPointItemConverter.hxx b/chart2/source/controller/inc/DataPointItemConverter.hxx index 0a96b3e47d6a..1cf452b1c1a6 100644 --- a/chart2/source/controller/inc/DataPointItemConverter.hxx +++ b/chart2/source/controller/inc/DataPointItemConverter.hxx @@ -44,8 +44,7 @@ public: SfxItemPool& rItemPool, SdrModel& rDrawModel, const css::uno::Reference<css::lang::XMultiServiceFactory>& xNamedPropertyContainerFactory, - GraphicPropertyItemConverter::eGraphicObjectType eMapTo = - GraphicPropertyItemConverter::FILLED_DATA_POINT, + GraphicObjectType eMapTo = GraphicObjectType::FilledDataPoint, const css::awt::Size* pRefSize = nullptr, bool bDataSeries = false, bool bUseSpecialFillColor = false, diff --git a/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx b/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx index 0fafd00d6706..ceeb5811dfe2 100644 --- a/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx +++ b/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx @@ -30,24 +30,23 @@ namespace chart namespace wrapper { +enum class GraphicObjectType +{ + FilledDataPoint, + LineDataPoint, + LineProperties, + LineAndFillProperties +}; + class GraphicPropertyItemConverter : public ItemConverter { public: - enum eGraphicObjectType - { - FILLED_DATA_POINT, - LINE_DATA_POINT, - LINE_PROPERTIES, - FILL_PROPERTIES, - LINE_AND_FILL_PROPERTIES - }; - GraphicPropertyItemConverter( const css::uno::Reference< css::beans::XPropertySet > & rPropertySet, SfxItemPool& rItemPool, SdrModel& rDrawModel, const css::uno::Reference< css::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory, - eGraphicObjectType eObjectType = FILLED_DATA_POINT ); + GraphicObjectType eObjectType = GraphicObjectType::FilledDataPoint ); virtual ~GraphicPropertyItemConverter() override; protected: @@ -58,7 +57,7 @@ protected: virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) override; private: - eGraphicObjectType m_eGraphicObjectType; + GraphicObjectType m_GraphicObjectType; SdrModel & m_rDrawModel; css::uno::Reference< css::lang::XMultiServiceFactory > m_xNamedPropertyTableFactory; }; diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx index c7f328e6c991..e22dc881dd61 100644 --- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx @@ -95,7 +95,7 @@ AxisItemConverter::AxisItemConverter( m_aConverters.push_back( new GraphicPropertyItemConverter( rPropertySet, rItemPool, rDrawModel, xNamedPropertyContainerFactory, - GraphicPropertyItemConverter::LINE_PROPERTIES )); + GraphicObjectType::LineProperties )); m_aConverters.push_back( new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize")); diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx index d252b7debdd7..fcd6c3f60dae 100644 --- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx @@ -198,7 +198,7 @@ DataPointItemConverter::DataPointItemConverter( SfxItemPool& rItemPool, SdrModel& rDrawModel, const uno::Reference<lang::XMultiServiceFactory>& xNamedPropertyContainerFactory, - GraphicPropertyItemConverter::eGraphicObjectType eMapTo, + GraphicObjectType eMapTo, const awt::Size* pRefSize, bool bDataSeries, bool bUseSpecialFillColor, diff --git a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx index 3226db77513e..b37123747c28 100644 --- a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx @@ -100,7 +100,7 @@ ErrorBarItemConverter::ErrorBarItemConverter( m_spGraphicConverter( new GraphicPropertyItemConverter( rPropertySet, rItemPool, rDrawModel, xNamedPropertyContainerFactory, - GraphicPropertyItemConverter::LINE_PROPERTIES )), + GraphicObjectType::LineProperties )), m_xModel( xModel ) {} diff --git a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx index a86c32053a9c..9a775fc20c49 100644 --- a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx @@ -102,16 +102,10 @@ ItemPropertyMapType & lcl_GetFillPropertyMap() return aFillPropertyMap; } -bool lcl_supportsFillProperties( ::chart::wrapper::GraphicPropertyItemConverter::eGraphicObjectType eType ) +bool lcl_supportsFillProperties( ::chart::wrapper::GraphicObjectType eType ) { - return ( eType == ::chart::wrapper::GraphicPropertyItemConverter::FILLED_DATA_POINT || - eType == ::chart::wrapper::GraphicPropertyItemConverter::FILL_PROPERTIES || - eType == ::chart::wrapper::GraphicPropertyItemConverter::LINE_AND_FILL_PROPERTIES ); -} - -bool lcl_supportsLineProperties( ::chart::wrapper::GraphicPropertyItemConverter::eGraphicObjectType eType ) -{ - return ( eType != ::chart::wrapper::GraphicPropertyItemConverter::FILL_PROPERTIES ); + return ( eType == ::chart::wrapper::GraphicObjectType::FilledDataPoint || + eType == ::chart::wrapper::GraphicObjectType::LineAndFillProperties ); } bool lcl_SetContentForNamedProperty( @@ -144,9 +138,9 @@ GraphicPropertyItemConverter::GraphicPropertyItemConverter( SfxItemPool& rItemPool, SdrModel& rDrawModel, const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory, - eGraphicObjectType eObjectType /* = FILL_PROPERTIES */ ) : + GraphicObjectType eObjectType /* = FILL_PROPERTIES */ ) : ItemConverter( rPropertySet, rItemPool ), - m_eGraphicObjectType( eObjectType ), + m_GraphicObjectType( eObjectType ), m_rDrawModel( rDrawModel ), m_xNamedPropertyTableFactory( xNamedPropertyContainerFactory ) {} @@ -158,16 +152,14 @@ const sal_uInt16 * GraphicPropertyItemConverter::GetWhichPairs() const { const sal_uInt16 * pResult = nullptr; - switch( m_eGraphicObjectType ) + switch( m_GraphicObjectType ) { - case LINE_DATA_POINT: - case FILLED_DATA_POINT: + case GraphicObjectType::LineDataPoint: + case GraphicObjectType::FilledDataPoint: pResult = nRowWhichPairs; break; - case LINE_PROPERTIES: + case GraphicObjectType::LineProperties: pResult = nLinePropertyWhichPairs; break; - case FILL_PROPERTIES: - pResult = nFillPropertyWhichPairs; break; - case LINE_AND_FILL_PROPERTIES: + case GraphicObjectType::LineAndFillProperties: pResult = nLineAndFillPropertyWhichPairs; break; } @@ -179,27 +171,22 @@ bool GraphicPropertyItemConverter::GetItemProperty( tWhichIdType nWhichId, tProp ItemPropertyMapType::const_iterator aEndIt; ItemPropertyMapType::const_iterator aIt; - switch( m_eGraphicObjectType ) + switch( m_GraphicObjectType ) { - case LINE_DATA_POINT: + case GraphicObjectType::LineDataPoint: aEndIt = lcl_GetDataPointLinePropertyMap().end(); aIt = lcl_GetDataPointLinePropertyMap().find( nWhichId ); break; - case FILLED_DATA_POINT: + case GraphicObjectType::FilledDataPoint: aEndIt = lcl_GetDataPointFilledPropertyMap().end(); aIt = lcl_GetDataPointFilledPropertyMap().find( nWhichId ); break; - case LINE_PROPERTIES: + case GraphicObjectType::LineProperties: aEndIt = lcl_GetLinePropertyMap().end(); aIt = lcl_GetLinePropertyMap().find( nWhichId ); break; - case FILL_PROPERTIES: - aEndIt = lcl_GetFillPropertyMap().end(); - aIt = lcl_GetFillPropertyMap().find( nWhichId ); - break; - - case LINE_AND_FILL_PROPERTIES: + case GraphicObjectType::LineAndFillProperties: // line aEndIt = lcl_GetLinePropertyMap().end(); aIt = lcl_GetLinePropertyMap().find( nWhichId ); @@ -241,10 +228,10 @@ void GraphicPropertyItemConverter::FillSpecialItem( case XATTR_FILLFLOATTRANSPARENCE: try { - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) ? OUString( "TransparencyGradientName" ) : OUString( "FillTransparenceGradientName" ); @@ -276,10 +263,10 @@ void GraphicPropertyItemConverter::FillSpecialItem( break; case XATTR_GRADIENTSTEPCOUNT: - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) ? OUString( "GradientStepCount" ) : OUString( "FillGradientStepCount" ); @@ -293,36 +280,35 @@ void GraphicPropertyItemConverter::FillSpecialItem( break; case XATTR_LINEDASH: - if( lcl_supportsLineProperties( m_eGraphicObjectType )) - { - OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) - ? OUString( "BorderDashName" ) - : OUString( "LineDashName" ); - - XLineDashItem aItem; - aItem.PutValue( GetPropertySet()->getPropertyValue( aPropName ), MID_NAME ); - - lcl_SetContentForNamedProperty( - m_xNamedPropertyTableFactory, "com.sun.star.drawing.DashTable" , - aItem, MID_LINEDASH ); - - // translate model name to UI-name for predefined entries, so - // that the correct entry is chosen in the list of UI-names - XLineDashItem* pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel ); - - if(pItemToPut) - rOutItemSet.Put( *pItemToPut ); - else - rOutItemSet.Put(aItem); - } + { + OUString aPropName = + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) + ? OUString( "BorderDashName" ) + : OUString( "LineDashName" ); + + XLineDashItem aItem; + aItem.PutValue( GetPropertySet()->getPropertyValue( aPropName ), MID_NAME ); + + lcl_SetContentForNamedProperty( + m_xNamedPropertyTableFactory, "com.sun.star.drawing.DashTable" , + aItem, MID_LINEDASH ); + + // translate model name to UI-name for predefined entries, so + // that the correct entry is chosen in the list of UI-names + XLineDashItem* pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel ); + + if(pItemToPut) + rOutItemSet.Put( *pItemToPut ); + else + rOutItemSet.Put(aItem); + } break; case XATTR_FILLGRADIENT: - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) ? OUString( "GradientName" ) : OUString( "FillGradientName" ); @@ -345,10 +331,10 @@ void GraphicPropertyItemConverter::FillSpecialItem( break; case XATTR_FILLHATCH: - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) ? OUString( "HatchName" ) : OUString( "FillHatchName" ); @@ -371,7 +357,7 @@ void GraphicPropertyItemConverter::FillSpecialItem( break; case XATTR_FILLBITMAP: - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { XFillBitmapItem aItem; aItem.PutValue( GetPropertySet()->getPropertyValue( "FillBitmapName" ), MID_NAME ); @@ -394,29 +380,28 @@ void GraphicPropertyItemConverter::FillSpecialItem( // hack, because QueryValue of XLineTransparenceItem returns sal_Int32 // instead of sal_Int16 case XATTR_LINETRANSPARENCE: - if( lcl_supportsLineProperties( m_eGraphicObjectType )) - { - OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) - ? OUString( "BorderTransparency" ) - : (m_eGraphicObjectType == LINE_DATA_POINT) - ? OUString( "Transparency" ) - : OUString( "LineTransparence" ); + { + OUString aPropName = + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) + ? OUString( "BorderTransparency" ) + : (m_GraphicObjectType == GraphicObjectType::LineDataPoint) + ? OUString( "Transparency" ) + : OUString( "LineTransparence" ); - XLineTransparenceItem aItem; - aItem.PutValue( GetPropertySet()->getPropertyValue( aPropName ), 0 ); + XLineTransparenceItem aItem; + aItem.PutValue( GetPropertySet()->getPropertyValue( aPropName ), 0 ); - rOutItemSet.Put( aItem ); - } - break; + rOutItemSet.Put( aItem ); + } + break; // hack, because QueryValue of XFillTransparenceItem returns sal_Int32 // instead of sal_Int16 case XATTR_FILLTRANSPARENCE: - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) ? OUString( "Transparency" ) : OUString( "FillTransparence" ); @@ -439,7 +424,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( { // bitmap property case XATTR_FILLBMP_STRETCH: - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { const OUString aModePropName("FillBitmapMode"); bool bStretched = static_cast< const XFillBmpStretchItem & >( @@ -457,7 +442,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( break; case XATTR_FILLBMP_TILE: - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { const OUString aModePropName("FillBitmapMode"); bool bTiled = static_cast< const XFillBmpTileItem & >( @@ -477,10 +462,10 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( case XATTR_FILLFLOATTRANSPARENCE: try { - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) ? OUString( "TransparencyGradientName" ) : OUString( "FillTransparenceGradientName" ); @@ -528,10 +513,10 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( case XATTR_GRADIENTSTEPCOUNT: { - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) ? OUString( "GradientStepCount" ) : OUString( "FillGradientStepCount" ); @@ -550,33 +535,29 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( case XATTR_LINEDASH: { - if( lcl_supportsLineProperties( m_eGraphicObjectType )) - { - - OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) - ? OUString( "BorderDashName" ) - : OUString( "LineDashName" ); + OUString aPropName = + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) + ? OUString( "BorderDashName" ) + : OUString( "LineDashName" ); - const XLineDashItem & rItem = - static_cast< const XLineDashItem & >( - rItemSet.Get( nWhichId )); + const XLineDashItem & rItem = + static_cast< const XLineDashItem & >( + rItemSet.Get( nWhichId )); - if( rItem.QueryValue( aValue, MID_NAME )) + if( rItem.QueryValue( aValue, MID_NAME )) + { + if( aValue != GetPropertySet()->getPropertyValue( aPropName )) { - if( aValue != GetPropertySet()->getPropertyValue( aPropName )) - { - // add LineDash to list - uno::Any aLineDash; - rItem.QueryValue( aLineDash, MID_LINEDASH ); - OUString aPreferredName; - aValue >>= aPreferredName; - aValue <<= PropertyHelper::addLineDashUniqueNameToTable( - aLineDash, m_xNamedPropertyTableFactory, aPreferredName ); + // add LineDash to list + uno::Any aLineDash; + rItem.QueryValue( aLineDash, MID_LINEDASH ); + OUString aPreferredName; + aValue >>= aPreferredName; + aValue <<= PropertyHelper::addLineDashUniqueNameToTable( + aLineDash, m_xNamedPropertyTableFactory, aPreferredName ); - GetPropertySet()->setPropertyValue( aPropName, aValue ); - bChanged = true; - } + GetPropertySet()->setPropertyValue( aPropName, aValue ); + bChanged = true; } } } @@ -584,10 +565,10 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( case XATTR_FILLGRADIENT: { - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) ? OUString( "GradientName" ) : OUString( "FillGradientName" ); @@ -617,10 +598,10 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( case XATTR_FILLHATCH: { - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) ? OUString( "HatchName" ) : OUString( "FillHatchName" ); @@ -650,7 +631,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( case XATTR_FILLBITMAP: { - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { const XFillBitmapItem & rItem = static_cast< const XFillBitmapItem & >( @@ -679,49 +660,48 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( // hack, because QueryValue of XLineTransparenceItem returns sal_Int32 // instead of sal_Int16 case XATTR_LINETRANSPARENCE: - if( lcl_supportsLineProperties( m_eGraphicObjectType )) + { + OUString aPropName = + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) + ? OUString( "BorderTransparency" ) + : (m_GraphicObjectType == GraphicObjectType::LineDataPoint) + ? OUString( "Transparency" ) + : OUString( "LineTransparence" ); + + const XLineTransparenceItem & rItem = + static_cast< const XLineTransparenceItem & >( + rItemSet.Get( nWhichId )); + + if( rItem.QueryValue( aValue )) { - OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) - ? OUString( "BorderTransparency" ) - : (m_eGraphicObjectType == LINE_DATA_POINT) - ? OUString( "Transparency" ) - : OUString( "LineTransparence" ); - - const XLineTransparenceItem & rItem = - static_cast< const XLineTransparenceItem & >( - rItemSet.Get( nWhichId )); - - if( rItem.QueryValue( aValue )) + OSL_ENSURE( ! aValue.isExtractableTo( + cppu::UnoType<sal_Int16>::get()), + "TransparenceItem QueryValue bug is fixed. Remove hack." ); + sal_Int32 nValue = 0; + if( aValue >>= nValue ) { - OSL_ENSURE( ! aValue.isExtractableTo( - cppu::UnoType<sal_Int16>::get()), - "TransparenceItem QueryValue bug is fixed. Remove hack." ); - sal_Int32 nValue = 0; - if( aValue >>= nValue ) - { - OSL_ENSURE( nValue < SAL_MAX_INT16, "Transparency value too large" ); - sal_Int16 nValueToSet( static_cast< sal_Int16 >( nValue )); - aValue <<= nValueToSet; + OSL_ENSURE( nValue < SAL_MAX_INT16, "Transparency value too large" ); + sal_Int16 nValueToSet( static_cast< sal_Int16 >( nValue )); + aValue <<= nValueToSet; - GetPropertySet()->setPropertyValue( aPropName, aValue ); - bChanged = true; - } - else - { - OSL_FAIL( "Wrong type in Transparency Any" ); - } + GetPropertySet()->setPropertyValue( aPropName, aValue ); + bChanged = true; + } + else + { + OSL_FAIL( "Wrong type in Transparency Any" ); } } - break; + } + break; // hack, because QueryValue of XFillTransparenceItem returns sal_Int32 // instead of sal_Int16 case XATTR_FILLTRANSPARENCE: - if( lcl_supportsFillProperties( m_eGraphicObjectType )) + if( lcl_supportsFillProperties( m_GraphicObjectType )) { OUString aPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) ? OUString( "Transparency" ) : OUString( "FillTransparence" ); @@ -744,7 +724,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( GetPropertySet()->setPropertyValue( aPropName, aValue ); // if linear or no transparence is set, delete the gradient OUString aTransGradPropName = - (m_eGraphicObjectType == FILLED_DATA_POINT) + (m_GraphicObjectType == GraphicObjectType::FilledDataPoint) ? OUString( "TransparencyGradientName" ) : OUString( "FillTransparenceGradientName" ); GetPropertySet()->setPropertyValue( diff --git a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx index c800a8c42bdd..8d2d25150e48 100644 --- a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx @@ -51,7 +51,7 @@ LegendItemConverter::LegendItemConverter( { m_aConverters.push_back( new GraphicPropertyItemConverter( rPropertySet, rItemPool, rDrawModel, xNamedPropertyContainerFactory, - GraphicPropertyItemConverter::LINE_AND_FILL_PROPERTIES )); + GraphicObjectType::LineAndFillProperties )); m_aConverters.push_back( new CharacterPropertyItemConverter( rPropertySet, rItemPool, pRefSize, "ReferencePageSize" )); diff --git a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx index bb122879ca2a..2f22f13fd01c 100644 --- a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx +++ b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx @@ -83,7 +83,7 @@ AllGridItemConverter::AllGridItemConverter( Reference< beans::XPropertySet > xObjectProperties(aElementList[nA]); m_aConverters.push_back( new ::chart::wrapper::GraphicPropertyItemConverter( xObjectProperties, rItemPool, rDrawModel, xNamedPropertyContainerFactory, - ::chart::wrapper::GraphicPropertyItemConverter::LINE_PROPERTIES ) ); + ::chart::wrapper::GraphicObjectType::LineProperties ) ); } } @@ -120,7 +120,7 @@ AllDataLabelItemConverter::AllDataLabelItemConverter( m_aConverters.push_back( new ::chart::wrapper::DataPointItemConverter( xChartModel, xContext, xObjectProperties, *aIt, rItemPool, rDrawModel, - xNamedPropertyContainerFactory, GraphicPropertyItemConverter::FILLED_DATA_POINT, + xNamedPropertyContainerFactory, GraphicObjectType::FilledDataPoint, nullptr, true, false, 0, true, nNumberFormat, nPercentNumberFormat)); } } diff --git a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx index bf9ff244dc7b..b220caacce93 100644 --- a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx @@ -100,7 +100,7 @@ RegressionCurveItemConverter::RegressionCurveItemConverter( m_spGraphicConverter( new GraphicPropertyItemConverter( rPropertySet, rItemPool, rDrawModel, xNamedPropertyContainerFactory, - GraphicPropertyItemConverter::LINE_PROPERTIES )), + GraphicObjectType::LineProperties )), m_xCurveContainer( xContainer ) {} diff --git a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx index 0f62797e1eeb..bce257b002fd 100644 --- a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx @@ -59,7 +59,7 @@ RegressionEquationItemConverter::RegressionEquationItemConverter( m_aConverters.push_back( new GraphicPropertyItemConverter( rPropertySet, rItemPool, rDrawModel, xNamedPropertyContainerFactory, - GraphicPropertyItemConverter::LINE_AND_FILL_PROPERTIES )); + GraphicObjectType::LineAndFillProperties )); m_aConverters.push_back( new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize")); diff --git a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx index 7a3c8f0c9c85..b158dbd1778b 100644 --- a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx @@ -100,7 +100,7 @@ TitleItemConverter::TitleItemConverter( m_aConverters.push_back( new GraphicPropertyItemConverter( rPropertySet, rItemPool, rDrawModel, xNamedPropertyContainerFactory, - GraphicPropertyItemConverter::LINE_AND_FILL_PROPERTIES )); + GraphicObjectType::LineAndFillProperties )); // CharacterProperties are not at the title but at its contained XFormattedString objects // take the first formatted string in the sequence diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index 7636aa982176..5be1be5c6e44 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -99,7 +99,7 @@ wrapper::ItemConverter* createItemConverter( pItemConverter = new wrapper::GraphicPropertyItemConverter( xObjectProperties, rDrawModel.GetItemPool(), rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ), - wrapper::GraphicPropertyItemConverter::LINE_AND_FILL_PROPERTIES ); + wrapper::GraphicObjectType::LineAndFillProperties ); break; case OBJECTTYPE_TITLE: { @@ -134,7 +134,7 @@ wrapper::ItemConverter* createItemConverter( pItemConverter = new wrapper::GraphicPropertyItemConverter( xObjectProperties, rDrawModel.GetItemPool(), rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ), - wrapper::GraphicPropertyItemConverter::LINE_AND_FILL_PROPERTIES ); + wrapper::GraphicObjectType::LineAndFillProperties ); break; case OBJECTTYPE_AXIS: { @@ -202,8 +202,8 @@ wrapper::ItemConverter* createItemConverter( if (pRefSizeProvider) pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize())); - wrapper::GraphicPropertyItemConverter::eGraphicObjectType eMapTo = - wrapper::GraphicPropertyItemConverter::FILLED_DATA_POINT; + wrapper::GraphicObjectType eMapTo = + wrapper::GraphicObjectType::FilledDataPoint; uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( aObjectCID, xChartModel ); uno::Reference< XChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries ); @@ -211,7 +211,7 @@ wrapper::ItemConverter* createItemConverter( uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) ); sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram ); if( !ChartTypeHelper::isSupportingAreaProperties( xChartType, nDimensionCount ) ) - eMapTo = wrapper::GraphicPropertyItemConverter::LINE_DATA_POINT; + eMapTo = wrapper::GraphicObjectType::LineDataPoint; bool bDataSeries = eObjectType == OBJECTTYPE_DATA_SERIES; @@ -255,7 +255,7 @@ wrapper::ItemConverter* createItemConverter( pItemConverter = new wrapper::GraphicPropertyItemConverter( xObjectProperties, rDrawModel.GetItemPool(), rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ), - wrapper::GraphicPropertyItemConverter::LINE_PROPERTIES ); + wrapper::GraphicObjectType::LineProperties ); break; case OBJECTTYPE_DATA_ERRORS_X: @@ -292,7 +292,7 @@ wrapper::ItemConverter* createItemConverter( pItemConverter = new wrapper::GraphicPropertyItemConverter( xObjectProperties, rDrawModel.GetItemPool(), rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ), - wrapper::GraphicPropertyItemConverter::LINE_AND_FILL_PROPERTIES ); + wrapper::GraphicObjectType::LineAndFillProperties ); break; default: //OBJECTTYPE_UNKNOWN break; @@ -776,7 +776,7 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard( , m_pDrawModelWrapper->getSdrModel().GetItemPool() , m_pDrawModelWrapper->getSdrModel() , uno::Reference< lang::XMultiServiceFactory >( getModel(), uno::UNO_QUERY ) - , wrapper::GraphicPropertyItemConverter::FILLED_DATA_POINT ); + , wrapper::GraphicObjectType::FilledDataPoint ); pSymbolShapeProperties = new SfxItemSet( aSymbolItemConverter.CreateEmptyItemSet() ); aSymbolItemConverter.FillItemSet( *pSymbolShapeProperties ); |