summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2019-04-15 17:22:04 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-04-29 00:55:07 +0200
commit14e9b3a75ca870379a1702ee4e721b5c9e2c5544 (patch)
treec3bb7ff037ecf0e91f15bbc3f7fdd5a04d970e60
parent8b92cd8ff345d86e5b1cfee09e221826d135afc4 (diff)
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 <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit b01a4437c42b3cd8484c7d7c16a2d09190c1ee97) Reviewed-on: https://gerrit.libreoffice.org/71402 Tested-by: Jenkins
-rw-r--r--sw/qa/extras/ooxmlexport/data/textinput.odtbin0 -> 10085 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx12
-rw-r--r--sw/source/filter/ww8/docxexport.cxx6
3 files changed, 16 insertions, 2 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/textinput.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 9c470e61811b..b8e6324b97ce 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -70,6 +70,18 @@ DECLARE_OOXMLEXPORT_TEST(testFrameSizeExport, "floating-tables-anchor.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tblPr/w:tblW", "w", "4000");
}
+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 a3329d536265..9fb4ce076fce 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -382,9 +382,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 )