Unit test, with inserting a control?

Regina Henschel rb.henschel at t-online.de
Wed Feb 10 21:36:57 UTC 2021

Hi Xisco,

Xisco Fauli schrieb am 10.02.2021 um 22:03:
> Hi Regina,
> I see the patch contains a unittest. Could you eventually find a way to
> test it or do you also want to test something else ?

the patch contains a test for a default form control, those which are 
generated by Ctrl+Click. That test works for me.

But there is a test missing for the usual drag-create of a form control. 
Drag-create and default-create touch different parts of the code.

My mail contains a description, what needs to be tested, see quote below.

There will be the same problem in my upcoming fix for tdf#134355. There 
I will need to drag-create a custom-shape. And I have no idea, how to 
make a drag-create in a cppunit test.

For a legacy rectangle I had used the ctor directly. But that is neither 
possible for form control nor customshape, because you need to determine 
somehow, what kind of them you want to get.

Kind regards

> On 9/2/21 15:11, Regina Henschel wrote:
>> Hi all,
>> this is about https://gerrit.libreoffice.org/c/core/+/110636, a fix
>> for Bug 140252 - Form control is not in front of other shapes
>> I would need to make a test with this:
>> 1. Open toolbar "Form controls".
>> 2. Select a form control, e.g. the push button.
>> 3. Drag create the button control with the mouse.
>> 4. Deselect it.
>> 5. Click on "line" (or another, but not a custom shape because of bug
>> 134355) in drawing toolbar.
>> 6. Drag create the line so that it overlaps the button object.
>> Make sure, that the button object is shown on front of the line.
>> Alternatively (and likely easier)
>> 5. Examine the button object, and verify that it has properties
>> layerID="3" and LayerName="controls".
>> Error was, that it has layerID="0" and LayerName="vorne".
>> I don't see a way to do this as cppunit test.
>> Xisco, do you see a way to do it as uitest? Then I would ask you to
>> create one. I'm on Windows, that makes it difficult for me.
>> Or have you an idea, how to make it as cppunit test...?
>> Kind regards
>> Regina

More information about the LibreOffice mailing list