Kaydet (Commit) 2b1833d9 authored tarafından Thomas Arnhold's avatar Thomas Arnhold

remove _old_format_code_

üst 745ef97d
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment