Hi Rashi, On Wednesday, 2010-07-07 11:09:00 +0200, Niklas Nebel wrote:
> On 07/07/10 10:50, rashi dhing wrote: >> Wanted to use a certain function of the ScInterpreter class ! Can I give the >> whole path "sc/source/core/interpre.hxx" and use it ? > > I wouldn't recommend that. If you have a function that can be used > without ScInterpreter, you should move it out of interpre.hxx. If you're > creating an ScInterpreter instance to call your function, better use > ScFormulaCell instead. The ScInterpreter ctor needs a ScFormulaCell anyway, calling ScFormulaCell::Interpret() takes care of that. Then use ScFormulaCell::GetErrCode() to check for error. As it seems you're expecting a matrix result you may then use ScFormulaCell::GetMatrix(), note that if the result was not a matrix a NULL pointer is returned and depending on IsValue() you may use GetValue() or GetString() to obtain the result. You'll have to create the ScFormulaCell instance with the ctor that takes a preconstructed ScTokenArray* and a BYTE as last parameter and pass the MM_FORMULA constant there, otherwise the matrix result would be thrown away and only the top left value survived as cell result. Eike -- OOo Calc core developer. Number formatter stricken i18n transpositionizer. Signature key 0x87F8D412 : 2F58 5236 DB02 F335 8304 7D6C 65C9 F9B5 87F8 D412 OpenOffice.org Engineering at Oracle: 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 Oracle. Use er...@sun.com Thanks.
pgpRXRKlJMOLH.pgp
Description: PGP signature