diff options
author | Justin Luth <justin_luth@sil.org> | 2022-04-05 15:02:27 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-04-26 08:33:16 +0200 |
commit | 4529690cf65f621554f3c829c04b579bd11989c9 (patch) | |
tree | 4891d72aebb9b7021288bc016802b8b4f50f8593 /sw/source/filter/ww8/ww8par5.cxx | |
parent | 7f5d7a3cbe4a71a44a273c9599df1a5094b2fc5a (diff) |
tdf#132475 sw ms: import/export DI_CHANGE as field
and (only) the AUTHOR portion as FIXED for DOC/DOCX/RTF.
The SAVEDATE import was failing as a field because of exception
writerfilter/source/dmapper/DomainMapper_Impl.cxx:6950:
Exception in CloseFieldCommand() com.sun.star.lang.ServiceNotRegisteredException
message: "unknown service: com.sun.star.text.TextField.DocInfo.Change
at /persistent/git/libreoffice2/svx/source/unodraw/unomod.cxx:191"
In terms of marking the field FIXED:
MS Word doesn't update the save date while the document is being edited
(although a user could force an update via F9)
but it does update the field at FILEOPEN!
So, since it updates the date on FILEOPEN, it makes perfect sense
to treat this as a normal SAVEDATE field in LO - not fixed at all.
At opening time, it will ignore the last-displayed-text
and load the values from the field just like Word.
The difference will be that it updates the field immediately
after a while-editing-save, but that's fine, because when Word opens
the same file, that is what it will see.
However, curiously enough, MS Word does NOT update the LASTSAVEBY user,
and thus the modified author can be set as FIXED,
with the normal caveat that a LO user won't be able to update
the field (except by deleting and re-creating it).
Change-Id: I5640432708cf3eebb6a60eaa500fdf0b8f3a6e1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133209
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source/filter/ww8/ww8par5.cxx')
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 1029e98fabe7..e6ec2353e9c3 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -1710,10 +1710,12 @@ eF_ResT SwWW8ImplReader::Read_F_DocInfo( WW8FieldDesc* pF, OUString& rStr ) nSub = DI_COMMENT; break; case 20: - nSub = DI_CHANGE; + // MS Word never updates this automatically, so mark as fixed for best compatibility + nSub = DI_CHANGE | DI_SUB_FIXED; nReg = DI_SUB_AUTHOR; break; case 21: + // The real create date can never change, so mark as fixed for best compatibility nSub = DI_CREATE | DI_SUB_FIXED; nReg = DI_SUB_DATE; bDateTime = true; |