Re: Converting java unit test to cppunit

2018-08-03 Thread Markus Mohrhard
Hello Rahul,


On Fri, Aug 3, 2018 at 7:27 PM, Rahul Gurung  wrote:

> Hi,
>
> I am trying to convert java unit tests to cppunit test and I am currently
> studying old commits, and came across this line,
>
>
> "UnoRuntime.queryInterface (XArrayFormulaRange.class, new_range);"
>
> I checked the documentation but couldn't find what this
> XArrayFormulaRange.class means, can anyone explain? I am new to Open Source.
>
>
>
UNO (our extension framework) works through interfaces. Usually names
starting with X like XArrayFormulaRange are an interface (
https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1sheet_1_1XArrayFormulaRange.html
).

To access the corresponding methods of an interface that an object
implements we need to cast between the different interfaces. This is done
in Java through UnoRuntime.queryInterface and in C++ through
uno::Reference(new_range, UNO_QUERY);

Jens Carl is currently working on the same task and has many existing
patches that you can use to understand how to convert existing code. A
recent example is
https://cgit.freedesktop.org/libreoffice/core/commit/?id=8164399df0df976784ddc1a76b46939c53ae51ee
but you can find many more through
https://cgit.freedesktop.org/libreoffice/core/log/?qt=grep=45904

Regards,
Markus
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Converting java unit test to cppunit

2018-08-03 Thread Rahul Gurung
Hi,

I am trying to convert java unit tests to cppunit test and I am currently
studying old commits, and came across this line,


"UnoRuntime.queryInterface (XArrayFormulaRange.class, new_range);"

I checked the documentation but couldn't find what this
XArrayFormulaRange.class means, can anyone explain? I am new to Open Source.

Thanks.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice