tdf#148380 writerfilter: Import AUTHOR as FIXEDFLD

This patch depends on patches for tdf#147861
and will require a follow-up export patch that handles exporting
this FIXEDFLD (instead of just dumping the name of the field).

This was being imported as plain text because of exception
writerfilter/source/dmapper/DomainMapper_Impl.cxx:6950:
Exception in CloseFieldCommand() com.sun.star.beans.UnknownPropertyException
message: "Unknown property: FullName at
/persistent/git/libreoffice2/sw/source/core/unocore/unofield.cxx:2156"

Additionally, similar to tdf#134592, the create author will always
be constant, so mark that as fixed. (This helps because in MS Word,
the user can modify the field contents to be anything he wants,
and it is only updated when F9 is pressed on the selected field.
Thus, we might NOT want to show the real DocInfo.CreateAuthor
as the unit test demonstrates.)

Change-Id: Ie014c273d491fa5bbd9b9ecedc69702d0ae8d60c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132661
Tested-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf148380_createField.docx b/sw/qa/extras/ooxmlexport/data/tdf148380_createField.docx
new file mode 100644
index 0000000..c31ed72
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf148380_createField.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index 00f54a1..77caab6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -67,6 +67,21 @@ DECLARE_OOXMLEXPORT_TEST(testTdf147861_customField, "tdf147861_customField.docx"
    CPPUNIT_ASSERT_EQUAL(OUString("DocInformation:Title (fixed)"), xField->getPresentation(true));
}

DECLARE_OOXMLEXPORT_TEST(testTdf148380_createField, "tdf148380_createField.docx")
{
    // Verify that these are fields, and not just plain text
    uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
    auto xFieldsAccess(xTextFieldsSupplier->getTextFields());
    uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
    if (mbExported)
        return;
    uno::Reference<text::XTextField> xField(xFields->nextElement(), uno::UNO_QUERY);
    // This should NOT be "Lorenzo Chavez", or a real date since the user hand-modified the result.
    CPPUNIT_ASSERT_EQUAL(OUString("Myself - that's who"), xField->getPresentation(false));
    xField.set(xFields->nextElement(), uno::UNO_QUERY);
    CPPUNIT_ASSERT_EQUAL(OUString("yesterday at noon"), xField->getPresentation(false));
}

CPPUNIT_TEST_FIXTURE(Test, testTdf135906)
{
    loadAndReload("tdf135906.docx");
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 5975494..311a0ff 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -5451,11 +5451,11 @@ void DomainMapper_Impl::handleAuthor
     uno::Reference< beans::XPropertySet > const& xFieldProperties,
     FieldId  eFieldId )
{
    if ( eFieldId != FIELD_USERINITIALS )
    if (eFieldId == FIELD_USERNAME)
        xFieldProperties->setPropertyValue
            ( getPropertyName(PROP_FULL_NAME), uno::makeAny( true ));

    if (!rFirstParam.empty())
    if (!rFirstParam.empty() || eFieldId == FIELD_AUTHOR)
    {
        xFieldProperties->setPropertyValue(
                getPropertyName( PROP_IS_FIXED ),