diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-02-12 02:39:15 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-02-12 02:40:06 +0100 |
commit | f38a223d6d455b07a4fdbfe842b2b367306544d5 (patch) | |
tree | 0edc4eb8cff4f01a430039acd262861dc2865f43 /oox | |
parent | a5f0344b410e2fbf1e80b18fa6d5094f44cc06bc (diff) |
small stylistic changes
Change-Id: I31cbdc8e09474252205edb837bfd1a8a7299b52b
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/chartexport.cxx | 9 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 75 |
2 files changed, 42 insertions, 42 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 4d8d931a4541..939e5a489a1b 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1163,10 +1163,11 @@ void ChartExport::exportFill( Reference< XPropertySet > xPropSet ) xPropSet->getPropertyValue( "FillStyle" ) >>= aFillStyle; switch( aFillStyle ) { - case FillStyle_GRADIENT : - exportGradientFill( xPropSet ); - default: - WriteFill( xPropSet ); + case FillStyle_GRADIENT : + exportGradientFill( xPropSet ); + break; + default: + WriteFill( xPropSet ); } } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 1584356fc767..ee3f9b140999 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -338,6 +338,7 @@ void DrawingML::WriteGradientFill( Reference< XPropertySet > rXPropSet ) aGrabBag[i].Value >>= aOriginalGradient; } + mpFS->startElementNS( XML_a, XML_gradFill, FSEND ); // check if an ooxml gradient had been imported and if the user has modified it if( aGradientStops.hasElements() && EqualGradients( aOriginalGradient, aGradient ) ) { @@ -345,11 +346,11 @@ void DrawingML::WriteGradientFill( Reference< XPropertySet > rXPropSet ) } else WriteGradientFill(aGradient); + mpFS->endElementNS( XML_a, XML_gradFill ); } } void DrawingML::WriteGrabBagGradientFill( Sequence< PropertyValue > aGradientStops, awt::Gradient rGradient ) { - mpFS->startElementNS( XML_a, XML_gradFill, FSEND ); // write back the original gradient mpFS->startElementNS( XML_a, XML_gsLst, FSEND ); @@ -396,50 +397,48 @@ void DrawingML::WriteGrabBagGradientFill( Sequence< PropertyValue > aGradientSto mpFS->singleElementNS( XML_a, XML_lin, XML_ang, I32S( ( ( ( 3600 - rGradient.Angle + 900 ) * 6000 ) % 21600000 ) ), FSEND ); - mpFS->endElementNS( XML_a, XML_gradFill ); } void DrawingML::WriteGradientFill( awt::Gradient rGradient ) { - mpFS->startElementNS( XML_a, XML_gradFill, FSEND ); switch( rGradient.Style ) { - default: - case GradientStyle_LINEAR: - mpFS->startElementNS( XML_a, XML_gsLst, FSEND ); - WriteGradientStop( 0, ColorWithIntensity( rGradient.StartColor, rGradient.StartIntensity ) ); - WriteGradientStop( 100, ColorWithIntensity( rGradient.EndColor, rGradient.EndIntensity ) ); - mpFS->endElementNS( XML_a, XML_gsLst ); - mpFS->singleElementNS( XML_a, XML_lin, - XML_ang, I32S( ( ( ( 3600 - rGradient.Angle + 900 ) * 6000 ) % 21600000 ) ), - FSEND ); - break; + default: + case GradientStyle_LINEAR: + mpFS->startElementNS( XML_a, XML_gsLst, FSEND ); + WriteGradientStop( 0, ColorWithIntensity( rGradient.StartColor, rGradient.StartIntensity ) ); + WriteGradientStop( 100, ColorWithIntensity( rGradient.EndColor, rGradient.EndIntensity ) ); + mpFS->endElementNS( XML_a, XML_gsLst ); + mpFS->singleElementNS( XML_a, XML_lin, + XML_ang, I32S( ( ( ( 3600 - rGradient.Angle + 900 ) * 6000 ) % 21600000 ) ), + FSEND ); + break; - case GradientStyle_AXIAL: - mpFS->startElementNS( XML_a, XML_gsLst, FSEND ); - WriteGradientStop( 0, ColorWithIntensity( rGradient.EndColor, rGradient.EndIntensity ) ); - WriteGradientStop( 50, ColorWithIntensity( rGradient.StartColor, rGradient.StartIntensity ) ); - WriteGradientStop( 100, ColorWithIntensity( rGradient.EndColor, rGradient.EndIntensity ) ); - mpFS->endElementNS( XML_a, XML_gsLst ); - mpFS->singleElementNS( XML_a, XML_lin, - XML_ang, I32S( ( ( ( 3600 - rGradient.Angle + 900 ) * 6000 ) % 21600000 ) ), - FSEND ); - break; + case GradientStyle_AXIAL: + mpFS->startElementNS( XML_a, XML_gsLst, FSEND ); + WriteGradientStop( 0, ColorWithIntensity( rGradient.EndColor, rGradient.EndIntensity ) ); + WriteGradientStop( 50, ColorWithIntensity( rGradient.StartColor, rGradient.StartIntensity ) ); + WriteGradientStop( 100, ColorWithIntensity( rGradient.EndColor, rGradient.EndIntensity ) ); + mpFS->endElementNS( XML_a, XML_gsLst ); + mpFS->singleElementNS( XML_a, XML_lin, + XML_ang, I32S( ( ( ( 3600 - rGradient.Angle + 900 ) * 6000 ) % 21600000 ) ), + FSEND ); + break; - /* I don't see how to apply transformation to gradients, so - * elliptical will end as radial and square as - * rectangular. also position offsets are not applied */ - case GradientStyle_RADIAL: - case GradientStyle_ELLIPTICAL: - case GradientStyle_RECT: - case GradientStyle_SQUARE: - mpFS->startElementNS( XML_a, XML_gsLst, FSEND ); - WriteGradientStop( 0, ColorWithIntensity( rGradient.EndColor, rGradient.EndIntensity ) ); - WriteGradientStop( 100, ColorWithIntensity( rGradient.StartColor, rGradient.StartIntensity ) ); - mpFS->endElementNS( XML_a, XML_gsLst ); - mpFS->singleElementNS( XML_a, XML_path, - XML_path, ( rGradient.Style == awt::GradientStyle_RADIAL || rGradient.Style == awt::GradientStyle_ELLIPTICAL ) ? "circle" : "rect", - FSEND ); - break; + /* I don't see how to apply transformation to gradients, so + * elliptical will end as radial and square as + * rectangular. also position offsets are not applied */ + case GradientStyle_RADIAL: + case GradientStyle_ELLIPTICAL: + case GradientStyle_RECT: + case GradientStyle_SQUARE: + mpFS->startElementNS( XML_a, XML_gsLst, FSEND ); + WriteGradientStop( 0, ColorWithIntensity( rGradient.EndColor, rGradient.EndIntensity ) ); + WriteGradientStop( 100, ColorWithIntensity( rGradient.StartColor, rGradient.StartIntensity ) ); + mpFS->endElementNS( XML_a, XML_gsLst ); + mpFS->singleElementNS( XML_a, XML_path, + XML_path, ( rGradient.Style == awt::GradientStyle_RADIAL || rGradient.Style == awt::GradientStyle_ELLIPTICAL ) ? "circle" : "rect", + FSEND ); + break; } mpFS->endElementNS( XML_a, XML_gradFill ); } |