Hi Regina,

On Wednesday, 2009-08-05 16:06:45 +0200, Regina Henschel wrote:

> I'am currently looking at issue 102957 "ODFF: FLOOR and CEILING should  
> work with a single argument."
> Now OOo allows CEILING(N;Significance;Mode) and CEILING(N;Significance).  
>  I have made some changes to allow CEILING(N) too. Thereby I noticed the 
> following problem:
>
> OOo allows CEILING(N;;Mode) where the second parameter is missing. It  
> does this already in version OOo2.4.2

Presumably for Excel interoperability because there the functions have
only 2 parameters, but Excel allows CEILING(value,) and during import we
have to add the 3rd parameter to indicate the mode.

> But that is not allowed in spec (chapter 6.16.1).

We'll have to change the spec for interoperability, I created issue
http://tools.oasis-open.org/issues/browse/OFFICE-2006

> Unfortunately I can not do anything in ScCeil, because  
> in this case nParamCount is already 3 and it seems that the missing  
> parameter is set to 0. Besides the fact, that a missing second parameter  
> is not allowed, the default for the second parameter has to be +1 or -1  
> depending on the sign of N.

After the 3rd argument was popped from the stack you can check with
IsMissing() whether the 2nd argument is of type svMissing, then pop the
value with GetDouble() as usual, and after having obtained the 1st
argument change the value of the 2nd argument accordingly to +1 or -1 if
it was missing.

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to the e...@sun.com account, which I use for
 mailing lists only and don't read from outside Sun. Use er...@sun.com Thanks.

Attachment: pgpsEgz3Swk0W.pgp
Description: PGP signature

Reply via email to