oox/source/export/shapes.cxx | 5 ++++- sw/qa/extras/ooxmlexport/data/tdf155903.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-)
New commits: commit 4b323aebda7fcafbcb3e37101f0b0dc882fb824b Author: Tünde Tóth <toth.tu...@nisz.hu> AuthorDate: Mon Jun 26 15:01:26 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Jun 30 13:34:02 2023 +0200 tdf155903 DOCX export: fix corrupt file with embedded media Regression from commit bc72514f90d90e1ab3fed8167663e835edf03508 "tdf#53970 PPTX: fix export of embedded media files". Change-Id: I04521227346817d91f720b1f6a77beb7f4a01f83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153619 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> Tested-by: Jenkins Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153793 diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index b93dd01b69fb..0fc6eb337513 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1272,7 +1272,10 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape xShapeProps->getPropertyValue("Graphic") >>= xGraphic; } - bool bHasMediaURL = xShapeProps.is() && xShapeProps->getPropertySetInfo()->hasPropertyByName("MediaURL") && (xShapeProps->getPropertyValue("MediaURL") >>= sMediaURL); + // tdf#155903 Only for PPTX, Microsoft does not support this feature in Word and Excel. + bool bHasMediaURL = GetDocumentType() == DOCUMENT_PPTX && xShapeProps.is() + && xShapeProps->getPropertySetInfo()->hasPropertyByName("MediaURL") + && (xShapeProps->getPropertyValue("MediaURL") >>= sMediaURL); if (!xGraphic.is() && !bHasMediaURL) { diff --git a/sw/qa/extras/ooxmlexport/data/tdf155903.odt b/sw/qa/extras/ooxmlexport/data/tdf155903.odt new file mode 100644 index 000000000000..97ba58d892dd Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf155903.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index fbb87915369e..c8dca64723a1 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -850,6 +850,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135786, "tdf135786.docx") CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); } +DECLARE_OOXMLEXPORT_TEST(testTdf155903, "tdf155903.odt") +{ + // Without the accompanying fix in place, this test would have crashed, + // because the exported file was corrupted. +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */