summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-09-16 16:59:18 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-09-16 18:02:05 +0200
commit35545d3dd29086014484bf5dea902a2e9acb8cb3 (patch)
tree6c3ff569db9478f6fd111714b9020cf882dd650b /sw
parent851b5a973e04c0c9dda585dbe5ef290b78cc3951 (diff)
DOCX import: handle w:sdt around w:r followed by a field
Change-Id: Ic0cf71efc8d57a98e7cff050ce68a0c4303ca6b1
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/sdt-before-field.docxbin0 -> 12995 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx9
2 files changed, 9 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/sdt-before-field.docx
Binary files 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");