From 12569802394fb0a9850fcdb0647a0845a803f1ff Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 2 Sep 2016 10:53:14 +0200 Subject: convert GradientStyle to scoped enum Change-Id: Ib740da708612df7a5f4b8c82262b9b1bd436604d --- filter/source/flash/swfwriter1.cxx | 2 +- filter/source/flash/swfwriter2.cxx | 26 +++++++++++++------------- filter/source/msfilter/escherex.cxx | 2 +- filter/source/svg/svgwriter.cxx | 20 ++++++++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) (limited to 'filter') diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index 05058d00c6c4..3db22ad9b8a6 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -316,7 +316,7 @@ void Writer::Impl_writeGradientEx( const tools::PolyPolygon& rPolyPoly, const Gr tools::PolyPolygon aPolyPolygon( rPolyPoly ); map( aPolyPolygon ); - if( (rGradient.GetStyle() == GradientStyle_LINEAR && rGradient.GetAngle() == 900) || (rGradient.GetStyle() == GradientStyle_RADIAL) ) + if( (rGradient.GetStyle() == GradientStyle::Linear && rGradient.GetAngle() == 900) || (rGradient.GetStyle() == GradientStyle::Radial) ) { const Rectangle aBoundRect( aPolyPolygon.GetBoundRect() ); diff --git a/filter/source/flash/swfwriter2.cxx b/filter/source/flash/swfwriter2.cxx index ca6dc1e318be..9c39a2cac3ac 100644 --- a/filter/source/flash/swfwriter2.cxx +++ b/filter/source/flash/swfwriter2.cxx @@ -495,13 +495,13 @@ FillStyle::FillStyleType Impl_getFillStyleType( const Gradient& rGradient ) { switch( rGradient.GetStyle() ) { - case GradientStyle_ELLIPTICAL: - case GradientStyle_RADIAL: + case GradientStyle::Elliptical: + case GradientStyle::Radial: return FillStyle::radial_gradient; -// case GradientStyle_AXIAL: -// case GradientStyle_SQUARE: -// case GradientStyle_RECT: -// case GradientStyle_LINEAR: +// case GradientStyle::Axial: +// case GradientStyle::Square: +// case GradientStyle::Rect: +// case GradientStyle::Linear: default: return FillStyle::linear_gradient; } @@ -555,8 +555,8 @@ void FillStyle::Impl_addGradient( Tag* pTag ) const switch( maGradient.GetStyle() ) { - case GradientStyle_ELLIPTICAL: - case GradientStyle_RADIAL: + case GradientStyle::Elliptical: + case GradientStyle::Radial: { aGradientRecords.push_back( GradRecord( 0x00, maGradient.GetEndColor() ) ); aGradientRecords.push_back( GradRecord( 0xff, maGradient.GetStartColor() ) ); @@ -589,7 +589,7 @@ void FillStyle::Impl_addGradient( Tag* pTag ) const } break; - case GradientStyle_AXIAL: + case GradientStyle::Axial: { aGradientRecords.push_back( GradRecord( 0x00, maGradient.GetEndColor() ) ); aGradientRecords.push_back( GradRecord( 0x80, maGradient.GetStartColor() ) ); @@ -603,9 +603,9 @@ void FillStyle::Impl_addGradient( Tag* pTag ) const m.scale( scalex, scaley ); } break; - case GradientStyle_SQUARE: - case GradientStyle_RECT: - case GradientStyle_LINEAR: + case GradientStyle::Square: + case GradientStyle::Rect: + case GradientStyle::Linear: { aGradientRecords.push_back( GradRecord( 0x00, maGradient.GetStartColor() ) ); aGradientRecords.push_back( GradRecord( 0xff, maGradient.GetEndColor() ) ); @@ -617,7 +617,7 @@ void FillStyle::Impl_addGradient( Tag* pTag ) const m.translate( maBoundRect.GetWidth() / 2.0, maBoundRect.GetHeight() / 2.0 ); } break; - case GradientStyle_FORCE_EQUAL_SIZE: break; + case GradientStyle::FORCE_EQUAL_SIZE: break; } m.translate( maBoundRect.Left(), maBoundRect.Top() ); diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 4bee4c1c9ffb..148b15854302 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -387,7 +387,7 @@ void EscherPropertyContainer::CreateGradientProperties( nFillType = ESCHER_FillShadeScale; nAngle = (rGradient.Angle * 0x10000) / 10; nFillFocus = (sal::static_int_cast(rGradient.Style) == - sal::static_int_cast(GradientStyle_LINEAR)) ? 0 : 50; + sal::static_int_cast(GradientStyle::Linear)) ? 0 : 50; } break; case css::awt::GradientStyle_RADIAL : diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 0aaa3050f436..4e6bb1d71677 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -231,8 +231,8 @@ void SVGAttributeWriter::AddPaintAttr( const Color& rLineColor, const Color& rFi void SVGAttributeWriter::AddGradientDef( const Rectangle& rObjRect, const Gradient& rGradient, OUString& rGradientId ) { if( rObjRect.GetWidth() && rObjRect.GetHeight() && - ( rGradient.GetStyle() == GradientStyle_LINEAR || rGradient.GetStyle() == GradientStyle_AXIAL || - rGradient.GetStyle() == GradientStyle_RADIAL || rGradient.GetStyle() == GradientStyle_ELLIPTICAL ) ) + ( rGradient.GetStyle() == GradientStyle::Linear || rGradient.GetStyle() == GradientStyle::Axial || + rGradient.GetStyle() == GradientStyle::Radial || rGradient.GetStyle() == GradientStyle::Elliptical ) ) { SvXMLElementExport aDesc( mrExport, XML_NAMESPACE_NONE, aXMLElemDefs, true, true ); Color aStartColor( rGradient.GetStartColor() ), aEndColor( rGradient.GetEndColor() ); @@ -260,7 +260,7 @@ void SVGAttributeWriter::AddGradientDef( const Rectangle& rObjRect, const Gradie std::unique_ptr< SvXMLElementExport > apGradient; OUString aColorStr; - if( rGradient.GetStyle() == GradientStyle_LINEAR || rGradient.GetStyle() == GradientStyle_AXIAL ) + if( rGradient.GetStyle() == GradientStyle::Linear || rGradient.GetStyle() == GradientStyle::Axial ) { tools::Polygon aLinePoly( 2 ); @@ -279,9 +279,9 @@ void SVGAttributeWriter::AddGradientDef( const Rectangle& rObjRect, const Gradie // write stop values double fBorder = static_cast< double >( rGradient.GetBorder() ) * - ( ( rGradient.GetStyle() == GradientStyle_AXIAL ) ? 0.005 : 0.01 ); + ( ( rGradient.GetStyle() == GradientStyle::Axial ) ? 0.005 : 0.01 ); - ImplGetColorStr( ( rGradient.GetStyle() == GradientStyle_AXIAL ) ? aEndColor : aStartColor, aColorStr ); + ImplGetColorStr( ( rGradient.GetStyle() == GradientStyle::Axial ) ? aEndColor : aStartColor, aColorStr ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrOffset, OUString::number( fBorder ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStopColor, aColorStr ); @@ -289,7 +289,7 @@ void SVGAttributeWriter::AddGradientDef( const Rectangle& rObjRect, const Gradie SvXMLElementExport aDesc2( mrExport, XML_NAMESPACE_NONE, aXMLElemStop, true, true ); } - if( rGradient.GetStyle() == GradientStyle_AXIAL ) + if( rGradient.GetStyle() == GradientStyle::Axial ) { ImplGetColorStr( aStartColor, aColorStr ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrOffset, OUString::number( 0.5 ) ); @@ -300,7 +300,7 @@ void SVGAttributeWriter::AddGradientDef( const Rectangle& rObjRect, const Gradie } } - if( rGradient.GetStyle() != GradientStyle_AXIAL ) + if( rGradient.GetStyle() != GradientStyle::Axial ) fBorder = 0.0; ImplGetColorStr( aEndColor, aColorStr ); @@ -2247,8 +2247,8 @@ void SVGActionWriter::ImplWritePattern( const tools::PolyPolygon& rPolyPoly, void SVGActionWriter::ImplWriteGradientEx( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient, sal_uInt32 nWriteFlags) { - if ( rGradient.GetStyle() == GradientStyle_LINEAR || - rGradient.GetStyle() == GradientStyle_AXIAL ) + if ( rGradient.GetStyle() == GradientStyle::Linear || + rGradient.GetStyle() == GradientStyle::Axial ) { ImplWriteGradientLinear( rPolyPoly, rGradient ); } @@ -2306,7 +2306,7 @@ void SVGActionWriter::ImplWriteGradientLinear( const tools::PolyPolygon& rPolyPo const Color aEndColor = ImplGetColorWithIntensity( rGradient.GetEndColor(), rGradient.GetEndIntensity() ); double fBorderOffset = rGradient.GetBorder() / 100.0; const sal_uInt16 nSteps = rGradient.GetSteps(); - if( rGradient.GetStyle() == GradientStyle_LINEAR ) + if( rGradient.GetStyle() == GradientStyle::Linear ) { // Emulate non-smooth gradient if( 0 < nSteps && nSteps < 100 ) -- cgit