summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-03-01 09:19:41 +0100
committerMichael Stahl <mstahl@redhat.com>2016-03-24 12:45:20 +0000
commit90b9a99cb242ebb5e8372372457f6c74d17bc409 (patch)
treea25c666e9157af9e8d3c6fe99d7aa4eb54a3daf3 /writerfilter
parent7a973748f8080117bac908edb385de1c9c5e8179 (diff)
tdf#96326 RTF import: handle checkbox form field undefined result
The RTF spec is quite terse on how the form filed result should be interpreted, but the binary equivalent documents properly that checkboxes have 3 valid states: 0, 1 and 25, the later meaning undefined. Use the default value in that case. (cherry picked from commit 829596eb36de32bd87b426d9ad11901eabeae7be) Change-Id: I672bf8d1f63d7880227b7fa7b5c81f91e1877b2a Reviewed-on: https://gerrit.libreoffice.org/23299 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 25b7ae6001ce..36cb970d79af 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -4458,7 +4458,8 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFDDList_default, pIntValue);
break;
case RTF_FFRES:
- if (m_nFormFieldType == RTFFormFieldType::CHECKBOX)
+ // 25 means undefined, see [MS-DOC] 2.9.79, FFDataBits.
+ if (m_nFormFieldType == RTFFormFieldType::CHECKBOX && nParam != 25)
m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFCheckBox_checked, pIntValue);
else if (m_nFormFieldType == RTFFormFieldType::LIST)
m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFDDList_result, pIntValue);