sw/qa/extras/ooxmlexport/data/textinput.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 12 ++++++++++++ sw/source/filter/ww8/docxexport.cxx | 6 ++++-- 3 files changed, 16 insertions(+), 2 deletions(-)
New commits: commit b01a4437c42b3cd8484c7d7c16a2d09190c1ee97 Author: Vasily Melenchuk <[email protected]> AuthorDate: Mon Apr 15 17:22:04 2019 +0300 Commit: Thorsten Behrens <[email protected]> CommitDate: Sat Apr 27 00:49:23 2019 +0200 docx export: implement text-input field export It is expected that <text:text-input> will be converted to {FORMTEXT} MS field, but practical implementation was missing. Change-Id: Ifd17a523e253555a240f853bea5f21572d90d853 Reviewed-on: https://gerrit.libreoffice.org/70786 Reviewed-by: Thorsten Behrens <[email protected]> Tested-by: Thorsten Behrens <[email protected]> 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/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 578d1ac06bd7..c3aacdcc6b42 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -228,6 +228,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119201, "tdf119201.docx") CPPUNIT_ASSERT_MESSAGE("Third shape should be printable.", getProperty<bool>(xShape, "Printable")); } +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", " FORMTEXT "); + // 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 3b9e677e7219..27f721b9b53e 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -375,9 +375,11 @@ 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) { - SAL_INFO("sw.ww8", "TODO DocxExport::ForFormText()" ); + assert(pField); + const OUString sStr = FieldString(ww::eFORMTEXT); + OutputField(pField, ww::eFORMTEXT, sStr); } OString DocxExport::OutputChart( uno::Reference< frame::XModel > const & xModel, sal_Int32 nCount, ::sax_fastparser::FSHelperPtr const & m_pSerializer ) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
