sw/qa/extras/ooxmlimport/data/tdf126114.docx      |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx          |    7 +++++++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit b0a6aa2a678b5f8e3d1673e4b28d86353563b6ce
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Wed Jun 26 20:04:37 2019 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Thu Jul 4 16:35:10 2019 +0200

    tdf#126114 - Form fields are displayed twice (double)
    
    We need to make sure that IsFieldResultAsString() returns true
    for drop-down field, to ignore the placeholder string.
    
    Reviewed-on: https://gerrit.libreoffice.org/74752
    Tested-by: Jenkins
    Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com>
    (cherry picked from commit 8e5982d799e23bee86404f3ccb3aaed524ae9675)
    
    Change-Id: I127800bdff78eb68e000fdbfe433bc88181ac2c3
    Reviewed-on: https://gerrit.libreoffice.org/74800
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/sw/qa/extras/ooxmlimport/data/tdf126114.docx 
b/sw/qa/extras/ooxmlimport/data/tdf126114.docx
new file mode 100644
index 000000000000..33e0395689c6
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf126114.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index e6f3a150b31f..8e7ecb5527b9 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1620,6 +1620,13 @@ DECLARE_OOXMLIMPORT_TEST(testTdf117843, "tdf117843.docx")
         getProperty<sal_Int32>(getParagraphOfText(1, xHeaderText), 
"ParaTopMargin"));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf126114, "tdf126114.docx")
+{
+    // The problem was that after the drop-down form field, also the 
placeholder string
+    // was imported as text. Beside the duplication of the field, it also 
caused a crash.
+    CPPUNIT_ASSERT_EQUAL(7, getLength());
+}
+
 // tests should only be added to ooxmlIMPORT *if* they fail round-tripping in 
ooxmlEXPORT
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 2d328e299e09..f66ea1686c21 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4501,7 +4501,7 @@ bool DomainMapper_Impl::IsFieldResultAsString()
     OSL_ENSURE( pContext.get(), "no field context available");
     if( pContext.get() )
     {
-        bRet = pContext->GetTextField().is();
+        bRet = pContext->GetTextField().is() || pContext->GetFieldId() == 
FIELD_FORMDROPDOWN;
     }
     return bRet;
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to