diff options
author | Eike Rathke <erack@redhat.com> | 2017-12-01 23:50:23 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-12-02 19:23:56 +0100 |
commit | afbd0960f0b8d8b27cc9582279367540cc8aad84 (patch) | |
tree | 82395c22a4ba483223d0fd635fd2f360c6ab1d64 /sw/source/core/fields | |
parent | 923ca4efe2095998e3da75c372cd7d716db9abb3 (diff) |
Get rid of the css::util::NumberFormat::TEXT abuse as "special" "key"
It is a bit, not a key, which demanded special treatment at all
places, and a key with the same value could not be handled at all.
Abusing the css::util::NumberFormat::TEXT flag as number format
key to signal the "special" meaning, having a number format key
equal to that value would had resulted in undesired behaviour.
The bit value is 256 and a key 256 means 156 user defined number
formats in the default locale, rarely in the wild but can happen.
Change-Id: Idfd5b07d524c222df3491d201095ef65ad4a46c9
Reviewed-on: https://gerrit.libreoffice.org/45705
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sw/source/core/fields')
-rw-r--r-- | sw/source/core/fields/cellfml.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index 87d757cd6f69..6582cd77e2de 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -217,11 +217,12 @@ double SwTableBox::GetValue( SwTableCalcPara& rCalcPara ) const SvNumberFormatter* pNumFormatr = pDoc->GetNumberFormatter(); - if( static_cast<sal_uInt32>(css::util::NumberFormat::TEXT) == nFormatIndex ) + const sal_Int16 nFormatType = pNumFormatr->GetType( nFormatIndex ); + if( nFormatType == css::util::NumberFormat::TEXT ) nFormatIndex = 0; // JP 22.04.98: Bug 49659 - special treatment for percentages else if( !sText.isEmpty() && - css::util::NumberFormat::PERCENT == pNumFormatr->GetType( nFormatIndex )) + css::util::NumberFormat::PERCENT == nFormatType) { sal_uInt32 nTmpFormat = 0; if( pDoc->IsNumberFormat( sText, nTmpFormat, aNum ) && |