summaryrefslogtreecommitdiffstats
path: root/oox
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 /oox
parentuse const reference for OUString (diff)
downloadcore-c816729beb6ad79fedf3566dbfccdc17f4dc1584.tar.gz
core-c816729beb6ad79fedf3566dbfccdc17f4dc1584.zip
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
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx11
-rw-r--r--oox/source/export/shapes.cxx3
2 files changed, 12 insertions, 2 deletions
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 );