sw/qa/extras/ooxmlexport/data/textinput.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 11 +++++++++++ sw/source/filter/ww8/docxexport.cxx | 7 +++++-- 3 files changed, 16 insertions(+), 2 deletions(-)
New commits: commit d179d77b6743ffb7d77bb3671b3e49ee19d76ba3 Author: Ilhan Yesil <ilhanye...@gmx.de> AuthorDate: Thu May 23 17:52:04 2019 +0200 Commit: Thorsten Behrens <thorsten.behr...@cib.de> CommitDate: Fri May 31 00:41:14 2019 +0200 tdf#125103 Writer: input fields will be exported to docx Changed the solution https://gerrit.libreoffice.org/#/c/70786/ of Vasily sligthly, so MS Office can recognize fields still as fields. ooxmlexport13 is not present in the 5.2 branch, so test case is merged into ooxmlexport7. Reviewed-on: https://gerrit.libreoffice.org/72868 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk <vasily.melenc...@cib.de> (cherry picked from commit 62aaaad156ef0daccd2680161ef8b9b99d8a7bc0) Change-Id: Id45330a96dfe002685c6ef3dc62e408c5f9f46c4 Reviewed-on: https://gerrit.libreoffice.org/73079 Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> Tested-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/sw/qa/extras/ooxmlexport/data/textinput.odt b/sw/qa/extras/ooxmlexport/data/textinput.odt new file mode 100644 index 000000000000..04b8d054c354 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/textinput.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx index 4b3f0f1acf03..cfe5dd9c13fe 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -1910,6 +1910,17 @@ DECLARE_OOXMLEXPORT_TEST(testSignatureLineShape, "signature-line-all-props-set.d CPPUNIT_ASSERT_EQUAL(OUString("Check the machines!"), aSigningInstructions); } +DECLARE_OOXMLEXPORT_TEST(testTextInput, "textinput.odt") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + // Ensure we have a formfield + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:instrText", " FILLIN \"\""); + // and it's content is not gone + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:t", "SomeText"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 2abbe899f130..063b76b2e90a 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -365,9 +365,12 @@ void DocxExport::DoComboBox(const OUString& rName, m_pDocumentFS->endElementNS( XML_w, XML_ffData ); } -void DocxExport::DoFormText(const SwInputField* /*pField*/) +void DocxExport::DoFormText(const SwInputField* pField) { - OSL_TRACE( "TODO DocxExport::ForFormText()" ); + + assert(pField); + const OUString sStr = FieldString(ww::eFILLIN) + "\"" + pField->GetPar2() + "\""; + OutputField(pField, ww::eFILLIN, sStr); } OString DocxExport::OutputChart( uno::Reference< frame::XModel >& xModel, sal_Int32 nCount, ::sax_fastparser::FSHelperPtr m_pSerializer ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits