[Libreoffice-commits] core.git: 2 commits - sw/qa sw/source writerfilter/source
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jul 12 04:12:59 UTC 2019
sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 4 ++--
sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 8 ++++----
sw/source/filter/ww8/docxattributeoutput.cxx | 5 ++++-
writerfilter/source/dmapper/SdtHelper.cxx | 5 ++++-
4 files changed, 14 insertions(+), 8 deletions(-)
New commits:
commit 6c256a1235f1a2ac3536d152edc8c3bee9b15022
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Jul 3 19:21:35 2019 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Jul 12 06:11:47 2019 +0200
MSForms: DOCX filter: reenable passing test
Change-Id: I566a65fa4ece6500128ceeb497c01f1c6e38470c
Reviewed-on: https://gerrit.libreoffice.org/75455
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 2d717f106b54..0ab2ee04f42c 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -527,21 +527,21 @@ DECLARE_OOXMLEXPORT_TEST(testN780563, "n780563.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount( ));
}
-/*DECLARE_OOXMLEXPORT_TEST(testN780853, "n780853.docx")
-{*/
+DECLARE_OOXMLEXPORT_TEST(testN780853, "n780853.docx")
+{
/*
* The problem was that the table was not imported.
*
* xray ThisComponent.TextTables.Count 'was 0
*/
- /*uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
//tdf#102619 - I would have expected this to be "Standard", but MSO 2013/2010/2003 all give FollowStyle==Date
uno::Reference< beans::XPropertySet > properties(getStyles("ParagraphStyles")->getByName("Date"), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("Date"), getProperty<OUString>(properties, "FollowStyle"));
-}*/
+}
DECLARE_OOXMLEXPORT_TEST(testN780843, "n780843.docx")
{
commit 9c2feb75a6104d4376cccb157244dd7f6e88968a
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Jul 3 14:43:54 2019 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Jul 12 06:11:25 2019 +0200
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 at collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
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,
diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx
index c55ceaec0d65..5ba2126bc808 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -122,7 +122,10 @@ void SdtHelper::createDateContentControl()
uno::Reference<container::XNameContainer> xNameCont = xFormField->getParameters();
if(xNameCont.is())
{
- xNameCont->insertByName(ODF_FORMDATE_DATEFORMAT, uno::makeAny(m_sDateFormat.makeStringAndClear()));
+ OUString sDateFormat = m_sDateFormat.makeStringAndClear();
+ // Replace quotation mark used for marking static strings in date format
+ sDateFormat = sDateFormat.replaceAll("'", "\"");
+ xNameCont->insertByName(ODF_FORMDATE_DATEFORMAT, uno::makeAny(sDateFormat));
xNameCont->insertByName(ODF_FORMDATE_DATEFORMAT_LANGUAGE, uno::makeAny(m_sLocale.makeStringAndClear()));
OUString sDate = m_sDate.makeStringAndClear();
if(!sDate.isEmpty())
More information about the Libreoffice-commits
mailing list