diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-24 01:48:45 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-27 22:59:28 -0600 |
commit | 3f76691ac67cd358879465239abfcf8bb1732419 (patch) | |
tree | 7b71b39686dc5da312a29cb71c5da90cb104e481 /svl | |
parent | db650a359b350e10be3ad28ecb9b5b69300203a7 (diff) |
support OUStringBuffer for ImpGetOutputStandard
Change-Id: I03aa6278ee3cbbb85ffa9cbe5437493dbc7e463b
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 |