diff options
Diffstat (limited to 'svl/source/numbers/zformat.cxx')
-rw-r--r-- | svl/source/numbers/zformat.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 8c30d2442390..5cf224ba451e 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2774,9 +2774,11 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber, sSecStr = comphelper::string::stripStart(sSecStr, '.'); if ( bInputLine ) { - sSecStr = comphelper::string::stripEnd(sSecStr, '0'); - if ( sSecStr.Len() < xub_StrLen(rInfo.nCntPost) ) - sSecStr.Expand( xub_StrLen(rInfo.nCntPost), '0' ); + using namespace comphelper::string; + OUStringBuffer aBuf(stripEnd(sSecStr, '0')); + if (aBuf.getLength() < rInfo.nCntPost) + padToLength(aBuf, rInfo.nCntPost, '0'); + sSecStr = aBuf.makeStringAndClear(); ImpTransliterate( sSecStr, NumFor[nIx].GetNatNum() ); nCntPost = sSecStr.Len(); } @@ -3491,9 +3493,11 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, sSecStr = comphelper::string::stripStart(sSecStr, '.'); if ( bInputLine ) { - sSecStr = comphelper::string::stripEnd(sSecStr, '0'); - if ( sSecStr.Len() < xub_StrLen(rInfo.nCntPost) ) - sSecStr.Expand( xub_StrLen(rInfo.nCntPost), '0' ); + using namespace comphelper::string; + OUStringBuffer aBuf(stripEnd(sSecStr, '0')); + if (aBuf.getLength() < rInfo.nCntPost) + padToLength(aBuf, rInfo.nCntPost, '0'); + sSecStr = aBuf.makeStringAndClear(); ImpTransliterate( sSecStr, NumFor[nIx].GetNatNum() ); nCntPost = sSecStr.Len(); } |