How to get a bitmap of page or shape in a unit test?
vmiklos at collabora.com
Mon Feb 25 08:44:16 UTC 2019
On Mon, Feb 25, 2019 at 01:13:00AM +0100, Regina Henschel <rb.henschel at t-online.de> wrote:
> I have tried to do it the same as in SdImportTest::testTdf93124 in
> import-tests.cxx in sd/qa/unit. But I only get a bitmap of the page without
> the shape.
Asserting pixel data in bitmap is really the last resort. :-)
If possible, it's much better to do something vector-based. Either
export the shape or page into a metafile:
or you can also do something similar to export it to SVG.
Can you check if getting the document preview + asserting metafile
content would allow you to test your changes?
I think this approach is good if your code change affects what VCL
methods are used. (If your code change affects what is stored in the
document model, then it's better to assert the document model.)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 195 bytes
Desc: Digital signature
More information about the LibreOffice