Kaydet (Commit) 4076b758 authored tarafından Mark Hung's avatar Mark Hung

tdf#123557 PPTX: Export timenode condition targets.

Refactor the code and reuse WriteAnimationTarget to export
the target element for the condition element in stCondLst
and endCondLst.

Add testTdf123557 to make sure import-export-import works.

As SdOOXMLExportTest2::testTdf90627 no longer produce corupt
pptx that has endCondLst without Cond element, make the
xpath more specific about what is testing.

Update schema because drawooo:enhanced-path incluced in the
test case.

Change-Id: If5d64f5c23aa2652cfa72471f9f7886c7dd956eb
Reviewed-on: https://gerrit.libreoffice.org/68211
Tested-by: Jenkins
Reviewed-by: 's avatarMark Hung <marklh9@gmail.com>
üst a3ed62e2
......@@ -2266,6 +2266,11 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
<rng:ref name="string"/>
</rng:attribute>
</rng:optional>
<rng:optional>
<rng:attribute name="drawooo:enhanced-path">
<rng:ref name="string"/>
</rng:attribute>
</rng:optional>
</rng:define>
<!-- TODO no proposal -->
......
......@@ -1764,8 +1764,8 @@ void SdOOXMLExportTest2::testTdf90627()
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
// Don't export empty conditions
assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst[1]/p:seq/p:cTn/p:childTnLst[1]/p:par[2]/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:endCondLst", 0);
// Don't export empty endCondLst without cond.
assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst[1]/p:seq/p:cTn/p:childTnLst[1]/p:par[2]/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:endCondLst[not(*)]", 0);
xDocShRef->DoClose();
}
......
......@@ -103,6 +103,7 @@ public:
void testBulletsAsImage();
void testTdf113818();
void testTdf119629();
void testTdf123557();
void testTdf113822();
CPPUNIT_TEST_SUITE(SdExportTest);
......@@ -132,6 +133,7 @@ public:
CPPUNIT_TEST(testBulletsAsImage);
CPPUNIT_TEST(testTdf113818);
CPPUNIT_TEST(testTdf119629);
CPPUNIT_TEST(testTdf123557);
CPPUNIT_TEST(testTdf113822);
CPPUNIT_TEST_SUITE_END();
......@@ -153,6 +155,7 @@ public:
{ "text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0" },
{ "xlink", "http://www.w3c.org/1999/xlink" },
{ "loext", "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" },
{ "smil", "urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" },
// user-defined
{ "foo", "http://example.com/" },
};
......@@ -1160,6 +1163,27 @@ void SdExportTest::testTdf119629()
xDocShRef->DoClose();
}
void SdExportTest::testTdf123557()
{
utl::TempFile tempFile;
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/trigger.pptx"), PPTX);
xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
xmlDocPtr pXmlDoc = parseExport(tempFile, "content.xml");
// Contians 2 interactive sequence and 3 triggered effects.
assertXPath(pXmlDoc, "//draw:page", 1);
assertXPath(pXmlDoc, "//draw:page/anim:par", 1);
assertXPath(pXmlDoc, "//draw:page"
"/anim:par[@presentation:node-type='timing-root']"
"/anim:seq[@presentation:node-type='interactive-sequence']", 2);
assertXPath(pXmlDoc, "//draw:page"
"/anim:par[@presentation:node-type='timing-root']"
"/anim:seq[@presentation:node-type='interactive-sequence']"
"/anim:par[@smil:begin]",3);
xDocShRef->DoClose();
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment