summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-09-01 11:11:38 +0800
committerMark Hung <marklh9@gmail.com>2018-09-07 13:11:41 +0200
commit612db6877a73e6f9b142b81697291f02c0adb95f (patch)
tree6f2d79aacd1483c230a7146bddd303dadf15e50f /sd/qa
parentc3c43c7966e0f4c7a3b76361559d29c9335487d9 (diff)
tdf#99213: don't export invalid child nodes.
Create NodeContext for all child nodes at beginning and check if they are valid, either it has a valid target or it contains valid nodes, so that we only export valid node later. Change-Id: I660d99011eb57ddc79f727455fce0be8876e8b17 Reviewed-on: https://gerrit.libreoffice.org/59892 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/data/odp/tdf99213-target-missing.odpbin0 -> 11088 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx15
2 files changed, 15 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/tdf99213-target-missing.odp b/sd/qa/unit/data/odp/tdf99213-target-missing.odp
new file mode 100644
index 000000000000..3bc8c7260c8c
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf99213-target-missing.odp
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 6920531af778..fa994f219d6a 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -193,6 +193,7 @@ public:
void testTdf116350TextEffects();
void testTdf118825();
void testTdf119118();
+ void testTdf99213();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -269,6 +270,7 @@ public:
CPPUNIT_TEST(testTdf116350TextEffects);
CPPUNIT_TEST(testTdf118825);
CPPUNIT_TEST(testTdf119118);
+ CPPUNIT_TEST(testTdf99213);
CPPUNIT_TEST_SUITE_END();
@@ -1987,6 +1989,19 @@ void SdOOXMLExportTest2::testTdf119118()
xDocShRef->DoClose();
}
+void SdOOXMLExportTest2::testTdf99213()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc( "sd/qa/unit/data/odp/tdf99213-target-missing.odp" ), ODP);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+ xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+ // Number of nodes with p:attrNameLst was 3, including one that missed tgtEl
+ assertXPath(pXmlDocContent, "//p:attrNameLst", 2);
+ // Timenode that miss its target element should be filtered.
+ assertXPath(pXmlDocContent, "//p:attrNameLst/preceding-sibling::p:tgtEl", 2);
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();