summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2021-04-13 11:25:56 +0200
committerJustin Luth <justin_luth@sil.org>2021-04-13 19:42:07 +0200
commitdafdcb748a54a5e41bcb61f67355e06265bf98ff (patch)
treedde6d8b0063ff4afe81a6b9a6231d295b6305134 /sw
parent6c217cb062853989929ca2a6b7ee29cf68808f6b (diff)
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_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx7
2 files changed, 9 insertions, 0 deletions
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 );