diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2021-06-29 13:33:52 +0300 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2021-06-30 10:09:22 +0200 |
commit | cfec09ebd15a301555a7c3d01bc0ed25aafc2dcc (patch) | |
tree | a9912b1eb63b1b3e05a7ea1d4297afea1df493e9 /oox | |
parent | 815d4bbb75e4124532790ead5c3ef29073aad2b7 (diff) |
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 <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/textfield.cxx | 23 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 4 |
2 files changed, 15 insertions, 12 deletions
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"; |