sw/source/filter/ww8/rtfattributeoutput.cxx | 2 ++ sw/source/filter/ww8/ww8atr.cxx | 7 +++++++ 2 files changed, 9 insertions(+)
New commits: commit dafdcb748a54a5e41bcb61f67355e06265bf98ff Author: Justin Luth <justin_l...@sil.org> AuthorDate: Tue Apr 13 11:25:56 2021 +0200 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Tue Apr 13 19:42:07 2021 +0200 tdf#100961 doc/rtf export: save FIXEDFLD as fldlock This fixes the 5.0 regression by commit a072b3533f44730565f42b45cfd9f77f44f506a9 fdo#59886 export fixed date and time fields to docx. which fixed it for DOCX, but broke it (a plain text dump) for DOC and RTF formats. We still can't READ fixed fields properly, (there is no impact/regression on import at all) but this at least works for MS Word, and gets us setup for properly importing. Change-Id: I8835fce06233a52f1433f02879196234f1355280 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114061 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_l...@sil.org> diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 6c37ce00be0d..37f50a9e6a89 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1679,6 +1679,8 @@ void RtfAttributeOutput::WriteField_Impl(const SwField* const pField, ww::eField if (bHasInstructions) { m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_FIELD); + if (pField && (pField->GetSubType() & FIXEDFLD)) + m_aRunText->append(OOO_STRING_SVTOOLS_RTF_FLDLOCK); m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST " "); m_aRunText->append( diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index de65515cbf17..5d120613e4d5 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -1916,6 +1916,13 @@ void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType, if (nSubType == REF_SEQUENCEFLD) aField15[0] |= (0x4 << 5); } + // This ought to apply to any field, but just to be safe, start off with DATE/TIME only. + if (pField->GetTyp()->Which() == SwFieldIds::DateTime + && (pField->GetSubType() & FIXEDFLD)) + { + //bit 5 - Locked: do not recalculate field + aField15[1] |= 0x10; + } } pFieldP->Append( Fc2Cp( Strm().Tell() ), aField15 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits