summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorKatarina Machalkova <kmachalkova@suse.cz>2011-03-08 15:56:53 +0100
committerKatarina Machalkova <kmachalkova@suse.cz>2011-03-08 17:37:08 +0100
commit96dc8d285d5215ad9fac6951741b81c7203ee38d (patch)
tree726acac66fad36caa55e265472ac2103e957472d /svl
parent0177774f9bfa9b460fe3244b0455ef412e3cd147 (diff)
Revert "Introducing new number format ( -N => (N) ) -- bnc#659993"
This reverts commit 97ce42ad29560d39560b7f7c23785142803ae52f. Adding the format to every lang. breaks the std. format indexing (thus, unit test too) Moreover, it is not "legal" for non-English locale (or so LocaleNode.cxx says)
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/zforlist.hxx4
-rw-r--r--svl/inc/svl/zformat.hxx4
-rw-r--r--svl/source/numbers/zforlist.cxx45
-rw-r--r--svl/source/numbers/zformat.cxx17
4 files changed, 7 insertions, 63 deletions
diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx
index a5b516fd8d69..f3f7fdfef1e0 100644
--- a/svl/inc/svl/zforlist.hxx
+++ b/svl/inc/svl/zforlist.hxx
@@ -114,9 +114,7 @@ enum NfIndexTableOffset
NF_NUMBER_1000INT, // #,##0
NF_NUMBER_1000DEC2, // #,##0.00
NF_NUMBER_SYSTEM, // #,##0.00 or whatever is set in System Regional Settings
- NF_NUMBER_NEG_BRACKET, // #,##0_);(#,##0) -42 => (42)
- NF_NUMBER_NEG_BRACKET_DEC2, // #,##0.00_);(#,##0.00) -42.00 => (42.00)
- NF_NUMBER_END = NF_NUMBER_NEG_BRACKET_DEC2,
+ NF_NUMBER_END = NF_NUMBER_SYSTEM,
NF_SCIENTIFIC_START,
NF_SCIENTIFIC_000E000 = NF_SCIENTIFIC_START, // 0.00E+000
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx
index a4222a4757c9..e9790d60f3aa 100644
--- a/svl/inc/svl/zformat.hxx
+++ b/svl/inc/svl/zformat.hxx
@@ -334,10 +334,6 @@ public:
// Whether the negative format is without a sign or not
BOOL IsNegativeWithoutSign() const;
- BOOL IsNegativeInBracket() const;
-
- BOOL HasPositiveBracketPlaceholder() const;
-
// Whether a new SYMBOLTYPE_CURRENCY is contained in the format
BOOL HasNewCurrency() const;
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 64b3c55e2b62..1cdc860f971a 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -2304,15 +2304,6 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, BOOL bLoadingSO
CLOffset + SetIndexTable( NF_NUMBER_SYSTEM, ZF_STANDARD+5 ),
SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
- // #,##0_);(#,##0) -42 => (42)
- nIdx = ImpGetFormatCodeIndex( aFormatSeq, NF_NUMBER_NEG_BRACKET );
- ImpInsertFormat( aFormatSeq[nIdx],
- CLOffset + SetIndexTable( NF_NUMBER_NEG_BRACKET, ZF_STANDARD+6 ));
-
- // #,##0.00_);(#,##0.00) -42.00 => (42.00)
- nIdx = ImpGetFormatCodeIndex( aFormatSeq, NF_NUMBER_NEG_BRACKET_DEC2 );
- ImpInsertFormat( aFormatSeq[nIdx],
- CLOffset + SetIndexTable( NF_NUMBER_NEG_BRACKET_DEC2, ZF_STANDARD+7 ));
// Percent number
aFormatSeq = aNumberFormatCode.getAllFormatCode( i18n::KNumberFormatUsage::PERCENT_NUMBER );
@@ -2753,10 +2744,6 @@ void SvNumberFormatter::GenerateFormat(String& sString,
utl::DigitGroupingIterator aGrouping( xLocaleData->getDigitGrouping());
const xub_StrLen nDigitsInFirstGroup = static_cast<xub_StrLen>(aGrouping.get());
const String& rThSep = GetNumThousandSep();
-
- SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nIndex);
- BOOL insertBrackets = pFormat->IsNegativeInBracket();
-
if (nAnzLeading == 0)
{
if (!bThousand)
@@ -2849,35 +2836,15 @@ void SvNumberFormatter::GenerateFormat(String& sString,
sString += ';';
sString += sNegStr;
}
- if ( (IsRed || insertBrackets ) && eType != NUMBERFORMAT_CURRENCY)
+ if (IsRed && eType != NUMBERFORMAT_CURRENCY)
{
String sTmpStr = sString;
-
- if ( pFormat->HasPositiveBracketPlaceholder() )
- {
- sTmpStr += '_';
- sTmpStr += ')';
- }
sTmpStr += ';';
-
- if (IsRed)
- {
- sTmpStr += '[';
- sTmpStr += pFormatScanner->GetRedString();
- sTmpStr += ']';
- }
-
- if (insertBrackets)
- {
- sTmpStr += '(';
- sTmpStr += sString;
- sTmpStr += ')';
- }
- else
- {
- sTmpStr += '-';
- sTmpStr +=sString;
- }
+ sTmpStr += '[';
+ sTmpStr += pFormatScanner->GetRedString();
+ sTmpStr += ']';
+ sTmpStr += '-';
+ sTmpStr +=sString;
sString = sTmpStr;
}
}
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index d0dc56bf7534..48a6dcfd0e24 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -4114,23 +4114,6 @@ BOOL SvNumberformat::IsNegativeWithoutSign() const
return FALSE;
}
-BOOL SvNumberformat::IsNegativeInBracket() const
-{
- USHORT nAnz = NumFor[1].GetCount();
- if (!nAnz)
- return FALSE;
-
- String *tmpStr = NumFor[1].Info().sStrArray;
- return (tmpStr[0] == '(' && tmpStr[nAnz-1] == ')' );
-}
-
-BOOL SvNumberformat::HasPositiveBracketPlaceholder() const
-{
- USHORT nAnz = NumFor[0].GetCount();
- String *tmpStr = NumFor[0].Info().sStrArray;
- return (tmpStr[nAnz-1].EqualsAscii( "_)" ));
-}
-
DateFormat SvNumberformat::GetDateOrder() const
{
if ( (eType & NUMBERFORMAT_DATE) == NUMBERFORMAT_DATE )