summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-02-26 07:05:42 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-02-26 07:37:28 +0100
commitc816729beb6ad79fedf3566dbfccdc17f4dc1584 (patch)
treeddf134b1d4bf485969782d85be8d8f8615e5fece
parent3ca2069f0dc829e2a0fd9594e351c9fee6b3413a (diff)
fix OOXML validation error for text shapes, related fdo#31551
blipFill and other fill elements are not allowed to appear together. See EG_FillProperties in the OOXML spec. See fdo31551-2.ods Change-Id: If5869ab9dc69815938c1f4c6fb180b0c1652ddcc
-rw-r--r--include/oox/export/drawingml.hxx3
-rw-r--r--oox/source/export/drawingml.cxx11
-rw-r--r--oox/source/export/shapes.cxx3
3 files changed, 15 insertions, 2 deletions
diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
index 758f9bfa58a3..cf2de85e2ad5 100644
--- a/include/oox/export/drawingml.hxx
+++ b/include/oox/export/drawingml.hxx
@@ -135,6 +135,9 @@ public:
void WriteGradientFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
void WriteGradientFill( ::com::sun::star::awt::Gradient rGradient );
void WriteGrabBagGradientFill( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aGradientStops, ::com::sun::star::awt::Gradient rGradient);
+
+ void WriteBlipOrNormalFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
+ const OUString& rURLPropName );
void WriteBlipFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
const OUString& sBitmapURL, sal_Int32 nXmlNamespace,
bool bWriteMode, bool bRelPathToMedia = false );
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 3e5b9f0afcdd..cd67e57b0c56 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -847,6 +847,17 @@ void DrawingML::WriteBlipMode( Reference< XPropertySet > rXPropSet, const OUStri
}
}
+void DrawingML::WriteBlipOrNormalFill( Reference< XPropertySet > xPropSet, const OUString& rURLPropName )
+{
+ // check for blip and otherwise fall back to normal fill
+ // we always store normal fill properties but OOXML
+ // uses a choice between our fill props and BlipFill
+ if (GetProperty ( xPropSet, rURLPropName ))
+ WriteBlipFill( xPropSet, rURLPropName );
+ else
+ WriteFill(xPropSet);
+}
+
void DrawingML::WriteBlipFill( Reference< XPropertySet > rXPropSet, const OUString& sURLPropName )
{
WriteBlipFill( rXPropSet, sURLPropName, XML_a );
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index b62f8a35ec93..2a8fe7ee432d 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -943,8 +943,7 @@ ShapeExport& ShapeExport::WriteTextShape( Reference< XShape > xShape )
WriteShapeTransformation( xShape, XML_a,0,0,false);
WritePresetShape( "rect" );
uno::Reference<beans::XPropertySet> xPropertySet(xShape, UNO_QUERY);
- WriteFill(xPropertySet);
- WriteBlipFill(xPropertySet, "GraphicURL");
+ WriteBlipOrNormalFill(xPropertySet, "GraphicURL");
WriteOutline(xPropertySet);
pFS->endElementNS( mnXmlNamespace, XML_spPr );