Hi Regina,

On Wed, Jan 7, 2026 at 8:23 AM Regina Henschel <[email protected]> wrote:
>
> Hi all,
>
> this is about Bug 131124 - Export of drawing to jpg or png has initial
> zero width/height if it is 3D
> https://bugs.documentfoundation.org/show_bug.cgi?id=131124
> with proposed fix in
> https://gerrit.libreoffice.org/c/core/+/196456
>
> I would like to have a test for it, but I'm not able to write a test.
> Could someone help me?
>
> I would need a python file to be added to (I think)
> sw/qa/uitest/writer_tests8/
>
> Steps to be done:
> 1. Open a test file. I have added two test files to the bug report, one
> with an extruded custom shape, the other with a not extruded Fontwork shape.
> 2. Mark the shape. I think, that can be done with ".uno:JumpToNextFrame"
> 3. Start the ExportTo dialog. That should be possible by ".uno:ExportTo".
> 4. Make sure the option "Selection" is checked. I see the option
> disabled and checked in LibreOffices own version of the dialog and see
> it enabled but unchecked in the system version of the dialog. Which one
> is used in tests?
> 5. Select the JPEG item from the file-type drop-down list. Has it always
> the same position or is it necessary to select it by text content?
> 6. The file-name should already have an entry. There is no need to
> actually save the file. Thus I think that it is not relevant what name
> the entry has and TemporaryDirectory() might not be necessary?
> 7. Click on button "Export". That is the label I see in Ubuntu. In
> Windows it has the label "Save". I don't know the id of that button.
> That opens the dialog "JPG Options" dialog.
> 8. The "JPG Options" dialog has a radio button "Modify dimensions" and
> below it the spin fields "Width:" and "Height:". Without fix the values
> in these fields are zero and any attempt to change these values fails.
> With applied fix, the fields show the size of the shape. The UITest
> should assert, that the field values are not zero. I think the size
> might depend on the used dpi of the system on which LibreOffice runs.
> Thus testing the size itself might not work, but "not zero" looks save
> to me for a test.
> 9. Cancel the dialog.
>
> The tests should cover the cases
> Extruded shape -> jpg
> Extruded shape -> png
> Fontwork -> jpg
> Fontwork -> png
>
> If I could get a file with one of the four cases, I think I will be able
> to add the other three.

I can't help with any of that, but it looks to me that the issue is
isolated to SwXTextView::getSelection(), which is just not returning
shapes for custom shape and fontwork, so why not explicitly test this
method instead. Whatever the dialog shows is just a consequence of
this.

> Kind regards,
> Regina

Tomaž

Reply via email to