summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-07-03 19:57:19 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-07-12 07:04:49 +0200
commita50d82eca96d04b4cea1ea2c7b3610bf9ed951f0 (patch)
tree454935599bacfa62f8cfa98a0a4873475a63daab /writerfilter
parent695da4b0e6c7bf1c9f99f2886b2c261ff9b557f0 (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>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx22
1 files changed, 6 insertions, 16 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index e1493a31fcb3..f7822eebff09 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1019,7 +1019,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:
@@ -2435,30 +2435,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:
@@ -3227,13 +3217,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;
}