diff options
-rw-r--r-- | svl/inc/svl/zformat.hxx | 12 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx index ddb1535b7357..d4bbef714e9b 100644 --- a/svl/inc/svl/zformat.hxx +++ b/svl/inc/svl/zformat.hxx @@ -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; diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 45c1f29ae3e3..eca7005e2663 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -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(); |