summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-08-08 18:17:43 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-08-08 18:40:24 +0200
commitea258e380eb87db2eb468ba5354df9f957b7660f (patch)
treebb96343b27376312cce62beb1c7c29ce9d3c79d6 /sw/qa
parent3f02b29b6573a637592f096c2d2659534b1683ab (diff)
DOCX export: handle date SDT on paragraphs
Date SDT's are normally imported as form controls, while most other SDT types are just custom properties on regular text portions or paragraphs. However, given that form controls are not supported in headers/footers, in that case even date SDT's are just custom properties. So support such properties on paragraphs in the exporter to properly roundtrip date SDT's in headers/footers. Change-Id: I19eb73a3673e387a7b8780756ce7426a1851e796
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/sdt-header.docxbin0 -> 18551 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx8
2 files changed, 8 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/sdt-header.docx b/sw/qa/extras/ooxmlexport/data/sdt-header.docx
new file mode 100644
index 000000000000..6a4bdfb2d059
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/sdt-header.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 4c44216a17a7..be347b5134b1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -600,6 +600,14 @@ DECLARE_OOXMLEXPORT_TEST(testfdo81946, "fdo81946.docx")
assertXPath(pXmlDoc, "/w:hdr[1]/w:p[1]/w:sdt[1]/w:sdtContent[1]/w:r[2]/mc:AlternateContent[1]",0);
}
+DECLARE_OOXMLEXPORT_TEST(testSdtHeader, "sdt-header.docx")
+{
+ // Problem was that w:sdt elements in headers were lost on import.
+ if (xmlDocPtr pXmlDoc = parseExport("word/header1.xml"))
+ // This was 0, w:sdt (and then w:date) was missing.
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date", 1);
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();