diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2008-11-20 13:27:25 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2008-11-20 13:27:25 +0000 |
commit | c6161697084af38f0f6887738eb94a55ba8883ed (patch) | |
tree | 06c3142150860485f15972f7a22ac080557dbdd5 | |
parent | 4c501d12c5ed530b13d13468316f864394eb73d2 (diff) |
CWS-TOOLING: integrate CWS calc46_DEV300
-rw-r--r-- | svtools/source/numbers/zformat.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/svtools/source/numbers/zformat.cxx b/svtools/source/numbers/zformat.cxx index 196097b6c11d..1054ea8e83e2 100644 --- a/svtools/source/numbers/zformat.cxx +++ b/svtools/source/numbers/zformat.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: zformat.cxx,v $ - * $Revision: 1.78 $ + * $Revision: 1.78.168.1 $ * * This file is part of OpenOffice.org. * @@ -2391,16 +2391,16 @@ BOOL SvNumberformat::GetOutputString(double fNumber, ExpStr = String::CreateFromInt32( nExp ); } } - USHORT j = nAnz-1; // last symbol - xub_StrLen k; + USHORT j = nAnz-1; // last symbol + xub_StrLen k; // position in ExpStr bRes |= ImpNumberFill(ExpStr, fNumber, k, j, nIx, NF_SYMBOLTYPE_EXP); - while (k > 0) // erase leading zeros - { - k--; - if (ExpStr.GetChar(k) == '0') - ExpStr.Erase(0,1); - } + xub_StrLen nZeros = 0; // erase leading zeros + while (nZeros < k && ExpStr.GetChar(nZeros) == '0') + ++nZeros; + if (nZeros) + ExpStr.Erase( 0, nZeros); + BOOL bCont = TRUE; if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_EXP) { |