summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-12-22 22:36:56 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-12-22 22:48:37 +0100
commitcf15306ccf49da290b391517e2c5dd22a4f1be45 (patch)
treeabe1f0eeeea438353d2f9c97b19cd4b19063e65a /oox
parentc4d210d264cfe7c8a970a909d2a9d74bb5fff3c1 (diff)
ERROR: Invalid content was found starting with element 'p:pic'.
Again, as pointed out by CppunitTest_sd_export_tests. Sadly it seems that the spec and PowerPoint is not in sync here, so just do what makes both happy. This fixes the --with-export-validation build. Change-Id: I49e22d154d30106f91f1c972012f99a863784d23
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/shapes.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 81b569838fb6..35266360edf1 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1109,7 +1109,8 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape )
mpFS->startElementNS( mnXmlNamespace, XML_oleObj,
XML_name, "Document",
FSNS(XML_r, XML_id), USS( sRelId ),
- XML_spid, OString::number(GetShapeID(xShape)),
+ // The spec says that this is a required attribute, but PowerPoint can only handle an empty value.
+ XML_spid, "",
FSEND );
}
@@ -1117,7 +1118,9 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape )
// pic element
SdrObject* pSdrOLE2( GetSdrObjectFromXShape( xShape ) );
- if ( pSdrOLE2 && pSdrOLE2->ISA( SdrOle2Obj ) )
+ // The spec doesn't allow <p:pic> here, but PowerPoint requires it.
+ bool bEcma = mpFB->getVersion() == oox::core::ECMA_DIALECT;
+ if ( pSdrOLE2 && pSdrOLE2->ISA( SdrOle2Obj ) && bEcma)
{
const Graphic* pGraphic = static_cast<SdrOle2Obj*>(pSdrOLE2)->GetGraphic();
if ( pGraphic )