Accessing code for Calc functions

Kaganski Mike mikekaganski at
Tue Nov 26 14:37:43 UTC 2019

Hi Steve,

On 26.11.2019 17:15, Steve Fanning wrote:
> I am currently working as a member of the Documentation Team, updating 
> Chapter 18 of the Calc Guide (Description of Functions). From time to 
> time during this task, I would benefit from viewing the code that 
> implements individual functions but have not been able to find that 
> code. Could somebody give me some hints please?

E.g., given the function CHITEST [1]:

1. I git grep for the function's name:
2. I see opcode, like "{ "CHITEST" , SC_OPCODE_CHI_TEST },", and grep 
for the opcode:
3. I see "ocChiTest = SC_OPCODE_CHI_TEST," in opcode.hxx, and grep gain 
for it:
4. In an interprN.cxx, I see "case ocChiTest :", and go there to see the 
name of function called when that opcode arrives:
5. So I see the function name is ScChiTest:

This is possibly too long, but that's from the PoV of not knowing where 
to look initially. Of course, you could also try shortcut searching for 
ScFoo when looking for FOO function... (not always helpful). Anyway, 
this shows the relevant pieces.

> It would also help if I could view the code for the Function Wizard.

For any dialog, you look into its English UI, and grep for the strings 
in it (choose specific enough):

Find the .ui file, and then grep for its name in .cxx files - you will 
find the constructor creating the dialog or one of its tabs:

So likely you need to look in formula/source/ui/dlg/formula.cxx

That's how I do that. HTH.


Best regards,
Mike Kaganski

More information about the LibreOffice mailing list