Regina Henschel schrieb:
Hi,
I'm expanding LOGNORMDIST to the form it has in ODF spec. There it is
LOGNORMDIST( Number x [ ; Number m = 0 [ ; Number s = 1 [ ; Logical
Cumulative = TRUE() ] ] ] )
Inside OOo it is no problem. But how to export it to Excel? Excel has 3
Parameters, no one optional.
For expanding NORMDIST I had only to set the last parameter to optional.
I found in xeformula.cxx how to add the last parameter, if missing. I
have used
case ocNormDist:
if( nParamCount == 3 )
{
// NORMDIST function needs 4 parameters in Excel
PrepareParam( rFuncData );
AppendBoolToken( true );
FinishParam( rFuncData );
}
break;
and that seems to work.
But for LOGNORMDIST there are different cases, for example
LOGNORMDIST(x;m;s;TRUE()) must become LOGNORMDIST(x;m;s). A parameter
has to be removed.
LOGNORMDIST(x;m;s;FALSE()) does not exist in Excel.
LOGNORMDIST(x;m;s) Nothing to do, same as in Excel.
LOGNORMDIST(x;m) must become LOGNORMDIST(x;m;1).
LOGNORMDIST(x) must become LOGNORMDIST(x;0;1).
To increase the number of parameters, you can do something similar in
XclExpFmlaCompImpl::AppendTrailingParam (untested code!):
case ocLogNormDist:
// LOGNORMDIST function needs 3 parameters in Excel
switch( nParamCount )
{
case 1:
PrepareParam( rFuncData );
AppendIntToken( 0 );
FinishParam( rFuncData );
// do not break, add next default parameter
case 2:
PrepareParam( rFuncData );
AppendIntToken( 1 );
FinishParam( rFuncData );
break;
}
break;
To delete the 4th parameter, you can change the function info of this
function. Go to xlformula.cxx and look for ocLogNormDist, change the
line from
{ ocLogNormDist, 290, 3, 3, V, { V }, 0, 0 },
to
{ ocLogNormDist, 290, 3, 3, V, { V, V, V, C, I }, 0, 0 },
The "C" means that the 4th parameter is Calc-only and will be stripped
on export. The trailing "I" is needed for some internal resons.
Regards
Daniel
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org