diff options
Diffstat (limited to 'svl')
-rw-r--r-- | svl/inc/svl/zformat.hxx | 1 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 25 |
2 files changed, 17 insertions, 9 deletions
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx index 69c1394b3334..d947bc943ec2 100644 --- a/svl/inc/svl/zformat.hxx +++ b/svl/inc/svl/zformat.hxx @@ -572,6 +572,7 @@ private: // standard number output SVL_DLLPRIVATE void ImpGetOutputStandard( double& fNumber, String& OutString ); SVL_DLLPRIVATE void ImpGetOutputStandard( double& fNumber, OUString& OutString ); + SVL_DLLPRIVATE void ImpGetOutputStandard( double& fNumber, OUStringBuffer& OutString ); SVL_DLLPRIVATE void ImpGetOutputStdToPrecision( double& rNumber, OUString& rOutString, sal_uInt16 nPrecision ) const; // numbers in input line SVL_DLLPRIVATE void ImpGetOutputInputLine( double fNumber, String& OutString ); diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 0af4be999fbd..f3f053a9e354 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2087,6 +2087,13 @@ void SvNumberformat::ImpGetOutputStandard(double& fNumber, String& OutString) OutString = sTemp; } +void SvNumberformat::ImpGetOutputStandard(double& fNumber, OUStringBuffer& OutString) +{ + OUString sTemp; + ImpGetOutputStandard(fNumber, sTemp); + OutString = sTemp; +} + void SvNumberformat::ImpGetOutputStandard(double& fNumber, OUString& OutString) { sal_uInt16 nStandardPrec = rScan.GetStandardPrec(); @@ -4377,10 +4384,10 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber, break; case NF_KEY_GENERAL: // Standard im String { - String sNum; + OUStringBuffer sNum; ImpGetOutputStandard(fNumber, sNum); - sNum = comphelper::string::stripStart(sNum, '-'); - sStr.insert(k, OUString(sNum)); + sNum.stripStart((sal_Unicode)'-'); + sStr.insert(k, sNum.makeStringAndClear()); break; } default: @@ -4556,10 +4563,10 @@ bool SvNumberformat::ImpNumberFillWithThousands( OUStringBuffer& sBuff, // break; case NF_KEY_GENERAL: // "General" in string { - String sNum; + OUStringBuffer sNum; ImpGetOutputStandard(rNumber, sNum); - sNum = comphelper::string::stripStart(sNum, '-'); - sBuff.insert(k, OUString(sNum)); + sNum.stripStart((sal_Unicode)'-'); + sBuff.insert(k, sNum.makeStringAndClear()); break; } default: @@ -4681,10 +4688,10 @@ bool SvNumberformat::ImpNumberFill( OUStringBuffer& sBuff, // number strin break; case NF_KEY_GENERAL: // Standard im String { - String sNum; + OUStringBuffer sNum; ImpGetOutputStandard(rNumber, sNum); - sNum = comphelper::string::stripStart(sNum, '-'); // Vorzeichen weg!! - sBuff.insert(k, OUString(sNum)); + sNum.stripStart((sal_Unicode)'-'); + sBuff.insert(k, sNum.makeStringAndClear()); } break; case NF_SYMBOLTYPE_FRAC_FDIV: // Do Nothing |