diff options
author | Eike Rathke <erack@redhat.com> | 2018-08-16 18:00:29 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-08-17 08:25:23 +0200 |
commit | a4c9e4539ee82c409add42e68329d4eb1100d62f (patch) | |
tree | 80db4f0e6c3f6ee2644f47598e6a54c9a3075677 /svl | |
parent | 42580b440158d37781feed1623720368a4d1b7e0 (diff) |
Do not convert YMD date order to YDM and vice versa, tdf#107012 follow-up
Change-Id: I6362caae4dd0764a5f99f1b0453c17ecde4b53f1
Reviewed-on: https://gerrit.libreoffice.org/59213
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforscan.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 8ececca57bba..b3589ed7c601 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -2975,7 +2975,11 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) switch (pLoc->getDateOrder()) { case DateOrder::MDY: - if (IsDateFragment( nDayPos, nMonthPos)) + // Convert only if the actual format is not of YDM + // order (which would be a completely unusual order + // anyway, but..), e.g. YYYY.DD.MM not to + // YYYY/MM/DD + if (IsDateFragment( nDayPos, nMonthPos) && !IsDateFragment( nYearPos, nDayPos)) SwapArrayElements( nDayPos, nMonthPos); break; case DateOrder::YMD: @@ -2998,7 +3002,10 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) switch (pLoc->getDateOrder()) { case DateOrder::DMY: - if (IsDateFragment( nMonthPos, nDayPos)) + // Convert only if the actual format is not of YMD + // order, e.g. YYYY/MM/DD not to YYYY.DD.MM + /* TODO: convert such to DD.MM.YYYY instead? */ + if (IsDateFragment( nMonthPos, nDayPos) && !IsDateFragment( nYearPos, nMonthPos)) SwapArrayElements( nMonthPos, nDayPos); break; case DateOrder::YMD: |