[Libreoffice] Developing new built-in functions within LibreCalc

Lucas Aimaretto laimaretto at gmail.com
Wed Dec 7 10:03:08 PST 2011


Hi Regina et al,

First of all, thanks for all these answers; they are very helpful.

>> I've developed my self a set of functions using visualbasic for Excel
>> and they do work fine. I've also tried those on LibreCalc (as Macros)
>> and they also work fine as well.
>>
>> I was thinking then on porting that code so as to use those functions
>> as built-in functions within Calc, but, to be honest, I have no clue
>> on how to do it. I'm not even a great programmer. I have very basic
>> knowledge on programming.
>
>
> Please tell more about the functions. What calculate the functions? Who
> needs them? If they are only useful for a very special purpose, it might be
> better to write an extension than to put them to core. We have already some
> extensions, which are delivered together with LibreOffice, and a lot of
> extensions for download.

These formulas are a set of functions that will help any networking
engineer deal with any operations regarding IPv4 addressing. I made
them because I need to handle thousands of IPv4 addresses, deal with
subnetting issues, calculate IP spaces, etc, during any average work
day at my job. Doing that by hand represents no problem at all, but
doing those operations on Excel is certainly a plus (also because
errors on calculations are less probable).

I've loved opensource since a long time and cuz that I wanted to try
this VBA code within Libre Calc, and surprisingly it did work
charmingly.

Later one, I did notice that as well, when working with many many
addresses, Excel and Calc would struggle. I then coded the VBA
functions with C++ (in other words, I built a DLL) and would call it
from within Excel. The calculations then speed up a lot (like 10 times
aprox).

So, now, I wanted to, either call this DLL from Calc or I'd love to
see these functions as built-in formulas within Calc.

You (and many other in this thread) suggested that I could write an
Add-On. Which is the difference in doing an Add-on or doing built-in
functions? Pros and cons? What's the easiest way to get this doing?
Remember that I'm a very basic programmer ... :-)

>> So, any instructions would help me out understand which is the right
>> process on developing some thing new for Libreoffice.
>>
>
> Are those functions defined in ODF1.2 and missing in Calc? Then you can
> follow the guide
> http://wiki.services.openoffice.org/wiki/Calc/Implementation/Spreadsheet_Functions
>
> Are those functions defined in regular Excel and not defined in ODF1.2? Then
> there are only small changes to the guide needed.

Well, as I said before, I have 2 codes: 1) a VBA code that works well
within Excel and Calc as a Macro and 2) a port of that VBA code into
C++ as a DLL that I have only tested in Excel.

> In both cases you first need to build LibreOffice.
> http://www.libreoffice.org/get-involved/developers/
> http://wiki.documentfoundation.org/Development/How_to_build
>
> If those functions are more suitable for an extension, you might get a
> starting point in
> http://wiki.services.openoffice.org/wiki/Extensions_development and the
> LibreOffice SDK will help you with a Developers Guide and examples.

Well, my guess is that I'll try first the Add-on way. But I do not
know what's easier or better and which are the cons and pros of going
either way.

Thanks a lot and thank you all very much for these instructions.

BR,

Lucas

-- 
"Antes teníamos hambre y mirábamos el reloj para saber qué hora era.
Ahora miramos el reloj para saber si tenemos hambre." -- Ernesto
Sábato


More information about the LibreOffice mailing list