diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2014-04-04 16:10:04 +0200 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2014-04-14 12:31:52 +0200 |
commit | 2b1833d935ab4ea667bf248387bd0938ac2e9e2e (patch) | |
tree | f413040e5102f55057e45c708918ca982ea0dc71 | |
parent | 745ef97de4708b215ccb47242c89496ed59af072 (diff) |
remove _old_format_code_
-rw-r--r-- | basic/source/sbx/sbxscan.cxx | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index b6b68d6b0e6c..4d5bfdb5ce61 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -494,97 +494,6 @@ bool ImpConvStringExt( OUString& rSrc, SbxDataType eTargetType ) // the return value is the number of characters used // from the format -#ifdef _old_format_code_ -// leave the code provisionally to copy the previous implementation - -static sal_uInt16 printfmtnum( double nNum, OUString& rRes, const OUString& rWFmt ) -{ - const String& rFmt = rWFmt; - char cFill = ' '; // filling characters - char cPre = 0; // start character ( maybe "$" ) - short nExpDig= 0; // number of exponent positions - short nPrec = 0; // number of positions after decimal point - short nWidth = 0; // number range completely - short nLen; // length of converted number - bool bPoint = false; // true: with 1000 separators - bool bTrail = false; // true, if following minus - bool bSign = false; // true: always with leading sign - bool bNeg = false; // true: number is negative - char cBuf [1024]; // number buffer - char * p; - const char* pFmt = rFmt; - rRes.Erase(); - // catch $$ and **, is simply output as character - if( *pFmt == '$' ) - if( *++pFmt != '$' ) rRes += '$'; - if( *pFmt == '*' ) - if( *++pFmt != '*' ) rRes += '*'; - - switch( *pFmt++ ) - { - case 0: - break; - case '+': - bSign = true; nWidth++; break; - case '*': - nWidth++; cFill = '*'; - if( *pFmt == '$' ) nWidth++, pFmt++, cPre = '$'; - break; - case '$': - nWidth++; cPre = '$'; break; - case '#': - case '.': - case ',': - pFmt--; break; - } - // pre point - for( ;; ) - { - while( *pFmt == '#' ) pFmt++, nWidth++; - // 1000 separators? - if( *pFmt == ',' ) - { - nWidth++; pFmt++; bPoint = true; - } else break; - } - // after point - if( *pFmt == '.' ) - { - while( *++pFmt == '#' ) nPrec++; - nWidth += nPrec + 1; - } - // exponent - while( *pFmt == '^' ) - pFmt++, nExpDig++, nWidth++; - // following minus - if( !bSign && *pFmt == '-' ) - pFmt++, bTrail = true; - - // convert number - if( nPrec > 15 ) nPrec = 15; - if( nNum < 0.0 ) nNum = -nNum, bNeg = true; - p = cBuf; - if( bSign ) *p++ = bNeg ? '-' : '+'; - myftoa( nNum, p, nPrec, nExpDig, bPoint, false ); - nLen = strlen( cBuf ); - - // overflow? - if( cPre ) nLen++; - if( nLen > nWidth ) rRes += '%'; - else { - nWidth -= nLen; - while( nWidth-- ) rRes += (sal_Unicode)cFill; - if( cPre ) rRes += (sal_Unicode)cPre; - } - rRes += (sal_Unicode*)&(cBuf[0]); - if( bTrail ) - rRes += bNeg ? '-' : ' '; - - return (sal_uInt16) ( pFmt - (const char*) rFmt ); -} - -#endif //_old_format_code_ - static sal_uInt16 printfmtstr( const OUString& rStr, OUString& rRes, const OUString& rFmt ) { OUStringBuffer aTemp; |