Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


Hi Eike,

The proper place to use that if the formula string is already compiled is
in the RPN code generation formula/source/core/api/FormulaCompiler.cxx
FormulaCompiler::Factor() where in line 1177 there's also an example of
the NewOpCode() usage

    pFacToken->NewOpCode( ocUnion, FormulaToken::PrivateAccess());

In the long else{} branch there's

    else if ((SC_OPCODE_START_2_PAR <= eOp && eOp < SC_OPCODE_STOP_2_PAR)
        ...

and there at the end a pFacToken->SetByte( nSepCount ); followed by a
PutCode( pFacToken ); Before the PutCode(), when compiling ODFF and the
pFacToken's OpCode is ocIsoWeeknum and nSepCount==2 (actually nSepCount is
the argument count) you could do
    pFacToken->NewOpCode( ocWeek, FormulaToken::PrivateAccess());


Except ISOWEEKNUM is a 1-parameter function, so I had to add some more code to make it work.
And work it does (it passes the umodified unit test, which proves it works).
Thank you for your hint :)

I can continue with the patch.

Winfried

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.