LOK: Fix API for renderShapeSelection
commitad5fb8798b295e9ad706a3836ffb53a0630f752f
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>
Tue, 13 Nov 2018 06:24:40 +0000 (13 01:24 -0500)
committerJan Holesovsky <kendy@collabora.com>
Fri, 7 Dec 2018 10:52:31 +0000 (7 11:52 +0100)
tree35cdee5e43071fa1788fb6b60eb25623ed0c0b1b
parent2bfc4494727d347d6ae8e0c6a68dee39a2dda040
LOK: Fix API for renderShapeSelection

Unlike C++, C doesn't allow reference-to-pointer types,
and we do have C code that wouldn't compile with ref-to-ptr.
Had to change to ptr-to-ptr, which is the proper way of
having output arrays.

For the same reason, we cannot use new/delete, rather we
must use malloc/free.

Another (lesser) issue was that we used the renderShapeSelection
API to echo back an array we give it as prefix. This made
the API unecessarily complex (in undocumented ways) and
forced the implementation to both worry about user-data
and managing the input memory. This logic is best moved
to the client and the API simply returns the output data.

Speaking of returning data, the API now returns the size
of the array it allocated and wrote to, so the client
can do a simple check on the return value directly.

Change-Id: Ida216c10d5b37efd1e0861e26b72cabb25c568e6
desktop/qa/desktop_lib/test_desktop_lib.cxx
desktop/source/lib/init.cxx
include/LibreOfficeKit/LibreOfficeKit.h
include/LibreOfficeKit/LibreOfficeKit.hxx