summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx5
-rw-r--r--oox/source/export/drawingml.cxx16
2 files changed, 16 insertions, 5 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index b3020107a9ff..9066d44fac31 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -853,7 +853,10 @@ Reference< XShape > Shape::createAndInsert(
PUT_PROP( aGradientStops, i, OUString::number( i ), aGradientStop );
++aIt;
}
- putPropertyToGrabBag( "GradFillDefinition", Any( aGradientStops ) );
+ // If getFillProperties.moFillType is unused that means gradient is defined by a theme
+ // which is already saved into StyleFillRef property, so no need to save the explicit values too
+ if( getFillProperties().moFillType.has() )
+ putPropertyToGrabBag( "GradFillDefinition", Any( aGradientStops ) );
putPropertyToGrabBag( "OriginalGradFill", Any( aShapeProps[PROP_FillGradient] ) );
}
}
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8ff54aa0fe27..e019ed68fbac 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -339,15 +339,23 @@ 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 ) )
+ if( EqualGradients( aOriginalGradient, aGradient ) )
{
- WriteGrabBagGradientFill(aGradientStops, aGradient);
+ // If we have no gradient stops that means original gradient were defined by a theme.
+ if( aGradientStops.hasElements() )
+ {
+ mpFS->startElementNS( XML_a, XML_gradFill, FSEND );
+ WriteGrabBagGradientFill(aGradientStops, aGradient);
+ mpFS->endElementNS( XML_a, XML_gradFill );
+ }
}
else
+ {
+ mpFS->startElementNS( XML_a, XML_gradFill, FSEND );
WriteGradientFill(aGradient);
- mpFS->endElementNS( XML_a, XML_gradFill );
+ mpFS->endElementNS( XML_a, XML_gradFill );
+ }
}
}