From cfec09ebd15a301555a7c3d01bc0ed25aafc2dcc Mon Sep 17 00:00:00 2001 From: Sarper Akdemir Date: Tue, 29 Jun 2021 13:33:52 +0300 Subject: tdf#59323 tdf#142221: fix pptx datetime import export format fixed some problems from the original implementation of pptx datetime field formatting (2b0669eec0d86e973a7d8def8744c522bbf8af8b) also the comments on tests seemed to be based on en-IN which seems to differ a lot for SvxDateFormat::StdBig. So converted them to en-US's StdBig. expanded the tests, so it covers previously poorly imported types. Also made them use the SvxDateFormat and SvxTimeFormat Change-Id: I675c482d3095b5373975abb2e6e7eca2d353243d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118104 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky --- oox/source/drawingml/textfield.cxx | 23 ++++++++++++----------- oox/source/export/drawingml.cxx | 4 +++- 2 files changed, 15 insertions(+), 12 deletions(-) (limited to 'oox') diff --git a/oox/source/drawingml/textfield.cxx b/oox/source/drawingml/textfield.cxx index d3fb06f94fc8..a8e058603f7a 100644 --- a/oox/source/drawingml/textfield.cxx +++ b/oox/source/drawingml/textfield.cxx @@ -220,21 +220,22 @@ SvxDateFormat TextField::getLODateFormat(std::u16string_view rDateTimeType) switch( nDateTimeNum ) { case 1: // Date dd/mm/yyyy - case 2: // Date Day, Month dd, yyyy - case 5: // Date dd-Mon-yy - case 6: // Date Month yy - case 7: // Date Mon-yy case 8: // DateTime dd/mm/yyyy H:MM PM case 9: // DateTime dd/mm/yyyy H:MM:SS PM return SvxDateFormat::B; - case 3: // Date dd Month yyyy + case 2: // Date Day, Month dd, yyyy return SvxDateFormat::StdBig; - case 4: // Date Month dd, yyyy - return SvxDateFormat::StdSmall; - case 10: // Time H:MM - case 11: // Time H:MM:SS - case 12: // Time H:MM PM - case 13: // Time H:MM:SS PM + case 3: // Date dd Month yyyy + case 4: // Date Month dd, yyyy - no exact map + case 6: // Date Month yy - no exact map + return SvxDateFormat::D; + case 5: // Date dd-Mon-yy - no exact map + case 7: // Date Mon-yy - no exact map + return SvxDateFormat::C; + case 10: // Time H:MM - not a date format + case 11: // Time H:MM:SS - not a date format + case 12: // Time H:MM PM - not a date format + case 13: // Time H:MM:SS PM - not a date format default: return SvxDateFormat::AppDefault; } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 87898bb7d9d2..dacfe516585c 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2193,11 +2193,13 @@ OUString DrawingML::GetDatetimeTypeFromDateTime(SvxDateFormat eDate, SvxTimeForm case SvxDateFormat::B: aDateField = "datetime1"; // 13/02/1996 break; - case SvxDateFormat::StdBig: case SvxDateFormat::C: + aDateField = "datetime5"; + break; case SvxDateFormat::D: aDateField = "datetime3"; // 13 February 1996 break; + case SvxDateFormat::StdBig: case SvxDateFormat::E: case SvxDateFormat::F: aDateField = "datetime2"; -- cgit v1.2.3