Kaydet (Commit) bc697917 authored tarafından Eike Rathke's avatar Eike Rathke

ofz: do not force non-existent parameters into the TokenPool

Apart from that, the hard coded storage order for ocRRI and ocIpmt
did the same as the general loop, just with a fixed number of
parameters. Instead, limit the number of arguments for the loop
for these opcodes.

Change-Id: I378ccaf60da61c1a385555451456d8422ee33c50
üst e11eac6b
......@@ -136,20 +136,29 @@ void QProToSc::DoFunc( DefTokenId eOc, sal_uInt16 nArgs, const sal_Char* pExtStr
if( nArgs> 0 )
{
sal_Int16 nLast = nArgs- 1;
if( eOc == ocRRI )
aPool << eParam[ 2 ] << ocSep << eParam[ 1 ] << ocSep << eParam[ 0 ];
if( eOc == ocIpmt )
aPool << eParam[ 3 ] << ocSep << eParam[ 2 ] << ocSep << eParam[ 1 ] << ocSep << eParam[ 0 ];
else
{
aPool << eParam[ nLast ];
for( nCount = nLast - 1 ; nCount >= 0 ; nCount-- )
{
if( nCount != -1 )
aPool << ocSep << eParam[ nCount ];
}
// There should be at least 3 arguments, but with binary crap may not..
SAL_WARN_IF( nArgs < 3, "sc.filter","QProToSc::DoFunc - ocRRI expects 3 parameters but got " << nArgs);
// Store first 3 parameters to pool in order 2,1,0
if (nArgs > 3)
nArgs = 3;
}
else if( eOc == ocIpmt )
{
// There should be at least 4 arguments, but with binary crap may not..
SAL_WARN_IF( nArgs < 4, "sc.filter","QProToSc::DoFunc - ocIpmt expects 4 parameters but got " << nArgs);
// Store first 4 parameters to pool in order 3,2,1,0
if (nArgs > 3)
nArgs = 3;
}
sal_Int16 nLast = nArgs - 1;
aPool << eParam[ nLast ];
for( nCount = nLast - 1 ; nCount >= 0 ; nCount-- )
{
if( nCount != -1 )
aPool << ocSep << eParam[ nCount ];
}
}
......
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