[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sw/qa sw/source

Vasily Melenchuk (via logerrit) logerrit at kemper.freedesktop.org
Sun Apr 28 22:55:47 UTC 2019


 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 14e9b3a75ca870379a1702ee4e721b5c9e2c5544
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Mon Apr 15 17:22:04 2019 +0300
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Mon Apr 29 00:55:07 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 <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit b01a4437c42b3cd8484c7d7c16a2d09190c1ee97)
    Reviewed-on: https://gerrit.libreoffice.org/71402
    Tested-by: Jenkins

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 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 )


More information about the Libreoffice-commits mailing list