Kaydet (Commit) a4c9e453 authored tarafından Eike Rathke's avatar Eike Rathke

Do not convert YMD date order to YDM and vice versa, tdf#107012 follow-up

Change-Id: I6362caae4dd0764a5f99f1b0453c17ecde4b53f1
Reviewed-on: https://gerrit.libreoffice.org/59213Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: Jenkins
üst 42580b44
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment