diff options
author | Eike Rathke <erack@redhat.com> | 2018-08-16 15:50:02 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-17 17:17:52 +0200 |
commit | 04e12e17cd7a9b7e740299560e8e3e0ba2822ca3 (patch) | |
tree | 181053326518f09be2b26d5e4eb11c182defde9b /basic | |
parent | 2b52e332b7d6cd18cb024295c1218517cf6d27d9 (diff) |
Resolves: tdf#119013 do not over-aggressively reorder date particles
In particular not when reading documents as we don't know what the
original (default/system) locale was when the date format was
created and stored and whether the format's date order actually
matched the locale's ordering.
Regression from
commit 51478cefaa4e265b42e3f67eda0a64767ff3efba
CommitDate: Tue Apr 18 17:01:27 2017 +0200
Resolves: tdf#107012 follow date order of the target locale
Change-Id: I9d3bdbd512d95ed81ff6459e368a2d7497ec8a2d
Reviewed-on: https://gerrit.libreoffice.org/59182
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 5b8007afdb97d416ee7c22bf9226e927d61e9bd3)
Reviewed-on: https://gerrit.libreoffice.org/59215
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/runtime.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxdate.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxscan.cxx | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 9f242dab4ba8..42e97c704a26 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -438,12 +438,12 @@ std::shared_ptr<SvNumberFormatter> SbiInstance::PrepareNumberFormatter( sal_uInt } OUString aStr( aDateStr ); // PutandConvertEntry() modifies string! pNumberFormatter->PutandConvertEntry( aStr, nCheckPos, nType, - rnStdDateIdx, LANGUAGE_ENGLISH_US, eLangType ); + rnStdDateIdx, LANGUAGE_ENGLISH_US, eLangType, true); nCheckPos = 0; aDateStr += " HH:MM:SS"; aStr = aDateStr; pNumberFormatter->PutandConvertEntry( aStr, nCheckPos, nType, - rnStdDateTimeIdx, LANGUAGE_ENGLISH_US, eLangType ); + rnStdDateTimeIdx, LANGUAGE_ENGLISH_US, eLangType, true); return pNumberFormatter; } diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx index abf30c202e7d..1880ba40df78 100644 --- a/basic/source/sbx/sbxdate.cxx +++ b/basic/source/sbx/sbxdate.cxx @@ -142,7 +142,7 @@ double ImpGetDate( const SbxValues* p ) OUString aStr = aDateStr + " HH:MM:SS"; pFormatter->PutandConvertEntry( aStr, nCheckPos, nType, - nIndex, LANGUAGE_ENGLISH_US, eLangType ); + nIndex, LANGUAGE_ENGLISH_US, eLangType, true); bool bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes ); if ( bSuccess ) { @@ -337,7 +337,7 @@ start: nType, nIndex, LANGUAGE_ENGLISH_US, - eLangType ); + eLangType, true); pFormatter->GetOutputString( n, nIndex, *p->pOUString, &pColor ); #endif break; diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index 7f9b4931ea48..49f632ff1a57 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -719,7 +719,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const else { aFmtStr = OUString::createFromAscii(pInfo->mpOOoFormat); - pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType ); + pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType, true); } pFormatter->GetOutputString( nNumber, nIndex, rRes, &pCol ); } @@ -736,7 +736,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const if( floor( nNumber ) != nNumber ) { aFmtStr = "H:MM:SS AM/PM"; - pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType ); + pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType, true); OUString aTime; pFormatter->GetOutputString( nNumber, nIndex, aTime, &pCol ); rRes += " " + aTime; @@ -746,7 +746,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const { // long time only aFmtStr = "H:MM:SS AM/PM"; - pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType ); + pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType, true); pFormatter->GetOutputString( nNumber, nIndex, rRes, &pCol ); } } @@ -782,7 +782,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const } else { - pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType ); + pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType, true); pFormatter->GetOutputString( nNumber, nIndex, rRes, &pCol ); } |