sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 4 ++-- sw/source/filter/ww8/docxattributeoutput.cxx | 2 -- writerfilter/source/dmapper/DomainMapper.cxx | 22 ++++++---------------- 3 files changed, 8 insertions(+), 20 deletions(-)
New commits: commit 8ff609067a3d2e712ec000d95084caa38a89dd2b Author: Tamás Zolnai <[email protected]> AuthorDate: Mon Jul 1 12:20:45 2019 +0200 Commit: Andras Timar <[email protected]> CommitDate: Sun Jul 14 00:19:04 2019 +0200 MSForms: DOCX filter: handle export of empty date from control * It's converted to date content control which is imported as text-based date control. * By now, we don't need to set a dummy text for empty date. Reviewed-on: https://gerrit.libreoffice.org/75458 Reviewed-by: Tamás Zolnai <[email protected]> Tested-by: Tamás Zolnai <[email protected]> (cherry picked from commit 6fd9987ae650bb2f0dd40aec95662a75c9a85598) Change-Id: I29b2a72e3ae2722c1d765c4fcb9bd13052619372 Reviewed-on: https://gerrit.libreoffice.org/75551 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Andras Timar <[email protected]> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 501302417305..3c58ae0076c3 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -5074,8 +5074,6 @@ void DocxAttributeOutput::WritePostponedFormControl(const SdrObject* pObject) else { aContentText = xPropertySet->getPropertyValue("HelpText").get<OUString>(); - if(aContentText.isEmpty()) - aContentText = " "; // Need to write out something to have it imported by MS Word if(sDateFormat.isEmpty()) sDateFormat = "dd/MM/yyyy"; // Need to set date format even if there is no date set } commit dc0a4c443377782e2b012c3526f46452a8b43341 Author: Tamás Zolnai <[email protected]> AuthorDate: Wed Jul 3 19:57:19 2019 +0200 Commit: Andras Timar <[email protected]> CommitDate: Sun Jul 14 00:18:50 2019 +0200 MSForms: DOCX filter: The new text-based date field is allowed in the header. Reviewed-on: https://gerrit.libreoffice.org/75457 Reviewed-by: Tamás Zolnai <[email protected]> Tested-by: Tamás Zolnai <[email protected]> (cherry picked from commit a50d82eca96d04b4cea1ea2c7b3610bf9ed951f0) Change-Id: I71d61c702ccd0470c4c3df09531704783c1b3e01 Reviewed-on: https://gerrit.libreoffice.org/75550 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Andras Timar <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index d997c8b13435..458c91652873 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -630,13 +630,13 @@ DECLARE_OOXMLEXPORT_TEST(testfdo82492, "fdo82492.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent/w:r",1); } -/*DECLARE_OOXMLEXPORT_TEST(testSdtHeader, "sdt-header.docx") +DECLARE_OOXMLEXPORT_TEST(testSdtHeader, "sdt-header.docx") { // Problem was that w:sdt elements in headers were lost on import. if (xmlDocPtr pXmlDoc = parseExport("word/header1.xml")) // This was 0, w:sdt (and then w:date) was missing. assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date", 1); -}*/ +} DECLARE_OOXMLEXPORT_TEST(testSdtCompanyMultipara, "sdt-company-multipara.docx") { diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index ae345de6e0fb..1c4498d393b5 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1039,7 +1039,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: @@ -2572,30 +2572,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: @@ -3350,13 +3340,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->getDateFormat().isEmpty() && !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; } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
