summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapper_Impl.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2022-04-01 21:03:08 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-04-22 13:32:35 +0200
commit58cd67e096ca14123a85f8542c728b07645df705 (patch)
tree0e794bba0b1b6de86d73f433c532610719001ef2 /writerfilter/source/dmapper/DomainMapper_Impl.cxx
parentca1027e7d3a47402a016dba26d12db93b097a856 (diff)
tdf#132475 writerfilter: connect PRINTDATE with DocInfo.PrintDateTime
NOTE: This patch depends on a follow-up patch to handle the case where no date formating instructions are provided. NOTE: The time part might be considered a regression by some since Word displays as local time while LO seems to display GMT time. Although the date was being imported as a generic field, it wasn't associated with the last printed date. PRINTDATE is about the only field that MS Word automatically updates without the user having to press F9 on it, so that shows we should NOT mark it as fixed on import. On the other hand, it doesn't update very often, so if a user hand-modifies the result, then (without marking it as fixed) LO will display differently from MS Word. Hey, its a last-printed-date field I say. Who cares what it looks like on someone else's computer. It only matters if it is accurate and visible on yours. This caused a unit test failure with make CppunitTest_sw_ooxmlfieldexport CPPUNIT_TESt_NAME=testGenericTextField because contents.match(" PRINTDATE ") NOTE: we are losing \* MERGEFORMAT on all of supported fields on export, but that might be OK because we don't do MERGEFORMAT anyway. Change-Id: I7cb79ce7470cd55090a61be63848ce328d48be06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132446 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapper_Impl.cxx')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 2aff26ad5ad4..6206a9386edb 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -5165,6 +5165,7 @@ static const FieldConversionMap_t & lcl_GetFieldConversion()
{"NEXTIF", {"DatabaseNextSet", FIELD_NEXTIF }},
{"PAGE", {"PageNumber", FIELD_PAGE }},
{"PAGEREF", {"GetReference", FIELD_PAGEREF }},
+ {"PRINTDATE", {"DocInfo.PrintDateTime", FIELD_PRINTDATE }},
{"REF", {"GetReference", FIELD_REF }},
{"REVNUM", {"DocInfo.Revision", FIELD_REVNUM }},
{"SAVEDATE", {"DocInfo.Change", FIELD_SAVEDATE }},
@@ -6367,6 +6368,7 @@ void DomainMapper_Impl::CloseFieldCommand()
}
break;
case FIELD_CREATEDATE :
+ case FIELD_PRINTDATE:
{
xFieldProperties->setPropertyValue(
getPropertyName( PROP_IS_DATE ), uno::makeAny( true ));