diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-07-03 19:57:19 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-07-17 11:40:00 +0200 |
commit | 23a3e50c9ce9f95bda484d31426b3a0a1b249d4a (patch) | |
tree | 5d3de7a06008d37c28bafbf89dea087a36e3b85c /writerfilter | |
parent | b89d19565bdc14316f4efeeb0ce6ce3194112de1 (diff) |
MSForms: DOCX filter: The new text-based date field is allowed in the header.
Change-Id: I71d61c702ccd0470c4c3df09531704783c1b3e01
Reviewed-on: https://gerrit.libreoffice.org/75457
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit a50d82eca96d04b4cea1ea2c7b3610bf9ed951f0)
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 2687a35f32eb..b542d43bc2c0 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1018,7 +1018,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) if (!m_pImpl->m_pSdtHelper->getDropDownItems().empty()) m_pImpl->m_pSdtHelper->createDropDownControl(); - else if (m_pImpl->m_pSdtHelper->validateDateFormat() && !IsInHeaderFooter()) + else if (m_pImpl->m_pSdtHelper->validateDateFormat()) m_pImpl->m_pSdtHelper->createDateContentControl(); break; case NS_ooxml::LN_CT_SdtListItem_displayText: @@ -2412,30 +2412,20 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) break; case NS_ooxml::LN_CT_SdtDate_dateFormat: { - if (!IsInHeaderFooter()) - m_pImpl->m_pSdtHelper->getDateFormat().append(sStringValue); - else - m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "ooxml:CT_SdtDate_dateFormat", sStringValue); + m_pImpl->m_pSdtHelper->getDateFormat().append(sStringValue); } break; case NS_ooxml::LN_CT_SdtDate_storeMappedDataAs: { - if (IsInHeaderFooter()) - m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "ooxml:CT_SdtDate_storeMappedDataAs", sStringValue); } break; case NS_ooxml::LN_CT_SdtDate_calendar: { - if (IsInHeaderFooter()) - m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "ooxml:CT_SdtDate_calendar", sStringValue); } break; case NS_ooxml::LN_CT_SdtDate_lid: { - if (!IsInHeaderFooter()) - m_pImpl->m_pSdtHelper->getLocale().append(sStringValue); - else - m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "ooxml:CT_SdtDate_lid", sStringValue); + m_pImpl->m_pSdtHelper->getLocale().append(sStringValue); } break; case NS_ooxml::LN_CT_SdtPr_dataBinding: @@ -3191,13 +3181,13 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) return; } } - // Form controls are not allowed in headers / footers; see sw::DocumentContentOperationsManager::InsertDrawObj() - else if (m_pImpl->m_pSdtHelper->validateDateFormat() && !IsInHeaderFooter()) + else if (m_pImpl->m_pSdtHelper->validateDateFormat()) { // Date field will be imported, so we don't need the corresponding date text in most of the cases // however when fullDate is not specified, but we have a date string we need to import it as // simple text (this is the case when user sets date field manually in MSO). - if(!m_pImpl->m_pSdtHelper->getDate().toString().isEmpty() || sText.isEmpty()) + if((!m_pImpl->m_pSdtHelper->getDate().toString().isEmpty() || sText.isEmpty()) && + (!IsInHeaderFooter() || !m_pImpl->IsDiscardHeaderFooter())) // discard date control with header / footer { return; } |