diff options
author | Justin Luth <justin_luth@sil.org> | 2022-04-22 19:46:16 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-04-29 12:25:01 +0200 |
commit | f56f8be65b26cb3c8e83af05f10ba9f717ff76b2 (patch) | |
tree | cae7683669d89a73981c8c7b7fc09755673ef5df /writerfilter/source | |
parent | 1de6d6c539ec49a9cbeba9ab4c11fe8b6b5f14e7 (diff) |
tdf#126636 writerfilter: import USERNAME field as fixed
This depends on and mimics some of the fixes for tdf#148380.
Microsoft Word doesn't immediately/automatically update field contents
like LO does. Instead, the user needs to press F9 on each field.
So, these USERNAME or USERINITIALS fields just show the
when-last-updated text that was saved in the document
instead of the actual current value of the field.
Although LO doesn't have that ability, we can flag them as FIXED
and achieve a very similar result. Doing so fixes this bug report
which might be quite common since USERNAME might be mistaken
for AUTHOR or LASTSAVEDBY by the user - since in practice
they tend to be the same thing.
We already did this for AUTHOR (which is extremely safe since
that can never change). I almost hate to do it with this one
because even this bug shows it is too often a case of mis-use,
but that is the way it is, and this seems to be the best solution.
Change-Id: I48dc6d45992aff740023e80f619b56ad01231782
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133346
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 2d956b5ab09c..b59b9eac066f 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -5547,7 +5547,7 @@ void DomainMapper_Impl::handleAutoNum } void DomainMapper_Impl::handleAuthor - (std::u16string_view rFirstParam, + (std::u16string_view, uno::Reference< beans::XPropertySet > const& xFieldProperties, FieldId eFieldId ) { @@ -5555,7 +5555,9 @@ void DomainMapper_Impl::handleAuthor xFieldProperties->setPropertyValue ( getPropertyName(PROP_FULL_NAME), uno::makeAny( true )); - if (!rFirstParam.empty() || eFieldId == FIELD_AUTHOR) + // Always set as FIXED b/c MS Word only updates these fields via user intervention (F9) + // AUTHOR of course never changes and USERNAME is easily mis-used as an original author field. + // Additionally, this was forced as fixed if any special case-formatting was provided. { xFieldProperties->setPropertyValue( getPropertyName( PROP_IS_FIXED ), |