diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2022-12-13 11:08:52 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2022-12-19 11:47:09 +0000 |
commit | 907da02bf8b33c080538731864225b3c44251328 (patch) | |
tree | 5e55d727c2e5b4649a7eeab25851093c8333d4e7 /oox | |
parent | 6249858a8972aef077e0249bd93cfe8f01bce4d6 (diff) |
tdf#152436 PPTX export regression: fix lost shape at missing object
If the object is missing, it's still possible to keep its shape
by exporting its preview graphic, as before the regression.
Regression from commit adc042f95d3dbd65b778260025d59283146916e5
"tdf#124333 PPTX import: fix Z-order of embedded OLE objects".
Change-Id: Ib2fd00f53a80572cfc9acaefea55015780c57da8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144040
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/shapes.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 125ea39e2970..137c69fe7c33 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -2538,6 +2538,16 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape ) if (!xObj.is()) { SAL_WARN("oox.shape", "ShapeExport::WriteOLE2Shape: no object"); + + // tdf#152436 Export the preview graphic of the object if the object is missing. + SdrObject* pSdrOLE2(SdrObject::getSdrObjectFromXShape(xShape)); + if (auto pOle2Obj = dynamic_cast<SdrOle2Obj*>(pSdrOLE2)) + { + const Graphic* pGraphic = pOle2Obj->GetGraphic(); + if (pGraphic) + WriteGraphicObjectShapePart(xShape, pGraphic); + } + return *this; } |