From 35545d3dd29086014484bf5dea902a2e9acb8cb3 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 16 Sep 2014 16:59:18 +0200 Subject: DOCX import: handle w:sdt around w:r followed by a field Change-Id: Ic0cf71efc8d57a98e7cff050ce68a0c4303ca6b1 --- sw/qa/extras/ooxmlexport/data/sdt-before-field.docx | Bin 0 -> 12995 bytes sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 9 +++++++++ 2 files changed, 9 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/sdt-before-field.docx (limited to 'sw') diff --git a/sw/qa/extras/ooxmlexport/data/sdt-before-field.docx b/sw/qa/extras/ooxmlexport/data/sdt-before-field.docx new file mode 100644 index 000000000000..a83a76885c29 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/sdt-before-field.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 3eec094dbf30..923a82ffc969 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -599,6 +599,15 @@ DECLARE_OOXMLEXPORT_TEST(testfdo82123, "fdo82123.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:p/w:sdt[1]/w:sdtContent/w:r",1); } +DECLARE_OOXMLEXPORT_TEST(testSdtBeforeField, "sdt-before-field.docx") +{ + if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + { + // Make sure the field doesn't sneak inside the SDT: the SDT should contain only a single run (there were 6 ones). + assertXPath(pXmlDoc, "//w:sdt/w:sdtContent/w:r", 1); + } +} + DECLARE_OOXMLEXPORT_TEST(testfdo81946, "fdo81946.docx") { xmlDocPtr pXmlDoc = parseExport("word/header1.xml"); -- cgit