summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2022-03-31 13:11:04 +0200
committerLászló Németh <nemeth@numbertext.org>2022-04-04 13:01:08 +0200
commitc2e8a96a8107a37901e475c65a8e61211fc3b132 (patch)
treef60ebae15ba1c2e5c9bc74bd7c553c87f2764e6b /sd
parentc84e166de3ba993eb4d1c01d6b0fbe00d5f6572e (diff)
tdf#53970 PPTX: fix broken export of linked media files
Missing TargetMode="External" in the export of linked media files resulted corrupted PPTX. Change-Id: I76246db331d199810a5b413d44bec95283e88e47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132402 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/odp/tdf53970_linked.odpbin0 -> 13158 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx27
2 files changed, 21 insertions, 6 deletions
diff --git a/sd/qa/unit/data/odp/tdf53970_linked.odp b/sd/qa/unit/data/odp/tdf53970_linked.odp
new file mode 100644
index 000000000000..3ddb7933463f
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf53970_linked.odp
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index a620386ad22d..5fac35ea1833 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -1804,15 +1804,30 @@ void SdOOXMLExportTest2::testTdf59323_slideFooters()
void SdOOXMLExportTest2::testTdf53970()
{
- ::sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf53970.odp"), ODP);
- xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+ // Embedded media file
+ {
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf53970.odp"), ODP);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+ // Without fix in place, the media shape was lost on export.
+ CPPUNIT_ASSERT(getPage(0, xDocShRef)->hasElements());
- // Without fix in place, the media shape was lost on export.
- CPPUNIT_ASSERT(getPage(0, xDocShRef)->hasElements());
+ xDocShRef->DoClose();
+ }
- xDocShRef->DoClose();
+ // Linked media file
+ {
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf53970_linked.odp"), ODP);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+ xDocShRef->DoClose();
+
+ xmlDocUniquePtr pXmlRels = parseExport(tempFile, "ppt/slides/_rels/slide1.xml.rels");
+ CPPUNIT_ASSERT(pXmlRels);
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@TargetMode='External']", 2);
+ }
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);