summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-12-12 21:13:18 +0100
committerEike Rathke <erack@redhat.com>2017-12-13 12:42:39 +0100
commitc1293b4fa344096b4de6b8648a0409ca5811eccc (patch)
tree8c9940a0dba02a622895d9c5055a2b5d2645fec5
parent4e34b003bc8908e0f9f78e8ed5e84e7a5e42a6ca (diff)
Resolves: tdf#114185 force KeywordLocalization::LocaleLegacy
... in GetPreviewStringGuess() that is used in Calc TEXT() spreadsheet function, if the format code didn't resolve as English or the format code needs to be (re)parsed otherwise as locale dependent. Also SvNumberFormatterServiceObj::convertNumberToPreviewString() (XNumberFormatPreviewer::convertNumberToPreviewString()) if bAllowEnglish==true. Change-Id: I7c4b1a610d2bcb20fe0f0ae06efc81f998cae048 (cherry picked from commit b2cd9dd31183c45942c2f522104654ff1f8e6889) Reviewed-on: https://gerrit.libreoffice.org/46352 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--svl/source/numbers/zforlist.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index a6e7af89562f..f20c83f57c90 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1730,6 +1730,8 @@ bool SvNumberFormatter::GetPreviewStringGuess( const OUString& sFormatString,
pEntry->GetFormatstring() ) )
{
// other Format
+ // Force locale's keywords.
+ pFormatScanner->ChangeIntl( ImpSvNumberformatScan::KeywordLocalization::LocaleLegacy );
sTmpString = sFormatString;
pEntry.reset(new SvNumberformat( sTmpString, pFormatScanner,
pStringScanner, nCheckPos, eLnge ));
@@ -1750,6 +1752,8 @@ bool SvNumberFormatter::GetPreviewStringGuess( const OUString& sFormatString,
pEntry2->GetFormatstring() ) )
{
// other Format
+ // Force locale's keywords.
+ pFormatScanner->ChangeIntl( ImpSvNumberformatScan::KeywordLocalization::LocaleLegacy );
sTmpString = sFormatString;
pEntry.reset(new SvNumberformat( sTmpString, pFormatScanner,
pStringScanner, nCheckPos, eLnge ));