diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-07-03 14:43:54 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-07-12 06:11:25 +0200 |
commit | 9c2feb75a6104d4376cccb157244dd7f6e88968a (patch) | |
tree | dfdcf540750ae743911bcee59156e13bcdea51fc /sw | |
parent | 9e007eb2b0ab44b436da9d00559150cc4fa37dc5 (diff) |
MSForms: DOCX filter: handle date formats with quotation marks.
Change-Id: I61cc6d47200acdd55f147b4f1829330dec8562a0
Reviewed-on: https://gerrit.libreoffice.org/75454
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index c6a3d05312fc..8d1d58986ddb 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -662,7 +662,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableCurruption, "tableCurrupt.docx") CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), aHeaderBottomBorder.LineWidth); } -/*DECLARE_OOXMLEXPORT_TEST(testDateControl, "date-control.docx") +DECLARE_OOXMLEXPORT_TEST(testDateControl, "date-control.docx") { // check XML xmlDocPtr pXmlDoc = parseExport("word/document.xml"); @@ -672,7 +672,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableCurruption, "tableCurrupt.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:dateFormat", "val", "dddd, dd' de 'MMMM' de 'yyyy"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:lid", "val", "es-ES"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", u"mi\u00E9rcoles, 05 de marzo de 2014"); -}*/ +} DECLARE_OOXMLEXPORT_TEST(test_OpeningBrace, "2120112713_OpenBrace.docx") { diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 82c5c30896ea..68d2e120bf5b 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1891,8 +1891,11 @@ void DocxAttributeOutput::WriteFormDate(const OUString& sCurrentDate, const OUSt else m_pSerializer->startElementNS(XML_w, XML_date); + OString sUTF8DateFormat = sDateFormat.toUtf8(); + // Replace quotation mark used for marking static strings in date format + sUTF8DateFormat = sUTF8DateFormat.replaceAll("\"", "'"); m_pSerializer->singleElementNS(XML_w, XML_dateFormat, - FSNS(XML_w, XML_val), sDateFormat.toUtf8()); + FSNS(XML_w, XML_val), sUTF8DateFormat); m_pSerializer->singleElementNS(XML_w, XML_lid, FSNS(XML_w, XML_val), sLang.toUtf8()); m_pSerializer->singleElementNS(XML_w, XML_storeMappedDataAs, |