diff options
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/sbx/sbxform.cxx | 8 | ||||
-rw-r--r-- | basic/source/sbx/sbxscan.cxx | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx index aa1bbb0a276f..45a88b556546 100644 --- a/basic/source/sbx/sbxform.cxx +++ b/basic/source/sbx/sbxform.cxx @@ -625,8 +625,8 @@ void SbxBasicFormater::ScanFormatString( double dNumber, { for( short j = nMaxDigit; j > nDigitPos; j-- ) { - short nTempDigit; - AppendDigit( sReturnStrg, nTempDigit = GetDigitAtPosScan( j, bFoundFirstDigit ) ); + short nTempDigit = GetDigitAtPosScan( j, bFoundFirstDigit ); + AppendDigit( sReturnStrg, nTempDigit ); if( nTempDigit != NO_DIGIT_ ) { bFirstDigit = false; @@ -654,8 +654,8 @@ void SbxBasicFormater::ScanFormatString( double dNumber, } else { - short nTempDigit; - AppendDigit( sReturnStrg, nTempDigit = GetDigitAtPosScan( nDigitPos, bFoundFirstDigit ) ); + short nTempDigit = GetDigitAtPosScan( nDigitPos, bFoundFirstDigit ) ; + AppendDigit( sReturnStrg, nTempDigit ); if( nTempDigit != NO_DIGIT_ ) { diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index 9b1e47827b03..d0d7cd52326e 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -408,7 +408,13 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth, if( nExpWidth < 3 ) nExpWidth = 3; nExpWidth -= 2; *pBuf++ = 'E'; - *pBuf++ =( nExp < 0 ) ?( (nExp = -nExp ), '-' ) : '+'; + if ( nExp < 0 ) + { + nExp = -nExp; + *pBuf++ = '-'; + } + else + *pBuf++ = '+'; while( nExpWidth > 3 ) { *pBuf++ = '0'; |