Kaydet (Commit) 5c6dd7a8 authored tarafından Wang Lei's avatar Wang Lei Kaydeden (comit) Eike Rathke

i#119964 - Number displays different from MS with the same format code

Patch by: Zhang Lu
Review by: Wang Lei
Conflicts:
	svl/source/numbers/zformat.cxx

Change-Id: Id1ce742dc829a7aa8056e3be50e315ea4499ecc6
üst 80fd82a6
......@@ -322,6 +322,18 @@ public:
(eOp1 == NUMBERFORMAT_OP_GT && eOp2 == NUMBERFORMAT_OP_LT) ||
(eOp1 == NUMBERFORMAT_OP_NO && eOp2 == NUMBERFORMAT_OP_NO) );
}
// Whether the first subformat code is really for negative numbers
// or another limit set.
sal_Bool IsNegativeRealNegative2() const
{
return fLimit1 == 0.0 && fLimit2 == 0.0 &&
( (eOp2 == NUMBERFORMAT_OP_GT && eOp1 == NUMBERFORMAT_OP_LT) ||
(eOp2 == NUMBERFORMAT_OP_EQ && eOp1 == NUMBERFORMAT_OP_LT) ||
(eOp2 == NUMBERFORMAT_OP_GE && eOp1 == NUMBERFORMAT_OP_LT) ||
(eOp2 == NUMBERFORMAT_OP_NO && eOp1 == NUMBERFORMAT_OP_LT) ||
(eOp2 == NUMBERFORMAT_OP_NO && eOp1 == NUMBERFORMAT_OP_LE) ||
(eOp2 == NUMBERFORMAT_OP_GT && eOp1 == NUMBERFORMAT_OP_LE));
}
// Whether the negative format is without a sign or not
bool IsNegativeWithoutSign() const;
......
......@@ -2526,6 +2526,9 @@ bool SvNumberformat::GetOutputString(double fNumber,
{
fNumber = -fNumber; // Vorzeichen eliminieren
}
if(nIx == 0 &&
IsNegativeRealNegative2() && fNumber < 0.0)
fNumber = -fNumber;
*ppColor = NumFor[nIx].GetColor();
const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
const sal_uInt16 nAnz = NumFor[nIx].GetCount();
......
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