[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/qa writerfilter/source

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Sat Jun 29 16:48:59 UTC 2019


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

New commits:
commit 4c39f95c344f2bc2ded2d72bbbf1ac2a935cdd84
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Jun 26 20:04:37 2019 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Sat Jun 29 18:48:12 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.
    
    Change-Id: I127800bdff78eb68e000fdbfe433bc88181ac2c3
    Reviewed-on: https://gerrit.libreoffice.org/74752
    Tested-by: Jenkins
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit 8e5982d799e23bee86404f3ccb3aaed524ae9675)
    Reviewed-on: https://gerrit.libreoffice.org/74802
    Tested-by: Tamás Zolnai <tamas.zolnai at 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/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index e5c6e182a02e..b5e2841d5344 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -367,6 +367,13 @@ DECLARE_OOXMLIMPORT_TEST(testTdf124670, "tdf124670.docx")
         paragraph->getString());
 }
 
+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 5d2272cdc5bc..eb529ea8d00a 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4904,7 +4904,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;
 }


More information about the Libreoffice-commits mailing list